Class: GemInfo::Runner
- Inherits:
-
Object
- Object
- GemInfo::Runner
- Defined in:
- lib/gem_info/runner.rb
Class Attribute Summary collapse
-
.expansions ⇒ Object
readonly
Returns the value of attribute expansions.
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
-
#options ⇒ Object
Returns the value of attribute options.
-
#output ⇒ Object
Returns the value of attribute output.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}, *args) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(options = {}, *args) ⇒ Runner
Returns a new instance of Runner.
7 8 9 10 11 |
# File 'lib/gem_info/runner.rb', line 7 def initialize(={}, *args) @options = @args = args @output = STDOUT end |
Class Attribute Details
.expansions ⇒ Object (readonly)
Returns the value of attribute expansions.
99 100 101 |
# File 'lib/gem_info/runner.rb', line 99 def expansions @expansions end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
13 14 15 |
# File 'lib/gem_info/runner.rb', line 13 def args @args end |
#options ⇒ Object
Returns the value of attribute options.
13 14 15 |
# File 'lib/gem_info/runner.rb', line 13 def @options end |
#output ⇒ Object
Returns the value of attribute output.
13 14 15 |
# File 'lib/gem_info/runner.rb', line 13 def output @output end |
Class Method Details
.expand(token, &expansion) ⇒ Object
95 96 97 98 |
# File 'lib/gem_info/runner.rb', line 95 def (token, &expansion) @expansions ||= {} expansions[token] = expansion end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'lib/gem_info/runner.rb', line 15 def run parse_args matcher = FuzzyMatcher.new(@name, @version) specs = matcher.matches(installed_specs) validate_exactly_one(specs) output_formatted(specs) end |