class Lapidarius::Command

Attributes

dep[R]

Public Class Methods

new(dep_klass: ::Gem::Commands::DependencyCommand, ui_klass: UI) click to toggle source
# File lib/lapidarius/command.rb, line 8
def initialize(dep_klass: ::Gem::Commands::DependencyCommand, ui_klass: UI)
  @dep = dep_klass.new
  @dep.ui = ui_klass.new
end

Public Instance Methods

call(*args) click to toggle source
# File lib/lapidarius/command.rb, line 13
def call(*args)
  @dep.ui.clear!
  @dep.invoke(*options(args))
  @dep.ui.out
end

Private Instance Methods

options(args) click to toggle source
# File lib/lapidarius/command.rb, line 19
        def options(args)
  name, version, remote = args 
  [].tap do |args|
    args << "/^#{name}$/" if name
    args.concat(["-v", version]) if version
    args.concat(["-b", "-B", "10000"]) if remote
  end
end