Class: GitBundle::CLI

Inherits:
Object
  • Object
show all
Includes:
Console
Defined in:
lib/git_bundle/cli.rb

Constant Summary

Constants included from Console

GitBundle::Console::COLORS

Instance Method Summary collapse

Methods included from Console

#puts_attention, #puts_error, #puts_heading, #puts_prompt, #puts_repo_heading

Constructor Details

#initializeCLI

Returns a new instance of CLI.



5
6
7
8
# File 'lib/git_bundle/cli.rb', line 5

def initialize
  @errors = []
  load_repositories
end

Instance Method Details

#invoke(args) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/git_bundle/cli.rb', line 10

def invoke(args)
  case args[0]
    when nil, '--help', 'help'
      puts `git #{args.join(' ')}`.gsub('git', 'gitb')
    when 'push'
      GitBundle::Commands::Push.new(@repositories, args[1..-1]).invoke
    else
      GitBundle::Commands::Generic.new(@repositories, args).invoke
  end
end