Class: Gem::Release::Context::Gemspec
- Inherits:
-
Struct
- Object
- Struct
- Gem::Release::Context::Gemspec
- Defined in:
- lib/gem/release/context/gemspec.rb
Instance Attribute Summary collapse
-
#filename ⇒ Object
readonly
Returns the value of attribute filename.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
- #exists? ⇒ Boolean
- #gem_filename ⇒ Object
- #gem_name ⇒ Object
- #homepage ⇒ Object
-
#initialize ⇒ Gemspec
constructor
A new instance of Gemspec.
- #metadata ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize ⇒ Gemspec
Returns a new instance of Gemspec.
7 8 9 10 |
# File 'lib/gem/release/context/gemspec.rb', line 7 def initialize(*) super @filename = name && "#{name}.gemspec" || filenames.first end |
Instance Attribute Details
#filename ⇒ Object (readonly)
Returns the value of attribute filename.
5 6 7 |
# File 'lib/gem/release/context/gemspec.rb', line 5 def filename @filename end |
#name ⇒ Object
Returns the value of attribute name
4 5 6 |
# File 'lib/gem/release/context/gemspec.rb', line 4 def name @name end |
Instance Method Details
#exists? ⇒ Boolean
12 13 14 |
# File 'lib/gem/release/context/gemspec.rb', line 12 def exists? filename && File.exist?(filename) end |
#gem_filename ⇒ Object
24 25 26 |
# File 'lib/gem/release/context/gemspec.rb', line 24 def gem_filename gemspec.file_name if gemspec end |
#gem_name ⇒ Object
16 17 18 |
# File 'lib/gem/release/context/gemspec.rb', line 16 def gem_name gemspec.name if gemspec end |
#homepage ⇒ Object
32 33 34 |
# File 'lib/gem/release/context/gemspec.rb', line 32 def homepage gemspec.homepage if gemspec end |
#metadata ⇒ Object
28 29 30 |
# File 'lib/gem/release/context/gemspec.rb', line 28 def gemspec && gemspec. || {} end |
#version ⇒ Object
20 21 22 |
# File 'lib/gem/release/context/gemspec.rb', line 20 def version gemspec.version.to_s if gemspec end |