Permalink
Browse files

requires rubygems in all cases, fixes guides generation

  • Loading branch information...
1 parent 66ee265 commit 2b2de865944c1b3565411da42a7da5760f7146d2 @fxn fxn committed Oct 10, 2009
Showing with 8 additions and 7 deletions.
  1. +8 −7 railties/guides/rails_guides.rb
@@ -1,5 +1,8 @@
pwd = File.dirname(__FILE__)
-$: << pwd
+$:.unshift pwd
+
+# Loading Action Pack requires rack and erubis.
+require 'rubygems'
begin
as_lib = File.join(pwd, "../../activesupport/lib")
@@ -11,15 +14,13 @@
require "action_controller"
require "action_view"
rescue LoadError
- require 'rubygems'
gem "actionpack", '>= 2.3'
require "action_controller"
require "action_view"
end
begin
- require 'rubygems'
gem 'RedCloth', '>= 4.1.1'
rescue Gem::LoadError
$stderr.puts %(Generating Guides requires RedCloth 4.1.1+)
@@ -29,11 +30,11 @@
require 'redcloth'
module RailsGuides
- autoload :Generator, "rails_guides/generator"
- autoload :Indexer, "rails_guides/indexer"
- autoload :Helpers, "rails_guides/helpers"
+ autoload :Generator, "rails_guides/generator"
+ autoload :Indexer, "rails_guides/indexer"
+ autoload :Helpers, "rails_guides/helpers"
autoload :TextileExtensions, "rails_guides/textile_extensions"
- autoload :Levenshtein, "rails_guides/levenshtein"
+ autoload :Levenshtein, "rails_guides/levenshtein"
end
RedCloth.send(:include, RailsGuides::TextileExtensions)

0 comments on commit 2b2de86

Please sign in to comment.