From 4811e73645d5065786a0683c334ce3e61b7ffae4 Mon Sep 17 00:00:00 2001 From: Alexander Kryklia Date: Thu, 20 Dec 2012 17:25:43 +0200 Subject: [PATCH] enabled rake docs for ubuntu --- rakefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/rakefile b/rakefile index 3828ad036d..286332c5b8 100644 --- a/rakefile +++ b/rakefile @@ -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('sens-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