Class: Capsium::Cli

Inherits:
Thor
  • Object
show all
Extended by:
ThorExt::Start
Defined in:
lib/capsium/cli.rb,
lib/capsium/cli/convert.rb,
lib/capsium/cli/package.rb,
lib/capsium/cli/reactor.rb,
lib/capsium/cli/formatting.rb

Defined Under Namespace

Modules: Formatting Classes: Convert, Package, Reactor

Instance Method Summary collapse

Methods included from ThorExt::Start

extended, start

Instance Method Details

#install(guid) ⇒ Object



32
33
34
35
36
37
38
# File 'lib/capsium/cli.rb', line 32

def install(guid)
  registry = Capsium::Registry.fetch(options[:registry] || ENV.fetch("CAPSIUM_REGISTRY", nil))
  path = registry.install(guid, options[:constraint], store: store_dir!)
  puts "Installed #{guid} to #{path}"
rescue Capsium::Registry::RegistryError => e
  raise Thor::Error, e.message
end