Skip to content
Browse files

Use Launchy to open the browser

  • Loading branch information...
1 parent be5bdb8 commit 35f002b0e21224b5f2af6b7ea44bf3d32b630931 @kballard committed May 21, 2008
Showing with 5 additions and 3 deletions.
  1. +1 −1 Rakefile
  2. +2 −1 lib/openri.rb
  3. +2 −1 openri.gemspec
View
2 Rakefile
@@ -11,5 +11,5 @@ end
desc 'Install openri'
task :install_gem => :gem do
- exec "gem", "install", "#{gemtask.package_dir}/#{gemtask.gem_file}"
+ exec "sudo", "gem", "install", "#{gemtask.package_dir}/#{gemtask.gem_file}"
end
View
3 lib/openri.rb
@@ -1,4 +1,5 @@
require 'rubygems'
+require 'launchy'
module OpenRi
# Opens the documentation for the specified gem
@@ -19,6 +20,6 @@ def self.open(name)
def self.open_url(url)
# this works on OS X
# I don't know what's necessary for other platforms
- exec "open", url
+ Launchy::Browser.new.visit(url)
end
end
View
3 openri.gemspec
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = "openri"
- s.version = "0.1"
+ s.version = "0.2"
s.specification_version = 2 if s.respond_to? :specification_version=
@@ -18,4 +18,5 @@ Gem::Specification.new do |s|
s.rubygems_version = "1.1.1"
s.summary = s.description
s.rdoc_options = ["--inline-source", "--title", "openri", "--main", "README"]
+ s.add_dependency('launchy', [">= 0"])
end

0 comments on commit 35f002b

Please sign in to comment.
Something went wrong with that request. Please try again.