BigW Consortium Gitlab

seeder.rb 378 Bytes
Newer Older
1 2 3
module Gitlab
  class Seeder
    def self.quiet
4
      mute_mailer
5
      SeedFu.quiet = true
6
      yield
7
      SeedFu.quiet = false
8
      puts "\nOK".color(:green)
9
    end
10 11

    def self.by_user(user)
12
      yield
13 14 15 16
    end

    def self.mute_mailer
      code = <<-eos
17
def Notify.deliver_later
18 19 20
  self
end
      eos
21
      eval(code) # rubocop:disable Security/Eval
22
    end
23 24
  end
end