Class: Gem::Specification
- Inherits:
-
Micro::YAMLable
- Object
- Micro::YAMLable
- Gem::Specification
- Defined in:
- lib/microgem/specification.rb
Instance Attribute Summary collapse
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#executables ⇒ Object
readonly
Returns the value of attribute executables.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#source ⇒ Object
The Gem::Micro::Source from which this Specification originates.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Class Method Summary collapse
-
._load(val) ⇒ Object
TODO: For marshal, need to actually fix this, copied array elements code from RubyGems, cleanup.
Instance Method Summary collapse
-
#gem_dirname ⇒ Object
(also: #to_s)
Returns the Specification’s dirname:.
-
#gem_filename ⇒ Object
Returns the Specification’s filename:.
- #inspect ⇒ Object
-
#install! ⇒ Object
Installs the gem for this Specification.
-
#to_ruby ⇒ Object
Returns a Ruby syntax representation of the Specification which is used to generate the gemspec files that RubyGems uses to check for gems.
Methods inherited from Micro::YAMLable
Instance Attribute Details
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
3 4 5 |
# File 'lib/microgem/specification.rb', line 3 def dependencies @dependencies end |
#executables ⇒ Object (readonly)
Returns the value of attribute executables.
3 4 5 |
# File 'lib/microgem/specification.rb', line 3 def executables @executables end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/microgem/specification.rb', line 3 def name @name end |
#source ⇒ Object
The Gem::Micro::Source from which this Specification originates.
6 7 8 |
# File 'lib/microgem/specification.rb', line 6 def source @source end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
3 4 5 |
# File 'lib/microgem/specification.rb', line 3 def version @version end |
Class Method Details
._load(val) ⇒ Object
TODO: For marshal, need to actually fix this, copied array elements code from RubyGems, cleanup
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/microgem/specification.rb', line 39 def self._load(val) array = Marshal.load(val) spec = new spec.instance_variable_set :@rubygems_version, array[0] # spec version spec.instance_variable_set :@name, array[2] spec.instance_variable_set :@version, array[3] spec.instance_variable_set :@date, array[4] spec.instance_variable_set :@summary, array[5] spec.instance_variable_set :@required_ruby_version, array[6] spec.instance_variable_set :@required_rubygems_version, array[7] spec.instance_variable_set :@original_platform, array[8] spec.instance_variable_set :@dependencies, array[9] spec.instance_variable_set :@rubyforge_project, array[10] spec.instance_variable_set :@email, array[11] spec.instance_variable_set :@authors, array[12] spec.instance_variable_set :@description, array[13] spec.instance_variable_set :@homepage, array[14] spec.instance_variable_set :@has_rdoc, array[15] spec.instance_variable_set :@new_platform, array[16] spec.instance_variable_set :@platform, array[16].to_s spec end |
Instance Method Details
#gem_dirname ⇒ Object Also known as: to_s
Returns the Specification’s dirname:
rake.gem_dirname # => "rake-0.8.1"
11 12 13 |
# File 'lib/microgem/specification.rb', line 11 def gem_dirname "#{name}-#{version}" end |
#gem_filename ⇒ Object
Returns the Specification’s filename:
rake.gem_filename # => "rake-0.8.1.gem"
19 20 21 |
# File 'lib/microgem/specification.rb', line 19 def gem_filename "#{gem_dirname}.gem" end |
#inspect ⇒ Object
28 29 30 |
# File 'lib/microgem/specification.rb', line 28 def inspect "#<Gem::Specification:#{object_id} name=\"#{name}\" version=\"#{version}\">" end |
#install! ⇒ Object
Installs the gem for this Specification.
24 25 26 |
# File 'lib/microgem/specification.rb', line 24 def install! Micro::Installer.new(self).install! end |
#to_ruby ⇒ Object
Returns a Ruby syntax representation of the Specification which is used to generate the gemspec files that RubyGems uses to check for gems.
34 35 36 |
# File 'lib/microgem/specification.rb', line 34 def to_ruby Micro::SpecificationEmitter.new(self).to_ruby end |