BasicSpecification
is an abstract class which implements some common code used by both Specification and StubSpecification.
Base class for all Gem commands. When creating a new gem command, define initialize, execute
, arguments
, defaults_str
, description
and usage
(as appropriate). See the above mentioned methods for details.
A very good example to look at is Gem::Commands::ContentsCommand
Potentially raised when a specification is validated.
Raised by Gem::Validator
when something is not right in a gem.
Raised by Resolver when a dependency requests a gem for which there is no spec.
Gem::PathSupport
facilitates the GEM_HOME and GEM_PATH environment settings to the rest of RubyGems.
Available list of platforms for targeting Gem installations.
See ‘gem help platform` for information on platform matching.
The Specification
class contains the information for a gem. Typically defined in a .gemspec file or a Rakefile, and looks like this:
Gem::Specification.new do |s| s.name = 'example' s.version = '0.1.0' s.licenses = ['MIT'] s.summary = "This is an example!" s.description = "Much longer explanation of the example!" s.authors = ["Ruby Coder"] s.email = 'rubycoder@example.com' s.files = ["lib/example.rb"] s.homepage = 'https://rubygems.org/gems/example' s.metadata = { "source_code_uri" => "https://github.com/example/example" } end
Starting in RubyGems 2.0, a Specification
can hold arbitrary metadata. See metadata
for restrictions on the format and size of metadata items you may add to a specification.
Gem::StubSpecification
reads the stub: line from the gemspec. This prevents us having to eval the entire gemspec in order to find out certain information.
Validator
performs various gem file and gem database validation
RFC6068, the mailto URL scheme.
Raised when a mathematical function is evaluated outside of its domain of definition.
For example, since cos
returns values in the range -1..1, its inverse function acos
is only defined on that interval:
Math.acos(42)
produces:
Math::DomainError: Numerical argument is out of domain - "acos"
Process::Status
encapsulates the information on the status of a running or terminated system process. The built-in variable $?
is either nil
or a Process::Status
object.
fork { exit 99 } #=> 26557 Process.wait #=> 26557 $?.class #=> Process::Status $?.to_i #=> 25344 $? >> 8 #=> 99 $?.stopped? #=> false $?.exited? #=> true $?.exitstatus #=> 99
Posix systems record information on processes using a 16-bit integer. The lower bits record the process status (stopped, exited, signaled) and the upper bits possibly contain additional information (for example the program’s return code in the case of exited processes). Pre Ruby 1.8, these bits were exposed directly to the Ruby program. Ruby now encapsulates these in a Process::Status
object. To maximize compatibility, however, these objects retain a bit-oriented interface. In the descriptions that follow, when we talk about the integer value of stat, we’re referring to this 16 bit value.
This module contains configuration information about the SSL
extension, for example if socket support is enabled, or the host name TLS extension is enabled. Constants in this module will always be defined, but contain true
or false
values depending on the configuration of your OpenSSL
installation.
Commands will be placed in this namespace
Provides a single method deprecate
to be used to declare when something is going away.
class Legacy def self.klass_method # ... end def instance_method # ... end extend Gem::Deprecate deprecate :instance_method, "X.z", 2011, 4 class << self extend Gem::Deprecate deprecate :klass_method, :none, 2011, 4 end end