Module: RailsDevelopmentBoost::LoadablePatch

Defined in:
lib/rails_development_boost/loadable_patch.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.apply!Object



3
4
5
# File 'lib/rails_development_boost/loadable_patch.rb', line 3

def self.apply!
  Object.send :include, LoadablePatch
end

Instance Method Details

#load(file, wrap = false) ⇒ Object



7
8
9
10
11
12
13
14
15
16
# File 'lib/rails_development_boost/loadable_patch.rb', line 7

def load(file, wrap = false)
  expanded_path = File.expand_path(file)
  # force the manual #load calls for autoloadable files to go through the AS::Dep stack
  if ActiveSupport::Dependencies.in_autoload_path?(expanded_path)
    expanded_path << '.rb' unless expanded_path =~ /\.(rb|rake)\Z/
    ActiveSupport::Dependencies.load_file_from_explicit_load(expanded_path)
  else
    super
  end
end