Method: Library#legacy_loadpath

Defined in:
lib/library.rb

#legacy_loadpathObject

What is ‘legacy_loadpath`? Well, library doesn’t require you to put your library’s scripts in a named lib path, e.g. ‘lib/foo/`. Instead one can just put them in `lib/` b/c Library keeps things indexed by honest to goodness library names. The `legacy_path` then is used to handle these old style paths along with the new.



348
349
350
351
352
353
354
355
356
357
358
# File 'lib/library.rb', line 348

def legacy_loadpath
  @legacy_loadpath ||= (
    path = []
    loadpath.each do |lp|
      llp = File.join(lp, name)
      dir = File.join(location, llp)
      path << llp if File.directory?(dir)
    end
    path
  )
end