Class: GitBundle::CLI
Constant Summary
Constants included from Console
Instance Method Summary collapse
-
#initialize ⇒ CLI
constructor
A new instance of CLI.
- #invoke(args) ⇒ Object
Methods included from Console
#puts_attention, #puts_error, #puts_heading, #puts_prompt, #puts_repo_heading
Constructor Details
#initialize ⇒ CLI
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 |