2012-11-13 15:11:56 -05:00
|
|
|
module Gitlab
|
|
|
|
class Seeder
|
|
|
|
def self.quiet
|
2014-03-15 05:39:35 -04:00
|
|
|
mute_mailer
|
2012-11-13 15:11:56 -05:00
|
|
|
SeedFu.quiet = true
|
2014-11-10 09:17:04 -05:00
|
|
|
yield
|
2012-11-13 15:11:56 -05:00
|
|
|
SeedFu.quiet = false
|
|
|
|
puts "\nOK".green
|
|
|
|
end
|
2014-03-15 05:39:35 -04:00
|
|
|
|
|
|
|
def self.by_user(user)
|
2014-06-10 10:51:49 -04:00
|
|
|
yield
|
2014-03-15 05:39:35 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def self.mute_mailer
|
|
|
|
code = <<-eos
|
|
|
|
def Notify.delay
|
|
|
|
self
|
|
|
|
end
|
|
|
|
eos
|
|
|
|
eval(code)
|
|
|
|
end
|
2012-11-13 15:11:56 -05:00
|
|
|
end
|
|
|
|
end
|