Class: GitTree::ReplicateCommand

Inherits:
AbstractCommand show all
Defined in:
lib/commands/git_replicate.rb

Constant Summary

Constants included from Logging

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

Instance Method Summary collapse

Methods inherited from AbstractCommand

#setup

Methods included from Logging

#log, #log_stdout, verbosity, verbosity=

Constructor Details

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

Returns a new instance of ReplicateCommand.



9
10
11
12
# File 'lib/commands/git_replicate.rb', line 9

def initialize(args = ARGV, options: {})
  $PROGRAM_NAME = 'git-replicate'
  super
end

Instance Method Details

#run ⇒ nil

Returns:

  • (nil)


15
16
17
18
19
20
21
# File 'lib/commands/git_replicate.rb', line 15

def run
  setup
  result = []
  walker = GitTreeWalker.new(@args, options: @options)
  walker.find_and_process_repos { |dir, root_arg| result << replicate_one(dir, root_arg) }
  log_stdout result.join("\n") unless result.empty?
end