File: rails_guides.rb

package info (click to toggle)
rails 2.3.5-1.2+squeeze8
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 18,248 kB
  • ctags: 20,944
  • sloc: ruby: 122,413; makefile: 72; sql: 43; sh: 1
file content (42 lines) | stat: -rw-r--r-- 947 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
pwd = File.dirname(__FILE__)
$: << pwd

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

# begin
#   require 'rubygems'
#   gem 'RedCloth', '>= 4.1.1'
# rescue Gem::LoadError
#   $stderr.puts %(Generating Guides requires RedCloth 4.1.1+)
#   exit 1
# end

require 'redcloth'

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)

if $0 == __FILE__
  RailsGuides::Generator.new.generate
end