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
#clear_line, #parallel, #puts_attention, #puts_error, #puts_heading, #puts_prompt, #puts_repo_heading, #puts_repo_heading_switch, #puts_stay_on_line, #puts_wait_line
Constructor Details
Instance Method Details
#invoke(args) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# 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(@project, args[1..-1]).invoke when 'checkout' GitBundle::Commands::Checkout.new(@project, args[1..-1]).invoke when '--version' GitBundle::Commands::Version.new.invoke else GitBundle::Commands::Generic.new(@project, args).invoke end rescue Bundler::GemfileNotFound => e puts_error("Could not find Gemfile in the current directory") end |