class Gemsmith::CLI::Actions::Edit

Handles the edit action for editing an installed gem.

Attributes

editor[R]
picker[R]

Public Class Methods

new(picker: Spek::Picker, editor: Tools::Editor.new, **) click to toggle source
Calls superclass method
# File lib/gemsmith/cli/actions/edit.rb, line 19
def initialize(picker: Spek::Picker, editor: Tools::Editor.new, **)
  super(**)
  @picker = picker
  @editor = editor
end

Public Instance Methods

call(gem_name) click to toggle source
# File lib/gemsmith/cli/actions/edit.rb, line 25
def call gem_name
  case picker.call(gem_name).bind { |spec| editor.call spec }
    in Success(spec) then logger.info { "Editing: #{spec.named_version}." }
    in Failure(message) then log_error { message }
    else log_error { "Unable to handle edit action." }
  end
end

Private Instance Methods

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