Merge pull request #1190 from MITx/fix/alex/opendocs_linux

Fix/alex/opendocs linux
This commit is contained in:
David Ormsbee
2012-12-21 12:24:04 -08:00

View File

@@ -169,7 +169,7 @@ Dir["common/lib/*"].select{|lib| File.directory?(lib)}.each do |lib|
TEST_TASK_DIRS << lib
desc "Run tests for common lib #{lib} (without coverage)"
task "fasttest_#{lib}" do
task "fasttest_#{lib}" do
sh("nosetests #{lib}")
end
@@ -309,16 +309,22 @@ task :builddocs do
end
end
desc "Show doc in browser (mac only for now) TODO add linux support"
desc "Show docs in browser (mac and ubuntu)."
task :showdocs do
Dir.chdir('docs/build/html') do
sh('open index.html')
if RUBY_PLATFORM.include? 'darwin' # mac os
sh('open index.html')
elsif RUBY_PLATFORM.include? 'linux' # make more ubuntu specific?
sh('sensible-browser index.html') # ubuntu
else
raise "\nUndefined how to run browser on your machine.
Please use 'rake builddocs' and then manually open
'mitx/docs/build/html/index.html."
end
end
end
desc "Build docs and show them in browser"
task :doc => :builddocs do
Dir.chdir('docs/build/html') do
sh('open index.html')
end
Rake::Task["showdocs"].invoke
end