diff options
author | Xavier Noria <fxn@hashref.com> | 2010-07-30 21:50:38 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2010-07-30 21:50:53 +0200 |
commit | 87a28e34aef3f68de8e344aadc47a516e28c0b09 (patch) | |
tree | b7bd9708b929c6e822a14772b10ebd0ea7d3b440 | |
parent | 05e0fa9cfb9afd5ce4e9299c81f824d16373fc03 (diff) | |
download | rails-87a28e34aef3f68de8e344aadc47a516e28c0b09.tar.gz rails-87a28e34aef3f68de8e344aadc47a516e28c0b09.tar.bz2 rails-87a28e34aef3f68de8e344aadc47a516e28c0b09.zip |
if there's a Gemfile and doc:guides can't load RedCloth, print instructions for bundler
-rw-r--r-- | railties/guides/rails_guides.rb | 21 |
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 |