module Rickroll
Constants
- VERSION
Public Class Methods
has_open?()
click to toggle source
# File lib/rickroll.rb, line 14 def self.has_open? `which open` return false unless $?.success? `open --help 2>&1`.include? 'Opens with the specified application' end
open()
click to toggle source
# File lib/rickroll.rb, line 19 def self.open has_open? ? open_with_safari : open_with_launchy end
open_with_launchy()
click to toggle source
# File lib/rickroll.rb, line 7 def self.open_with_launchy require 'launchy' Launchy.open(path) end
open_with_safari()
click to toggle source
# File lib/rickroll.rb, line 11 def self.open_with_safari `open -a Safari #{path.inspect}` end
path()
click to toggle source
# File lib/rickroll.rb, line 4 def self.path File.expand_path('../../site/index.html', __FILE__) end