Sha256: f9fb294015e3921361a07b81a5143bdcd96e09f7f1dc4dbe7607e883c06688a0

Contents?: true

Size: 508 Bytes

Versions: 5

Compression:

Stored size: 508 Bytes

Contents

module ActiveSupport
  module Dependencies

    def search_for_file(path_suffix)
      path_suffix = path_suffix.sub(/(\.rb)?$/, ".rb")
      underscored_path_suffix = path_suffix.gsub(/\/([\w\.]*$)/, '/_\1')

      autoload_paths.each do |root|
        path = File.join(root, path_suffix)
        return path if File.file? path
        upath = File.join(root, underscored_path_suffix)
        return upath if File.file? upath
      end
      nil # Gee, I sure wish we had first_match ;-)
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
erector-rails4-0.1.3 lib/erector/rails/autoload_monkeypatch.rb
erector-rails4-0.1.2 lib/erector/rails/autoload_monkeypatch.rb
erector-rails4-0.1.1 lib/erector/rails/autoload_monkeypatch.rb
erector-rails4-0.1.0 lib/erector/rails/autoload_monkeypatch.rb
erector-rails4-0.0.7 lib/erector/rails/autoload_monkeypatch.rb