frozen_string_literal: false
BasicSpecification is an abstract class which implements some common code used by both Specification and StubSpecification.
- A
- B
- C
- D
- E
- F
- G
- L
- M
- N
- P
- R
- S
- T
- V
| [RW] | loaded_from | The path this gemspec was loaded from. This attribute is not persisted. |
True when the gem has been activated
Returns the full path to the base gem directory.
eg: /usr/local/lib/ruby/gems/1.8
Return true if this spec can require file.
# File lib/rubygems/basic_specification.rb, line 68 def contains_requirable_file? file if @ignored then return false elsif missing_extensions? then @ignored = true warn "Ignoring #{full_name} because its extensions are not built. " + "Try: gem pristine #{name} --version #{version}" return false end have_file? file, Gem.suffixes end
The path to the data directory for this gem.
Returns full path to the directory where gem's extensions are installed.
Returns path to the extensions directory.
The full path to the gem (install path + full name).
Returns the full name (name-version) of this Gem. Platform information is included (name-version-platform) if it is specified and not the default Ruby platform.
Full paths in the gem to add to $LOAD_PATH when this gem is
activated.
Returns the full path to this spec's gem directory. eg: /usr/local/lib/ruby/1.8/gems/mygem-1.0
Returns the full path to the gems directory containing this spec's gem directory. eg: /usr/local/lib/ruby/1.8/gems
Returns a string usable in Dir.glob to match all requirable paths for this spec.
Return all files in this gem that match for glob.
Name of the gem
Platform of the gem
Paths in the gem to add to $LOAD_PATH when this gem is
activated.
See also require_paths=
If you have an extension you do not need to add
"ext" to the require path, the extension build
process will copy the extension files into “lib” for you.
The default value is "lib"
Usage:
# If all library files are in the root directory...
spec.require_path = '.'
Returns the paths to the source files for use with analysis and documentation tools. These paths are relative to full_gem_path.
Whether this specification is stubbed - i.e. we have information about the gem from a stub line, without having to evaluate the entire gemspec file.
Full path of the target library file. If the file is not in this gem, return nil.
# File lib/rubygems/basic_specification.rb, line 163 def to_fullpath path if activated? then @paths_map ||= {} @paths_map[path] ||= begin fullpath = nil suffixes = Gem.suffixes suffixes.find do |suf| full_require_paths.find do |dir| File.file?(fullpath = "#{dir}/#{path}#{suf}") end end ? fullpath : nil end else nil end end
Return a Gem::Specification from this gem