Class: CLIUtils::OpenUrlAction

Inherits:
PrefAction show all
Defined in:
lib/cliutils/prefs/pref_actions/open_url_action.rb

Overview

Pref Action to open a URL in the default browser.

Instance Attribute Summary

Attributes inherited from PrefAction

#parameters

Instance Method Summary collapse

Methods included from Messaging

#messenger

Instance Method Details

#runvoid

This method returns an undefined value.

Runs the action.



9
10
11
12
13
14
# File 'lib/cliutils/prefs/pref_actions/open_url_action.rb', line 9

def run
  url = @parameters[:url]
  Launchy.open(url) do |exception|
    fail "Failed to open URL: #{ exception }" if exception
  end
end