Class: Rails::BundlerBoot

Inherits:
Boot
  • Object
show all
Defined in:
lib/rails_appengine/bundler_boot.rb

Instance Method Summary collapse

Instance Method Details

#load_initializerObject



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
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/rails_appengine/bundler_boot.rb', line 8

def load_initializer
  eval <<-END, TOPLEVEL_BINDING, __FILE__, __LINE__
    require "thread"
    class Gem::Dependency
    end
    require 'initializer'
    # require "#{RAILS_ROOT}/.gems/bundler_gems/gems/rails-2.3.5/lib/initializer"
    module Rails
      class Initializer
        def add_gem_load_paths
          puts "SKIP: add_gem_load_paths" if ENV['VERBOSE']
        end
      end
    end
    #module Gem
    #  remove_const :Dependency
    #end
    module Rails
      remove_const :GemDependency
      class GemDependency
        class << self
          def method_missing(m, *args)
            puts "Rails::GemDependency.\#{m}(\#{args.inspect}) is called." if ENV['VERBOSE']
          end
        end
      end
    end

    # initializer.rb: Dir["\#{RAILTIES_PATH}/builtin/*/"] is not work in jruby 1.4.0. jruby bug???
    class Rails::Configuration
      def builtin_directories
        return [] unless environment == 'development'
        Dir["\#{File.expand_path(RAILTIES_PATH)}/builtin/*"].select{|d| File.directory?(d) }
      end
    end

    # template.rb: `Dir.glob("#{@path}/**/*/**")` is not work in jruby 1.4.0. jruby bug???
    require "action_view"
    class ActionView::Template::EagerPath
      def templates_in_path
        Dir.glob("\#{@path}/**/*").each do |file|
          yield create_template(file) unless File.directory?(file)
        end
      end
    end
  END
  #Rails::GemDependency.hello(:world, 1234)
end