Skip to content

Commit 804ebbb

Browse files
committed
This adds opening of the gist in the browser window in Linux using the BROWSER variable, defined in some Linux distributions.
1 parent 0ec104a commit 804ebbb

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/gist.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ def read(gist_id)
151151
def browse(url)
152152
if RUBY_PLATFORM =~ /darwin/
153153
`open #{url}`
154+
elsif RUBY_PLATFORM =~ /linux/
155+
`#{ENV['BROWSER']} #{url}`
154156
elsif ENV['OS'] == 'Windows_NT' or
155157
RUBY_PLATFORM =~ /djgpp|(cyg|ms|bcc)win|mingw|wince/i
156158
`start "" "#{url}"`

0 commit comments

Comments
 (0)