Class: UpdateRepo::WalkRepo
- Inherits:
-
Object
- Object
- UpdateRepo::WalkRepo
- Includes:
- Helpers
- Defined in:
- lib/update_repo.rb
Overview
An encapsulated class to walk the repo directories and update all Git repositories found therein.
Instance Method Summary collapse
-
#initialize ⇒ void
constructor
Class constructor.
-
#start ⇒ Object
This function will perform the required actions to traverse the Repo.
Methods included from Helpers
Constructor Details
#initialize ⇒ void
Class constructor. No parameters required.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/update_repo.rb', line 25 def initialize # create a new instance of the CmdConfig class then read the config var @cmd = CmdConfig.new # set up the output and logging class @log = Logger.new(cmd(:log), cmd(:timestamp)) # create instance of the Metrics class @metrics = Metrics.new(@log) # instantiate the console output class for header, footer etc @cons = ConsoleOutput.new(@log, @metrics, @cmd) end |
Instance Method Details
#start ⇒ Object
This function will perform the required actions to traverse the Repo.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/update_repo.rb', line 40 def start String.disable_colorization = !cmd(:color) # print out our header unless we are dumping / importing ... @cons.show_header unless dumping? config['location'].each do |loc| cmd(:dump_tree) ? dump_tree(File.join(loc)) : recurse_dir(loc) end # print out an informative footer unless dump / import ... @cons. unless dumping? end |