Sha256: 8239d91e1639bf2b279c095d4d284d841f5f713875463ecb33ea24609e289a0b

Contents?: true

Size: 632 Bytes

Versions: 4

Compression:

Stored size: 632 Bytes

Contents

require "rubygems/commands/dependency_command"
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 
      [].tap do |args|
        args << "/^#{name}$/" if name
        args.concat(["-v", version]) if version
        args.concat(["-b", "-B", "10000"]) if remote
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
lapidarius-4.5.7 lib/lapidarius/command.rb
lapidarius-4.5.6 lib/lapidarius/command.rb
lapidarius-4.5.5 lib/lapidarius/command.rb
lapidarius-4.4.4 lib/lapidarius/command.rb