Type:
Class
Constants:
NONEXISTENT_SPECIFICATION_VERSION : -1

The version number of a specification that does not specify one (i.e. RubyGems 0.7 or earlier).

CURRENT_SPECIFICATION_VERSION : 4

The specification version applied to any new Specification instances created. This should be bumped whenever something in the spec format changes.

Specification Version History:

spec   ruby
 ver    ver yyyy-mm-dd description
  -1 <0.8.0            pre-spec-version-history
   1  0.8.0 2004-08-01 Deprecated "test_suite_file" for "test_files"
                       "test_file=x" is a shortcut for "test_files=[x]"
   2  0.9.5 2007-10-01 Added "required_rubygems_version"
                       Now forward-compatible with future versions
   3  1.3.2 2009-01-03 Added Fixnum validation to specification_version
   4  1.9.0 2011-06-07 Added metadata
SPECIFICATION_VERSION_HISTORY : { -1 => ['(RubyGems versions up to and including 0.7 did not have versioned specifications)'], 1 => [ 'Deprecated "test_suite_file" in favor of the new, but equivalent, "test_files"', '"test_file=x" is a shortcut for "test_files=[x]"' ], 2 => [ 'Added "required_rubygems_version"', 'Now forward-compatible with future versions', ], 3 => [ 'Added Fixnum validation to the specification_version' ], 4 => [ 'Added sandboxed freeform metadata to the specification version.' ] }

An informal list of changes to the specification. The highest-valued key should be equal to the CURRENT_SPECIFICATION_VERSION.

MARSHAL_FIELDS : { -1 => 16, 1 => 16, 2 => 16, 3 => 17, 4 => 18 }
TODAY : Time.utc(today.year, today.month, today.day)
DateTimeFormat : /\A (\d{4})-(\d{2})-(\d{2}) (\s+ \d{2}:\d{2}:\d{2}\.\d+ \s* (Z | [-+]\d\d:\d\d) )? \Z/x
NONEXISTENT_SPECIFICATION_VERSION : -1

The version number of a specification that does not specify one (i.e. RubyGems 0.7 or earlier).

CURRENT_SPECIFICATION_VERSION : 4

The specification version applied to any new Specification instances created. This should be bumped whenever something in the spec format changes.

Specification Version History:

spec   ruby
 ver    ver yyyy-mm-dd description
  -1 <0.8.0            pre-spec-version-history
   1  0.8.0 2004-08-01 Deprecated "test_suite_file" for "test_files"
                       "test_file=x" is a shortcut for "test_files=[x]"
   2  0.9.5 2007-10-01 Added "required_rubygems_version"
                       Now forward-compatible with future versions
   3  1.3.2 2009-01-03 Added Fixnum validation to specification_version
   4  1.9.0 2011-06-07 Added metadata
SPECIFICATION_VERSION_HISTORY : { -1 => ['(RubyGems versions up to and including 0.7 did not have versioned specifications)'], 1 => [ 'Deprecated "test_suite_file" in favor of the new, but equivalent, "test_files"', '"test_file=x" is a shortcut for "test_files=[x]"' ], 2 => [ 'Added "required_rubygems_version"', 'Now forward-compatible with future versions', ], 3 => [ 'Added Fixnum validation to the specification_version' ], 4 => [ 'Added sandboxed freeform metadata to the specification version.' ] }

An informal list of changes to the specification. The highest-valued key should be equal to the CURRENT_SPECIFICATION_VERSION.

MARSHAL_FIELDS : { -1 => 16, 1 => 16, 2 => 16, 3 => 17, 4 => 18 }
TODAY : Time.utc(today.year, today.month, today.day)
DateTimeFormat : /\A (\d{4})-(\d{2})-(\d{2}) (\s+ \d{2}:\d{2}:\d{2}\.\d+ \s* (Z | [-+]\d\d:\d\d) )? \Z/x

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.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'
end

Starting in RubyGems 1.9.0, a Specification can hold arbitrary metadata. This metadata is accessed via #metadata and has the following restrictions:

  • Must be a Hash object

  • All keys and values must be Strings

  • Keys can be a maximum of 128 bytes and values can be a maximum of 1024 bytes

  • All strings must be UTF8, no binary data is allowed

For example, to add metadata for the location of a bugtracker:

s.metadata = { "bugtracker" => "http://somewhere.com/blah" }
platform=

platform=(platform) Instance Public methods The platform this gem runs on.

2015-04-10 18:58:05
gems_dir

gems_dir() Instance Public methods Returns the full path to the gems directory

2015-04-11 00:01:51
build_args

build_args() Instance Public methods Returns the

2015-04-10 22:06:24
ri_dir

ri_dir() Instance Public methods Returns the full path to this spec's ri directory

2015-04-11 01:33:59
_load

_load(str) Class Public methods Load custom marshal format, re-initializing

2015-04-10 19:00:09
add_self_to_load_path

add_self_to_load_path() Instance Public methods Adds this spec's require paths

2015-04-10 21:34:12
full_gem_path

full_gem_path() Instance Public methods The full path to the gem (install path

2015-04-10 23:54:27
reset_nil_attributes_to_default

reset_nil_attributes_to_default() Instance Public methods Reset nil attributes

2015-04-11 01:28:44
gem_dir

gem_dir() Instance Public methods Returns the full path to this spec's gem directory

2015-04-11 00:00:14
full_name

full_name() Instance Public methods Returns the full name (name-version) of

2015-04-10 23:59:23