2017-08-10 19:09:14 -04:00
|
|
|
# :nocov:
|
2017-03-02 18:18:50 -05:00
|
|
|
module DeliverNever
|
|
|
|
def deliver_later
|
|
|
|
self
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2018-01-26 18:25:05 -05:00
|
|
|
module MuteNotifications
|
|
|
|
def new_note(note)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2012-11-13 15:11:56 -05:00
|
|
|
module Gitlab
|
|
|
|
class Seeder
|
|
|
|
def self.quiet
|
2018-01-26 18:25:05 -05:00
|
|
|
mute_notifications
|
2017-12-27 08:41:28 -05:00
|
|
|
mute_mailer
|
2017-12-01 15:01:15 -05:00
|
|
|
|
2012-11-13 15:11:56 -05:00
|
|
|
SeedFu.quiet = true
|
2017-03-02 18:18:50 -05:00
|
|
|
|
2014-11-10 09:17:04 -05:00
|
|
|
yield
|
2017-03-02 18:18:50 -05:00
|
|
|
|
2012-11-13 15:11:56 -05:00
|
|
|
SeedFu.quiet = false
|
2016-06-01 18:37:15 -04:00
|
|
|
puts "\nOK".color(:green)
|
2012-11-13 15:11:56 -05:00
|
|
|
end
|
2014-03-15 05:39:35 -04:00
|
|
|
|
2018-01-26 18:25:05 -05:00
|
|
|
def self.mute_notifications
|
|
|
|
NotificationService.prepend(MuteNotifications)
|
|
|
|
end
|
|
|
|
|
2014-03-15 05:39:35 -04:00
|
|
|
def self.mute_mailer
|
2017-03-02 18:18:50 -05:00
|
|
|
ActionMailer::MessageDelivery.prepend(DeliverNever)
|
2014-03-15 05:39:35 -04:00
|
|
|
end
|
2012-11-13 15:11:56 -05:00
|
|
|
end
|
|
|
|
end
|
2017-08-10 19:09:14 -04:00
|
|
|
# :nocov:
|