Class: UpdateRepo::WalkRepo
- Inherits:
-
Object
- Object
- UpdateRepo::WalkRepo
- Defined in:
- lib/update_repo.rb
Overview
An encapsulated class to walk the repo directories and update all Git repositories found therein. rubocop:disable Metrics/ClassLength
Instance Method Summary collapse
-
#initialize ⇒ void
constructor
Class constructor.
-
#start ⇒ Object
This function will perform the required actions to traverse the Repo.
Constructor Details
#initialize ⇒ void
Class constructor. No parameters required.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/update_repo.rb', line 19 def initialize # @counter - this will be incremented with each repo updated. @counter = 0 # @skip_counter - will count all repos deliberately skipped @skip_count = 0 # @ start_time - will be used to get elapsed time @start_time = 0 # read the options from Trollop and store in temp variable. # we do it this way around otherwise if configuration file is missing it # gives the error messages even on '--help' and '--version' temp_opt = # @config - Class. Reads the configuration from a file in YAML format and # allows easy access to the configuration data @config = Confoog::Settings.new(filename: CONFIG_FILE, prefix: 'update_repo', autoload: true, autosave: false) # store the command line variables in a configuration variable @config['cmd'] = temp_opt config_error unless @config.status[:errors] == Status::INFO_FILE_LOADED end |
Instance Method Details
#start ⇒ Object
This function will perform the required actions to traverse the Repo.
45 46 47 48 49 50 51 52 53 |
# File 'lib/update_repo.rb', line 45 def start String.disable_colorization = true unless @config['cmd'][:color] show_header(@config['exceptions']) @config['location'].each do |loc| recurse_dir(loc) end # print out an informative footer... end |