Class: GitTree::UpdateCommand
- Inherits:
-
AbstractCommand
- Object
- AbstractCommand
- GitTree::UpdateCommand
- Includes:
- Logging
- Defined in:
- lib/commands/git_update.rb
Constant Summary
Constants included from Logging
Logging::DEBUG, Logging::NORMAL, Logging::QUIET, Logging::VERBOSE
Instance Attribute Summary collapse
-
#runner ⇒ Object
writeonly
Sets the attribute runner.
-
#walker ⇒ Object
writeonly
Sets the attribute walker.
Instance Method Summary collapse
-
#initialize(args = ARGV, options: {}) ⇒ UpdateCommand
constructor
A new instance of UpdateCommand.
- #run ⇒ Object
Methods included from Logging
#log, #log_stdout, verbosity, verbosity=
Methods inherited from AbstractCommand
Constructor Details
#initialize(args = ARGV, options: {}) ⇒ UpdateCommand
Returns a new instance of UpdateCommand.
15 16 17 18 19 20 21 |
# File 'lib/commands/git_update.rb', line 15 def initialize(args = ARGV, options: {}) $PROGRAM_NAME = 'git-update' super # Allow walker and runner to be injected for testing @runner = @options.delete(:runner) @walker = @options.delete(:walker) end |
Instance Attribute Details
#runner=(value) ⇒ Object (writeonly)
Sets the attribute runner
11 12 13 |
# File 'lib/commands/git_update.rb', line 11 def runner=(value) @runner = value end |
#walker=(value) ⇒ Object (writeonly)
Sets the attribute walker
11 12 13 |
# File 'lib/commands/git_update.rb', line 11 def walker=(value) @walker = value end |
Instance Method Details
#run ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/commands/git_update.rb', line 23 def run setup @runner ||= CommandRunner.new @walker ||= GitTreeWalker.new(@args, options: @options) @walker.process do |dir, thread_id, walker| process_repo(walker, dir, thread_id) end end |