In Files

  • rubygems/basic_specification.rb

Class/Module Index [+]



BasicSpecification is an abstract class which implements some common code used by both Specification and StubSpecification.



The filename of the gem specification

Public Class Methods

default_specifications_dir() click to toggle source
               # File rubygems/basic_specification.rb, line 5
def self.default_specifications_dir
  File.join(Gem.default_dir, "specifications", "default")

Public Instance Methods

activated?() click to toggle source

True when the gem has been activated

               # File rubygems/basic_specification.rb, line 40
def activated?
  raise NotImplementedError
contains_requirable_file?(file) click to toggle source

Return true if this spec can require file.

               # File rubygems/basic_specification.rb, line 70
def contains_requirable_file? file
  root     = full_gem_path
  suffixes = Gem.suffixes

  require_paths.any? do |lib|
    base = "#{root}/#{lib}/#{file}"
    suffixes.any? { |suf| File.file? "#{base}#{suf}" }
filename=(path) click to toggle source

Set the filename of the Specification was loaded from. path is converted to a String.

               # File rubygems/basic_specification.rb, line 59
def filename= path
  @filename      = path && path.to_s

  @full_gem_path = nil
  @gems_dir      = nil
  @base_dir      = nil
full_gem_path() click to toggle source

The full path to the gem (install path + full name).

               # File rubygems/basic_specification.rb, line 83
def full_gem_path
  # TODO: This is a heavily used method by gems, so we'll need
  # to aleast just alias it to #gem_dir rather than remove it.
  @full_gem_path ||= find_full_gem_path
name() click to toggle source

Name of the gem

               # File rubygems/basic_specification.rb, line 12
def name
  raise NotImplementedError
platform() click to toggle source

Platform of the gem

               # File rubygems/basic_specification.rb, line 26
def platform
  raise NotImplementedError
require_paths() click to toggle source

Require paths of the gem

               # File rubygems/basic_specification.rb, line 33
def require_paths
  raise NotImplementedError
to_spec() click to toggle source

Return a Gem::Specification from this gem

               # File rubygems/basic_specification.rb, line 47
def to_spec
  raise NotImplementedError
version() click to toggle source

Version of the gem

               # File rubygems/basic_specification.rb, line 19
def version
  raise NotImplementedError

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please see Improve the docs, or visit

blog comments powered by Disqus