Class: GitTree::CommitAllCommand

Inherits:
AbstractCommand show all
Includes:
Logging
Defined in:
lib/commands/git_commit_all.rb

Constant Summary

Constants included from Logging

Logging::DEBUG, Logging::NORMAL, Logging::QUIET, Logging::VERBOSE

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

#log, #log_stdout, verbosity, verbosity=

Methods inherited from AbstractCommand

#setup

Constructor Details

#initialize(args = ARGV, options: {}) ⇒ CommitAllCommand

Returns a new instance of CommitAllCommand.



17
18
19
20
21
22
# File 'lib/commands/git_commit_all.rb', line 17

def initialize(args = ARGV, options: {})
  $PROGRAM_NAME = 'git-commitAll'
  super
  # Allow walker to be injected for testing
  @walker = @options.delete(:walker)
end

Instance Attribute Details

#walker=(value) ⇒ Object (writeonly)

Sets the attribute walker

Parameters:

  • value —

    the value to set the attribute walker to.



13
14
15
# File 'lib/commands/git_commit_all.rb', line 13

def walker=(value)
  @walker = value
end

Instance Method Details

#run ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/commands/git_commit_all.rb', line 24

def run
  setup
  @options[:message] ||= '-'
  @walker ||= GitTreeWalker.new(@args, options: @options)
  @walker.process do |dir, thread_id, walker|
    process_repo(dir, thread_id, walker, @options[:message])
  end
end