diff options
author | Mike Gunderloy <MikeG1@larkfarm.com> | 2009-03-24 20:06:59 -0500 |
---|---|---|
committer | Mike Gunderloy <MikeG1@larkfarm.com> | 2009-03-24 20:06:59 -0500 |
commit | fab9d3b59dc87faec96aa01ce89402a9c3e57df8 (patch) | |
tree | fc40fe92aac64a926ba5edd868a031b28f320c61 /railties/guides/rails_guides.rb | |
parent | 4e27ca4c28432cd735a8ccb82bbaff37941a9d3b (diff) | |
parent | 0e6b9695aff6500ad48c4dd9ab61343d7090b030 (diff) | |
download | rails-fab9d3b59dc87faec96aa01ce89402a9c3e57df8.tar.gz rails-fab9d3b59dc87faec96aa01ce89402a9c3e57df8.tar.bz2 rails-fab9d3b59dc87faec96aa01ce89402a9c3e57df8.zip |
Merge branch 'master' of git@github.com:lifo/docrails
Conflicts:
railties/guides/source/2_3_release_notes.textile
Diffstat (limited to 'railties/guides/rails_guides.rb')
-rw-r--r-- | railties/guides/rails_guides.rb | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/railties/guides/rails_guides.rb b/railties/guides/rails_guides.rb index 6da7de890e..e0532812e4 100644 --- a/railties/guides/rails_guides.rb +++ b/railties/guides/rails_guides.rb @@ -1,17 +1,28 @@ pwd = File.dirname(__FILE__) $: << pwd -$: << File.join(pwd, "../../activesupport/lib") -$: << File.join(pwd, "../../actionpack/lib") -require "action_controller" -require "action_view" +begin + as_lib = File.join(pwd, "../../activesupport/lib") + ap_lib = File.join(pwd, "../../actionpack/lib") + + $: << as_lib if File.directory?(as_lib) + $: << ap_lib if File.directory?(ap_lib) + + require "action_controller" + require "action_view" +rescue LoadError + require 'rubygems' + gem "actionpack", '>= 2.3' + + require "action_controller" + require "action_view" +end -# Require rubygems after loading Action View -require 'rubygems' begin - gem 'RedCloth', '>= 4.1.1'# Need exactly 4.1.1 + require 'rubygems' + gem 'RedCloth', '>= 4.1.1' rescue Gem::LoadError - $stderr.puts %(Missing the RedCloth 4.1.1 gem.\nPlease `gem install -v=4.1.1 RedCloth` to generate the guides.) + $stderr.puts %(Generating Guides requires RedCloth 4.1.1+) exit 1 end @@ -22,6 +33,7 @@ module RailsGuides autoload :Indexer, "rails_guides/indexer" autoload :Helpers, "rails_guides/helpers" autoload :TextileExtensions, "rails_guides/textile_extensions" + autoload :Levenshtein, "rails_guides/levenshtein" end RedCloth.send(:include, RailsGuides::TextileExtensions) |