lib/lapidarius/command.rb in lapidarius-3.4.0 vs lib/lapidarius/command.rb in lapidarius-4.0.1

- old
+ new

@@ -9,13 +9,21 @@ def initialize(dep_klass: ::Gem::Commands::DependencyCommand, ui_klass: UI) @dep = dep_klass.new @dep.ui = ui_klass.new end - def call(gem, version = nil) + def call(*args) @dep.ui.clear! - version ? @dep.invoke(gem, '-v', version) : @dep.invoke(gem) + @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