debian-mirror-gitlab/lib/gitlab/seeder.rb

24 lines
335 B
Ruby
Raw Normal View History

2017-08-17 22:00:37 +05:30
module DeliverNever
def deliver_later
self
end
end
2014-09-02 18:07:02 +05:30
module Gitlab
class Seeder
def self.quiet
mute_mailer
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
puts "\nOK".color(:green)
2014-09-02 18:07:02 +05:30
end
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