Sha256: a21d43cd1660156c1847f5dbb70b25759502e3c9790083fcec18325d2f01d197

Contents?: true

Size: 629 Bytes

Versions: 3

Compression:

Stored size: 629 Bytes

Contents

require "rubygems/commands/dependency_command"
require "rubygems/requirement"
require "lapidarius/ui"

module Lapidarius
  class Command
    attr_reader :dep

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

    def call(*args)
      @dep.ui.clear!
      @dep.invoke(*options(args))
      @dep.ui.out
    end

    private def options(args)
      name, version, remote = args 
      [name].tap do |args|
        args.concat(["-v", version]) if version
        args.concat(["-b", "-B", "10000"]) if remote
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
lapidarius-4.1.1 lib/lapidarius/command.rb
lapidarius-4.1.0 lib/lapidarius/command.rb
lapidarius-4.0.1 lib/lapidarius/command.rb