aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/rails_guides.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2010-07-31 11:55:24 +0200
committerXavier Noria <fxn@hashref.com>2010-07-31 11:55:24 +0200
commit3d7099891f07395ed889e7da9e13b3ff9244d539 (patch)
tree6a988362ec4a6b58c90a12e6b715cd6926a111ce /railties/guides/rails_guides.rb
parent0e20e3ebc20250174867f33e0ad3972f7e7c76d0 (diff)
parentd3819daaac0d2f730f2b34af31700c914e697375 (diff)
downloadrails-3d7099891f07395ed889e7da9e13b3ff9244d539.tar.gz
rails-3d7099891f07395ed889e7da9e13b3ff9244d539.tar.bz2
rails-3d7099891f07395ed889e7da9e13b3ff9244d539.zip
Merge remote branch 'rails/master'
Diffstat (limited to 'railties/guides/rails_guides.rb')
-rw-r--r--railties/guides/rails_guides.rb21
1 files changed, 20 insertions, 1 deletions
diff --git a/railties/guides/rails_guides.rb b/railties/guides/rails_guides.rb
index e6f0b694a6..dfbb06cc76 100644
--- a/railties/guides/rails_guides.rb
+++ b/railties/guides/rails_guides.rb
@@ -1,6 +1,13 @@
pwd = File.dirname(__FILE__)
$:.unshift pwd
+# This is a predicate useful for the doc:guides task of applications.
+def bundler?
+ # Note that rake sets the cwd to the one that contains the Rakefile
+ # being executed.
+ File.exists?('Gemfile')
+end
+
# Loading Action Pack requires rack and erubis.
require 'rubygems'
@@ -20,7 +27,19 @@ begin
gem 'RedCloth', '>= 4.1.1'
require 'redcloth'
rescue Gem::LoadError
- $stderr.puts %(Generating Guides requires RedCloth 4.1.1+)
+ $stderr.puts('Generating guides requires RedCloth 4.1.1+.')
+ $stderr.puts(<<ERROR) if bundler?
+Please add
+
+ gem 'RedCloth', '>= 4.1.1'
+
+to the Gemfile, run
+
+ bundle install
+
+and try again.
+ERROR
+
exit 1
end