Skip to content

Instantly share code, notes, and snippets.

View Dagnan's full-sized avatar

Michel Pigassou Dagnan

View GitHub Profile
class CommandLineApp < BasicApp
def open_url(url)
if RUBY_PLATFORM =~ /darwin/
`open #{url}`
elsif RUBY_PLATFORM =~ /linux/ && `which xdg-open` != ""
`xdg-open #{url}`
elsif RUBY_PLATFORM =~ /mswin|mingw|bccwin|wince|em/
`start #{url}`
else
puts "Please open #{@authorize_url + request_token.token} in a web browser. "