Sha256: 5b1fa018d9012e4eac9833267590d484aedaf7beb456f662a8a14f99fb038724

Contents?: true

Size: 330 Bytes

Versions: 2

Compression:

Stored size: 330 Bytes

Contents

meta :description => "open URL on web browser for Mac OSX.",
     :author      => "Sho Hashimoto <hashimoto@shokai.org>"

data do
  field "url", :type => String, :default => "http://shokai.org"
end

call do
  raise ArgumentError, 'invalid URL' unless url =~ Regexp.new("^https?://.+$")
  puts cmd = "open #{url}"
  system cmd
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bowl-0.0.2 lib/bowl/app/plugins/webbrowser.rb
bowl-0.0.1 lib/bowl/app/plugins/webbrowser.rb