Class: Gemrat::Runner
- Inherits:
-
Object
- Object
- Gemrat::Runner
- Defined in:
- lib/gemrat/runner.rb
Constant Summary
Constants included from Messages
Messages::GEM_NOT_FOUND, Messages::USAGE
Constants included from Gemrat
Class Attribute Summary collapse
-
.instance ⇒ Object
Returns the value of attribute instance.
Instance Attribute Summary collapse
-
#gem ⇒ Object
Returns the value of attribute gem.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(*args) ⇒ Runner
Returns a new instance of Runner.
15 16 17 |
# File 'lib/gemrat/runner.rb', line 15 def initialize(*args) with_error_handling { parse_arguments(*args) } end |
Class Attribute Details
.instance ⇒ Object
Returns the value of attribute instance.
4 5 6 |
# File 'lib/gemrat/runner.rb', line 4 def instance @instance end |
Instance Attribute Details
#gem ⇒ Object
Returns the value of attribute gem.
34 35 36 |
# File 'lib/gemrat/runner.rb', line 34 def gem @gem end |
Class Method Details
.run(*args) ⇒ Object
6 7 8 9 |
# File 'lib/gemrat/runner.rb', line 6 def run(*args) @instance ||= new(*args) @instance.run end |
Instance Method Details
#run ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/gemrat/runner.rb', line 19 def run for_each_gem do with_error_handling do find_exact_match ensure_gem_exists normalize_for_gemfile add_to_gemfile end end run_bundle unless gems.nil? || gems.empty? || gems.select(&:valid?).empty? end |