Class: GitAll::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/gitall/cli/app.rb

Instance Method Summary collapse

Instance Method Details

#initObject



7
8
9
10
11
# File 'lib/gitall/cli/app.rb', line 7

def init
  if Pathname(Dir.home).join('.gitall-rc.yml').exist?
    say "Error: #{Pathname(Dir.home).join('.gitall-rc.yml')} exists, not overwriting."
  end
end

#startObject



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/gitall/cli/app.rb', line 14

def start
  $threads = []
  GitAll::Bot::Bots.add_bots
  GitAll::Bot::Bots.bots.each do |name, bot|
    $threads << Thread.new do
      bot.start
      Thread.current.thread_variable_set(:network, name)
      Thread.current.thread_variable_set(:bot, bot)
    end
  end
  $threads << Thread.new { GitAll::WebHook.run! }
  $threads.each(&:join)
end