Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
254 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,42 +1,31 @@ | |||
pwd = File.dirname(__FILE__) | pwd = File.dirname(__FILE__) | ||
$: << pwd | $:.unshift pwd | ||
|
|||
# Loading Action Pack requires rack and erubis. | |||
require 'rubygems' | |||
|
|
||
begin | begin | ||
# Guides generation in the Rails repo. | |||
as_lib = File.join(pwd, "../../activesupport/lib") | as_lib = File.join(pwd, "../../activesupport/lib") | ||
ap_lib = File.join(pwd, "../../actionpack/lib") | ap_lib = File.join(pwd, "../../actionpack/lib") | ||
|
|
||
$: << as_lib if File.directory?(as_lib) | $:.unshift as_lib if File.directory?(as_lib) | ||
$: << ap_lib if File.directory?(ap_lib) | $:.unshift ap_lib if File.directory?(ap_lib) | ||
|
|||
require "action_controller" | |||
require "action_view" | |||
rescue LoadError | rescue LoadError | ||
require 'rubygems' | # Guides generation from gems. | ||
gem "actionpack", '>= 2.3' | gem "actionpack", '>= 2.3' | ||
|
|||
require "action_controller" | |||
require "action_view" | |||
end | end | ||
|
|
||
begin | begin | ||
require 'rubygems' | |||
gem 'RedCloth', '>= 4.1.1' | gem 'RedCloth', '>= 4.1.1' | ||
require 'redcloth' | |||
rescue Gem::LoadError | rescue Gem::LoadError | ||
$stderr.puts %(Generating Guides requires RedCloth 4.1.1+) | $stderr.puts('Generating guides requires RedCloth 4.1.1+.') | ||
exit 1 | exit 1 | ||
end | end | ||
|
|
||
require 'redcloth' | require "rails_guides/textile_extensions" | ||
|
|||
module RailsGuides | |||
autoload :Generator, "rails_guides/generator" | |||
autoload :Indexer, "rails_guides/indexer" | |||
autoload :Helpers, "rails_guides/helpers" | |||
autoload :TextileExtensions, "rails_guides/textile_extensions" | |||
end | |||
|
|||
RedCloth.send(:include, RailsGuides::TextileExtensions) | RedCloth.send(:include, RailsGuides::TextileExtensions) | ||
|
|
||
if $0 == __FILE__ | require "rails_guides/generator" | ||
RailsGuides::Generator.new.generate | RailsGuides::Generator.new.generate | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.