2009-02-05 20:57:02 -05:00
|
|
|
pwd = File.dirname(__FILE__)
|
2010-01-16 16:56:20 -05:00
|
|
|
$:.unshift pwd
|
|
|
|
|
|
|
|
# Loading Action Pack requires rack and erubis.
|
|
|
|
require 'rubygems'
|
2009-02-05 20:57:02 -05:00
|
|
|
|
2009-03-17 08:26:34 -04:00
|
|
|
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
|
|
|
|
gem "actionpack", '>= 2.3'
|
|
|
|
|
|
|
|
require "action_controller"
|
|
|
|
require "action_view"
|
|
|
|
end
|
2009-02-05 20:57:02 -05:00
|
|
|
|
|
|
|
begin
|
2009-03-17 08:26:34 -04:00
|
|
|
gem 'RedCloth', '>= 4.1.1'
|
2009-02-05 20:57:02 -05:00
|
|
|
rescue Gem::LoadError
|
2009-03-17 08:26:34 -04:00
|
|
|
$stderr.puts %(Generating Guides requires RedCloth 4.1.1+)
|
2009-02-05 20:57:02 -05:00
|
|
|
exit 1
|
|
|
|
end
|
|
|
|
|
|
|
|
require 'redcloth'
|
|
|
|
|
|
|
|
module RailsGuides
|
2010-01-16 16:56:20 -05:00
|
|
|
autoload :Generator, "rails_guides/generator"
|
|
|
|
autoload :Indexer, "rails_guides/indexer"
|
|
|
|
autoload :Helpers, "rails_guides/helpers"
|
2009-02-05 20:57:02 -05:00
|
|
|
autoload :TextileExtensions, "rails_guides/textile_extensions"
|
2010-01-16 16:56:20 -05:00
|
|
|
autoload :Levenshtein, "rails_guides/levenshtein"
|
2009-02-05 20:57:02 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
RedCloth.send(:include, RailsGuides::TextileExtensions)
|
|
|
|
|
|
|
|
if $0 == __FILE__
|
|
|
|
RailsGuides::Generator.new.generate
|
|
|
|
end
|