5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/few.rb', line 5
def open_browser(url)
case RUBY_PLATFORM.downcase
when /linux/
if ENV['KDE_FULL_SESSION'] == 'true'
system 'kfmclient', 'exec', url
elsif ENV['GNOME_DESKTOP_SESSION_ID']
system 'gnome-open', url, :out => File::NULL, :err => File::NULL
elsif system 'exo-open', '-v', :out => File::NULL, :err => File::NULL
system 'exo-open', url
else
system 'firefox', url
end
when /darwin/
system 'open', url
when /mswin(?!ce)|mingw|bccwin/
system 'start', url
else
system 'firefox', url
end
end
|