2014-09-02 18:07:02 +05:30
|
|
|
module Gitlab
|
|
|
|
class Seeder
|
|
|
|
def self.quiet
|
|
|
|
mute_mailer
|
|
|
|
SeedFu.quiet = true
|
|
|
|
yield
|
|
|
|
SeedFu.quiet = false
|
2016-06-16 23:09:34 +05:30
|
|
|
puts "\nOK".color(:green)
|
2014-09-02 18:07:02 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def self.by_user(user)
|
|
|
|
yield
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.mute_mailer
|
|
|
|
code = <<-eos
|
2015-12-23 02:04:40 +05:30
|
|
|
def Notify.deliver_later
|
2014-09-02 18:07:02 +05:30
|
|
|
self
|
|
|
|
end
|
|
|
|
eos
|
|
|
|
eval(code)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|