module Browser

return browser (chrome) opening command

Public Instance Methods

browse() click to toggle source
# File lib/config.rb, line 23
def browse
  if OS.windows?
    # alternatively, start seems to work - probably check if powershell v cygwin?
    '/cygdrive/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe '
  elsif OS.mac?
    'open '
  elsif OS.linux?
    'xdg-open '
  end
end
domain() click to toggle source
# File lib/config.rb, line 34
def domain
  /.*(io|com|web|net|org|gov|edu|xyz)(\/.*)?$/i
end
prep(url) click to toggle source

helper methods

# File lib/config.rb, line 39
def prep(url)
  if /^http/.match(url)
    url
  else
    'http://' + url
  end
end
wrap(url) click to toggle source
# File lib/config.rb, line 47
def wrap(url)
  "\"#{url}\""
end