Class: Gemsmith::CLI::Actions::Install
- Inherits:
-
Sod::Action
- Object
- Sod::Action
- Gemsmith::CLI::Actions::Install
- Defined in:
- lib/gemsmith/cli/actions/install.rb
Overview
Handles the install action.
Instance Method Summary collapse
- #call(name = default) ⇒ Object
-
#initialize(installer: Tools::Installer.new, loader: Spek::Loader) ⇒ Install
constructor
A new instance of Install.
Constructor Details
#initialize(installer: Tools::Installer.new, loader: Spek::Loader) ⇒ Install
Returns a new instance of Install.
24 25 26 27 28 |
# File 'lib/gemsmith/cli/actions/install.rb', line 24 def initialize(installer: Tools::Installer.new, loader: Spek::Loader, **) super(**) @installer = installer @loader = loader end |
Instance Method Details
#call(name = default) ⇒ Object
30 31 32 33 34 35 36 |
# File 'lib/gemsmith/cli/actions/install.rb', line 30 def call name = default case installer.call loader.call("#{name}.gemspec") in Success(spec) then logger.info { "Installed: #{spec.package_name}." } in Failure() then log_error { } else log_error { "Unable to handle install action." } end end |