gitlab-org--gitlab-foss/lib/gitlab/seeder.rb

37 lines
532 B
Ruby
Raw Normal View History

# :nocov:
module DeliverNever
def deliver_later
self
end
end
module MuteNotifications
def new_note(note)
end
end
2012-11-13 15:11:56 -05:00
module Gitlab
class Seeder
def self.quiet
mute_notifications
mute_mailer
2012-11-13 15:11:56 -05:00
SeedFu.quiet = true
yield
2012-11-13 15:11:56 -05:00
SeedFu.quiet = false
puts "\nOK".color(:green)
2012-11-13 15:11:56 -05:00
end
def self.mute_notifications
NotificationService.prepend(MuteNotifications)
end
def self.mute_mailer
ActionMailer::MessageDelivery.prepend(DeliverNever)
end
2012-11-13 15:11:56 -05:00
end
end
# :nocov: