Class: ElectricMonk::CLI
- Inherits:
-
Object
- Object
- ElectricMonk::CLI
- Defined in:
- lib/electric_monk.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#reporter ⇒ Object
readonly
Returns the value of attribute reporter.
Instance Method Summary collapse
-
#initialize(config_path:, reporter: Reporter.instance) ⇒ CLI
constructor
A new instance of CLI.
- #run ⇒ Object
Constructor Details
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/electric_monk.rb', line 8 def config @config end |
#reporter ⇒ Object (readonly)
Returns the value of attribute reporter.
9 10 11 |
# File 'lib/electric_monk.rb', line 9 def reporter @reporter end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/electric_monk.rb', line 16 def run config.projects.each do |project| reporter.start(project.name) unless project.exists? reporter.update_progress("Cloning #{project.name}") project.clone_project end if project.valid? reporter.fail(project.failures) else reporter.succeed(project.name) end end end |