Skip to content

Loading…

Opening gists in a browser on Linux #44

Merged
merged 1 commit into from

2 participants

@alistra

This adds opening of the gist in the browser window in Linux using the BROWSER variable, defined in some Linux distributions.

@alistra alistra This adds opening of the gist in the browser window in Linux using th…
…e BROWSER variable, defined in some Linux distributions.
804ebbb
@indirect indirect merged commit 3a6aa20 into defunkt:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 7, 2011
  1. @alistra

    This adds opening of the gist in the browser window in Linux using th…

    alistra committed
    …e BROWSER variable, defined in some Linux distributions.
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/gist.rb
View
2 lib/gist.rb
@@ -151,6 +151,8 @@ def read(gist_id)
def browse(url)
if RUBY_PLATFORM =~ /darwin/
`open #{url}`
+ elsif RUBY_PLATFORM =~ /linux/
+ `#{ENV['BROWSER']} #{url}`
elsif ENV['OS'] == 'Windows_NT' or
RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw|wince/i
`start "" "#{url}"`
Something went wrong with that request. Please try again.