Method: Gem::BasicSpecification#to_fullpath

Defined in:
lib/rubygems/basic_specification.rb

#to_fullpath(path) ⇒ Object

Full path of the target library file. If the file is not in this gem, return nil.



206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/rubygems/basic_specification.rb', line 206

def to_fullpath(path)
  if activated?
    @paths_map ||= {}
    Gem.suffixes.each do |suf|
      full_require_paths.each do |dir|
        fullpath = "#{dir}/#{path}#{suf}"
        next unless File.file?(fullpath)
        @paths_map[path] ||= fullpath
      end
    end
    @paths_map[path]
  end
end