Class: Gemsmith::CLI::Actions::View
- Inherits:
-
Sod::Action
- Object
- Sod::Action
- Gemsmith::CLI::Actions::View
- Defined in:
- lib/gemsmith/cli/actions/view.rb
Overview
Handles the view action for viewing an installed gem in default browser.
Instance Method Summary collapse
- #call(gem_name) ⇒ Object
-
#initialize(picker: Spek::Picker, viewer: Tools::Viewer.new) ⇒ View
constructor
A new instance of View.
Constructor Details
Instance Method Details
#call(gem_name) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/gemsmith/cli/actions/view.rb', line 25 def call gem_name case picker.call(gem_name).bind { |spec| viewer.call spec } in Success(spec) then logger.info { "Viewing: #{spec.named_version}." } in Failure() then log_error { } else log_error { "Unable to handle view action." } end end |