Module: Jun::ActiveSupport::Dependencies

Extended by:
Dependencies
Included in:
Dependencies
Defined in:
lib/jun/active_support/dependencies.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#autoload_pathsObject

Returns the value of attribute autoload_paths.



8
9
10
# File 'lib/jun/active_support/dependencies.rb', line 8

def autoload_paths
  @autoload_paths
end

Instance Method Details

#find_file(filename) ⇒ Object

Returns the filepath for a given filename if the file exists in one of the directories specified in autoload_paths.



13
14
15
16
17
18
19
20
# File 'lib/jun/active_support/dependencies.rb', line 13

def find_file(filename)
  autoload_paths.each do |path|
    filepath = File.join(path, "#{filename}.rb")
    return filepath if File.file?(filepath)
  end

  nil
end