Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

use launchy for multi-platform docs opener #2

Closed
wants to merge 1 commit into from

2 participants

@drnic

No description provided.

@mattetti
Owner
@mattetti mattetti closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 29, 2012
  1. @drnic
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 1 deletion.
  1. +1 −0  templates/Gemfile
  2. +2 −1  templates/lib/tasks/doc.rake
View
1  templates/Gemfile
@@ -20,4 +20,5 @@ if ENV['RACK_ENV'] != "production"
# gem "guard-puma"
# gem "guard-minitest"
gem "rake"
+ gem "launchy"
end
View
3  templates/lib/tasks/doc.rake
@@ -4,6 +4,7 @@ namespace :doc do
ENV['DONT_CONNECT'] = 'true'
ENV['DONT_PRINT_ROUTES'] = 'true'
require 'wd_sinatra/app_loader'
+ require 'launchy'
root = File.expand_path("../..", File.dirname(__FILE__))
WDSinatra::AppLoader.server(root)
LOGGER.level = Logger::FATAL
@@ -14,7 +15,7 @@ namespace :doc do
copy_assets(destination)
File.open("#{destination}/index.html", "w"){|f| f << template.result(binding)}
puts "Documentation available there: #{destination}/index.html"
- `open #{destination}/index.html` if RUBY_PLATFORM =~ /darwin/ && !ENV['DONT_OPEN']
+ Launchy.open "#{destination}/index.html" unless ENV['DONT_OPEN']
end
def template
Something went wrong with that request. Please try again.