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

24 lines
335 B
Ruby
Raw Normal View History

module DeliverNever
def deliver_later
self
end
end
2012-11-13 15:11:56 -05:00
module Gitlab
class Seeder
def self.quiet
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_mailer
ActionMailer::MessageDelivery.prepend(DeliverNever)
end
2012-11-13 15:11:56 -05:00
end
end