Sha256: 2fdcf4b53a9792093a133c37cc254ad9551e9329a4b1d2db17623baab507339e

Contents?: true

Size: 335 Bytes

Versions: 6

Compression:

Stored size: 335 Bytes

Contents

require 'launchy'

module CLIUtils
  # Pref Action to open a URL in the default
  # browser.
  class OpenUrlAction < PrefAction
    # Runs the action.
    # @return [void]
    def run
      url = @parameters[:url]
      Launchy.open(url) do |exception|
        puts "Failed to open #{ url }: #{ exception }"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cliutils-2.1.4 lib/cliutils/prefs/pref_actions/open_url_action.rb
cliutils-2.1.3 lib/cliutils/prefs/pref_actions/open_url_action.rb
cliutils-2.1.2 lib/cliutils/prefs/pref_actions/open_url_action.rb
cliutils-2.1.1 lib/cliutils/prefs/pref_actions/open_url_action.rb
cliutils-2.1.0 lib/cliutils/prefs/pref_actions/open_url_action.rb
cliutils-2.0.3 lib/cliutils/prefs/pref_actions/open_url_action.rb