Class: Lapidarius::Command
- Inherits:
-
Object
- Object
- Lapidarius::Command
- Defined in:
- lib/lapidarius/command.rb
Instance Attribute Summary collapse
-
#dep ⇒ Object
readonly
Returns the value of attribute dep.
Instance Method Summary collapse
- #call(gem, version = nil) ⇒ Object
-
#initialize(dep_klass: ::Gem::Commands::DependencyCommand, ui_klass: UI) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(dep_klass: ::Gem::Commands::DependencyCommand, ui_klass: UI) ⇒ Command
Returns a new instance of Command.
9 10 11 12 |
# File 'lib/lapidarius/command.rb', line 9 def initialize(dep_klass: ::Gem::Commands::DependencyCommand, ui_klass: UI) @dep = dep_klass.new @dep.ui = ui_klass.new end |
Instance Attribute Details
#dep ⇒ Object (readonly)
Returns the value of attribute dep.
7 8 9 |
# File 'lib/lapidarius/command.rb', line 7 def dep @dep end |
Instance Method Details
#call(gem, version = nil) ⇒ Object
14 15 16 17 18 |
# File 'lib/lapidarius/command.rb', line 14 def call(gem, version = nil) @dep.ui.clear! version ? @dep.invoke(gem, '-v', version) : @dep.invoke(gem) @dep.ui.out end |