Class: Webgen::CLI::InstallCommand

Inherits:
CmdParse::Command
  • Object
show all
Defined in:
lib/webgen/cli/commands/install.rb

Overview

The CLI command for installing extension bundles.

Instance Method Summary collapse

Constructor Details

#initializeInstallCommand

:nodoc:



12
13
14
15
16
17
18
19
# File 'lib/webgen/cli/commands/install.rb', line 12

def initialize # :nodoc:
  super('install', takes_commands: false)
  short_desc('Install an extension bundle')
  long_desc(<<DESC)
Installs an extension bundle via Rubygems. You can either provide the name
of a webgen extension bundle, the name of a Rubygem or a local file name.
DESC
end

Instance Method Details

#execute(name) ⇒ Object

:nodoc:



21
22
23
24
25
26
27
# File 'lib/webgen/cli/commands/install.rb', line 21

def execute(name) # :nodoc:
  name = "webgen-#{name}-bundle" unless name =~ /\.gem$/ || name =~ /webgen-.*-bundle/

  inst = Gem::DependencyInstaller.new(:domain => :both, :force => false)
  inst.install(name)
  puts "Installed #{name}"
end