class

Gem::Specification

ruby latest stable - Superclass: Object

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       = '[email protected]'
  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.

Constants

CURRENT_SPECIFICATION_VERSION = 4

DateLike = Object.new # :nodoc:

DateTimeFormat = # :nodoc:\n/\\A\n(\\d{4})-(\\d{2})-(\\d{2})\n(\\s+ \\d{2}:\\d{2}:\\d{2}\\.\\d+ \\s* (Z | [-+]\\d\\d:\\d\\d) )?\n\\Z/x

EMPTY = [].freeze # :nodoc:

INITIALIZE_CODE_FOR_DEFAULTS = { }

LOAD_CACHE = {}

MARSHAL_FIELDS = { # :nodoc:\n-1 => 16,\n1 => 16,\n2 => 16,\n3 => 17,\n4 => 18,\n}

NONEXISTENT_SPECIFICATION_VERSION = -1

NOT_FOUND = Struct.new(:to_spec, :this).new # :nodoc:

SPECIFICATION_VERSION_HISTORY = { # :nodoc:\n-1 => ['(RubyGems versions up to and including 0.7 did not have versioned specifications)'],\n1 => [\n'Deprecated "test_suite_file" in favor of the new, but equivalent, "test_files"',\n'"test_file=x" is a shortcut for "test_files=[x]"'\n],\n2 => [\n'Added "required_rubygems_version"',\n'Now forward-compatible with future versions',\n],\n3 => [\n'Added Fixnum validation to the specification_version'\n],\n4 => [\n'Added sandboxed freeform metadata to the specification version.'\n]\n}

TODAY = Time.utc(today.year, today.month, today.day)

VALID_NAME_PATTERN = /\\A[a-zA-Z0-9\\.\\-\\_]+\\z/

Attributes

[RW]activated
[RW]activated?
[RW]autorequire
[RW]bindir
[RW]cert_chain
[W]default_executable
[R]description
[RW]email
[RW]homepage
[RW]metadata
[RW]name
[W]original_platform
[RW]post_install_message
[R]required_ruby_version
[R]required_rubygems_version
[RW]rubyforge_project
[RW]rubygems_version
[RW]signing_key
[RW]specification_version
[R]summary
[R]version

Files

  • lib/rubygems/specification.rb