class Gemsmith::CLI::Actions::Install

Handles the install action.

Attributes

installer[R]
loader[R]

Public Class Methods

new(installer: Tools::Installer.new, loader: Spek::Loader, **) click to toggle source
Calls superclass method
# File lib/gemsmith/cli/actions/install.rb, line 24
def initialize(installer: Tools::Installer.new, loader: Spek::Loader, **)
  super(**)
  @installer = installer
  @loader = loader
end

Public Instance Methods

call(name = default) click to toggle source
# 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(message) then log_error { message }
    else log_error { "Unable to handle install action." }
  end
end

Private Instance Methods

log_error(&) click to toggle source
# File lib/gemsmith/cli/actions/install.rb, line 42
  def log_error(&) = logger.error(&)
end