Class: GitBundle::Commands::Generic
- Inherits:
-
Object
- Object
- GitBundle::Commands::Generic
- Includes:
- GitBundle::Console
- Defined in:
- lib/git_bundle/commands/generic.rb
Constant Summary
Constants included from GitBundle::Console
Instance Method Summary collapse
-
#initialize(repositories, args) ⇒ Generic
constructor
A new instance of Generic.
- #invoke ⇒ Object
Methods included from GitBundle::Console
#puts_attention, #puts_error, #puts_heading, #puts_prompt, #puts_repo_heading
Constructor Details
#initialize(repositories, args) ⇒ Generic
Returns a new instance of Generic.
6 7 8 9 |
# File 'lib/git_bundle/commands/generic.rb', line 6 def initialize(repositories, args) @repositories = repositories @args = args end |
Instance Method Details
#invoke ⇒ Object
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/git_bundle/commands/generic.rb', line 11 def invoke errors = [] @repositories.each do |repo| puts_repo_heading(repo) puts repo.execute_git(@args.join(' ')) errors << repo.name unless $?.exitstatus == 0 end puts_error "Command failed in #{errors.join(', ')}." unless errors.empty? end |