Skip to content
This repository
Browse code

allow running without rdoc installed on the boostrap ruby. fixes #88

  • Loading branch information...
commit f9bf92c37c0edb4b74a6f565276bcfe7fb8b24f7 1 parent de98c30
Tim Felgentreff authored October 28, 2011

Showing 1 changed file with 24 additions and 16 deletions. Show diff stats Hide diff stats

  1. 40  Rakefile
40  Rakefile
@@ -2,15 +2,30 @@
2 2
 
3 3
 require 'rake/clean'
4 4
 
5  
-# Try to support Rake 0.8.7 and 0.9.x (at least for a while)
6  
-if defined? Rake::VERSION
7  
-  # Rake 0.9.x
8  
-  require 'rubygems'
9  
-  gem 'rdoc'
10  
-  require 'rdoc/task'
11  
-else
12  
-  # Rake 0.8.x
13  
-  require 'rake/rdoctask'
  5
+begin
  6
+  # Try to support Rake 0.8.7 and 0.9.x (at least for a while)
  7
+  if defined? Rake::VERSION
  8
+    # Rake 0.9.x
  9
+    require 'rubygems'
  10
+    gem 'rdoc'
  11
+    require 'rdoc/task'
  12
+  else
  13
+    # Rake 0.8.x
  14
+    require 'rake/rdoctask'
  15
+  end
  16
+
  17
+  Rake::RDocTask.new do |rd|
  18
+    rd.main = "README.rdoc"
  19
+    rd.rdoc_files.include 'docs/*', 'LICENSES.txt'
  20
+    rd.rdoc_files.include 'src/kernel/bootstrap/Maglev.rb'
  21
+    rd.rdoc_files.include 'examples/**/*README.rdoc', 'examples/**/readme.txt'
  22
+  end
  23
+rescue LoadError => e
  24
+  puts e
  25
+  puts "Generating RDoc will not work without the rdoc gem"
  26
+
  27
+  task :rdoc { puts "Install the rdoc gem and re-run this" }
  28
+  task :rerdoc { puts "Install the rdoc gem and re-run this" }
14 29
 end
15 30
 
16 31
 $LOAD_PATH << File.dirname(__FILE__)  # For 1.9, '.' is no longer in the load path
@@ -24,13 +39,6 @@ CLEAN.include('*.out', 'log/vmunit*.out', 'log/all*.out', 'html',
24 39
               'vmunit.log', 'topazerrors.log', 'gem_*_code.log')
25 40
 CLOBBER.include('lib/ruby/site_ruby/1.8/smalltalk', 'version.txt')
26 41
 
27  
-Rake::RDocTask.new do |rd|
28  
-  rd.main = "README.rdoc"
29  
-  rd.rdoc_files.include 'docs/*', 'LICENSES.txt'
30  
-  rd.rdoc_files.include 'src/kernel/bootstrap/Maglev.rb'
31  
-  rd.rdoc_files.include 'examples/**/*README.rdoc', 'examples/**/readme.txt'
32  
-end
33  
-
34 42
 task :default => :status
35 43
 
36 44
 desc "Show status of all stones"

0 notes on commit f9bf92c

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