2018-03-17 18:26:18 +05:30
|
|
|
# :nocov:
|
2017-08-17 22:00:37 +05:30
|
|
|
module DeliverNever
|
|
|
|
def deliver_later
|
|
|
|
self
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
module MuteNotifications
|
|
|
|
def new_note(note)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
module Gitlab
|
|
|
|
class Seeder
|
|
|
|
def self.quiet
|
2018-03-17 18:26:18 +05:30
|
|
|
mute_notifications
|
2014-09-02 18:07:02 +05:30
|
|
|
mute_mailer
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
SeedFu.quiet = true
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
yield
|
2017-08-17 22:00:37 +05:30
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
SeedFu.quiet = false
|
2016-06-16 23:09:34 +05:30
|
|
|
puts "\nOK".color(:green)
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
def self.mute_notifications
|
|
|
|
NotificationService.prepend(MuteNotifications)
|
|
|
|
end
|
|
|
|
|
2014-09-02 18:07:02 +05:30
|
|
|
def self.mute_mailer
|
2017-08-17 22:00:37 +05:30
|
|
|
ActionMailer::MessageDelivery.prepend(DeliverNever)
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2018-03-17 18:26:18 +05:30
|
|
|
# :nocov:
|