Check loaded features for one that matches “#{any of the load path}/#{feature}”
# File lib/backports/tools.rb, line 32 def include?(feature) return true if @@our_loads[feature] # Assume backported features are Ruby libraries (i.e. not C) @loaded ||= $LOADED_FEATURES.group_by{|p| File.basename(p, ".rb")} if fullpaths = @loaded[File.basename(feature, ".rb")] fullpaths.any?{|fullpath| base_dir, = fullpath.partition("/#{feature}") $LOAD_PATH.include?(base_dir) } end end
Generated with the Darkfish Rdoc Generator 2.