Class: Gel::Command::InstallGem

Inherits:
Gel::Command show all
Defined in:
lib/gel/command/install_gem.rb

Instance Attribute Summary

Attributes inherited from Gel::Command

#reraise

Instance Method Summary collapse

Methods inherited from Gel::Command

extract_word, handle_error, run

Instance Method Details

#run(command_line) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/gel/command/install_gem.rb', line 4

def run(command_line)
  gem_name, gem_version = command_line

  require_relative "../catalog"
  require_relative "../work_pool"

  Gel::WorkPool.new(2) do |work_pool|
    catalog = Gel::Catalog.new("https://rubygems.org", work_pool: work_pool)

    Gel::Environment.install_gem([catalog], gem_name, gem_version, output: $stderr)
  end
end