File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed
test/application/initializers Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1+ * Support for Pathnames in eager load paths.
2+
3+ * Mike Pack*
4+
15* Fixed missing line and shadow on service pages(404, 422, 500).
26
37 * Dmitry Korotkov*
Original file line number Diff line number Diff line change @@ -465,7 +465,7 @@ def load_generators(app=self)
465465 # files inside eager_load paths.
466466 def eager_load!
467467 config . eager_load_paths . each do |load_path |
468- matcher = /\A #{ Regexp . escape ( load_path ) } \/ (.*)\. rb\Z /
468+ matcher = /\A #{ Regexp . escape ( load_path . to_s ) } \/ (.*)\. rb\Z /
469469 Dir . glob ( "#{ load_path } /**/*.rb" ) . sort . each do |file |
470470 require_dependency file . sub ( matcher , '\1' )
471471 end
Original file line number Diff line number Diff line change @@ -71,6 +71,20 @@ module Zoo::ReptileHouse ; end
7171 assert Zoo
7272 end
7373
74+ test "eager loading accepts Pathnames" do
75+ app_file "lib/foo.rb" , <<-RUBY
76+ module Foo; end
77+ RUBY
78+
79+ add_to_config <<-RUBY
80+ config.eager_load = true
81+ config.eager_load_paths << Pathname.new("#{ app_path } /lib")
82+ RUBY
83+
84+ require "#{ app_path } /config/environment"
85+ assert Foo
86+ end
87+
7488 test "load environment with global" do
7589 $initialize_test_set_from_env = nil
7690 app_file "config/environments/development.rb" , <<-RUBY
You can’t perform that action at this time.
0 commit comments