Class: Lapidarius::Command

Inherits:
Object
  • Object
show all
Defined in:
lib/lapidarius/command.rb

Instance Method Summary collapse

Constructor Details

#initialize(dep_klass: ::Gem::Commands::DependencyCommand, ui_klass: UI) ⇒ Command

Returns a new instance of Command.



6
7
8
9
# File 'lib/lapidarius/command.rb', line 6

def initialize(dep_klass: ::Gem::Commands::DependencyCommand, ui_klass: UI)
  @dep = dep_klass.new
  @dep.ui = ui_klass.new
end

Instance Method Details

#call(gem) ⇒ Object



11
12
13
14
15
# File 'lib/lapidarius/command.rb', line 11

def call(gem)
  @dep.ui.clear!
  @dep.invoke(gem)
  @dep.ui.out
end