Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 3176

Show
Ignore:
Timestamp:
11/23/05 22:33:45 (3 years ago)
Author:
bitsweat
Message:

Dependencies: set load_file_name = file_name if it ends in .rb

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activesupport/lib/active_support/dependencies.rb

    r3169 r3176  
    4444    if load? 
    4545      # Append .rb if we have a bare file name. 
    46       load_file_name = "#{file_name}.rb" unless file_name[-3..-1] == '.rb' 
     46      load_file_name = (file_name =~ /\.rb$/ ? file_name : "#{file_name}.rb") 
    4747 
    4848      # Enable warnings iff this file has not been loaded before.