Skip to content

Commit

Permalink
Update the initial UI open to use Launchy
Browse files Browse the repository at this point in the history
This should make it work across platform, when previously it would
only work in OSX.
  • Loading branch information
acant committed Jan 2, 2014
1 parent e6a8076 commit 4c95ffc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions gitdocs.gemspec
Expand Up @@ -34,6 +34,7 @@ Gem::Specification.new do |s|
s.add_dependency 'shell_tools', "~> 0.1.0"
s.add_dependency 'mimetype-fu', "~> 0.1.2"
s.add_dependency 'eventmachine', '>= 1.0.3'
s.add_dependency 'launchy', '~> 2.4.2'

s.add_development_dependency 'minitest', "~> 5.0.8"
s.add_development_dependency 'rake'
Expand Down
3 changes: 2 additions & 1 deletion lib/gitdocs/server.rb
Expand Up @@ -4,6 +4,7 @@
require 'uri'
require 'haml'
require 'mimetype_fu'
require 'launchy'

module Gitdocs
class Server
Expand Down Expand Up @@ -152,7 +153,7 @@ def wait_for_start_and_open(restarting)
TCPSocket.open('127.0.0.1', @port).close
@manager.log('Web server running!')
if !restarting && @manager.config.global.load_browser_on_startup
system("open http://localhost:#{@port}/")
Launchy.open("http://localhost:#{@port}/")
end
rescue Errno::ECONNREFUSED
sleep 0.2
Expand Down

0 comments on commit 4c95ffc

Please sign in to comment.