Changeset 250
- Timestamp:
- 12/22/04 13:44:16 (4 years ago)
- Files:
-
- trunk/actionpack/CHANGELOG (modified) (1 diff)
- trunk/actionpack/lib/action_controller/helpers.rb (modified) (1 diff)
- trunk/actionpack/test/controller/helper_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionpack/CHANGELOG
r239 r250 1 1 *SVN* 2 3 * Added more informative exception when using helper :some_helper and the helper requires another file that fails, you'll get an 4 error message tells you what file actually failed to load, rather than falling back on assuming it was the helper file itself #346 [dblack] 2 5 3 6 * Fixed regression with Base#reset_session that wouldn't use the the DEFAULT_SESSION_OPTIONS [adam@the-kramers.net] trunk/actionpack/lib/action_controller/helpers.rb
r194 r250 56 56 begin 57 57 require_dependency(file_name) 58 rescue LoadError 59 raise LoadError, "Missing helper file helpers/#{file_name}.rb" 58 rescue LoadError => load_error 59 requiree = / -- (.*?)(\.rb)?$/.match(load_error).to_a[1] 60 if requiree == file_name 61 raise LoadError, "Missing helper file helpers/#{file_name}.rb" 62 else 63 raise LoadError, "Can't load file: #{requiree}" 64 end 60 65 end 61 66 raise ArgumentError, "Missing #{class_name} module in helpers/#{file_name}.rb" unless Object.const_defined?(class_name) trunk/actionpack/test/controller/helper_test.rb
r4 r250 71 71 end 72 72 73 def test_declare_missing_file_from_helper 74 require 'broken_helper' 75 rescue LoadError => e 76 assert_nil /\bbroken_helper\b/.match(e.to_s)[1] 77 end 78 73 79 def test_helper_block 74 80 assert_nothing_raised {