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
-
#initialize ⇒ Gemspec
constructor
A new instance of Gemspec.
- #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
24 25 26 |
# File 'lib/gem/release/context/gemspec.rb', line 24 def exists? filename && File.exist?(filename) end |
#gem_filename ⇒ Object
20 21 22 |
# File 'lib/gem/release/context/gemspec.rb', line 20 def gem_filename gemspec.file_name if gemspec end |
#gem_name ⇒ Object
12 13 14 |
# File 'lib/gem/release/context/gemspec.rb', line 12 def gem_name gemspec.name if gemspec end |
#version ⇒ Object
16 17 18 |
# File 'lib/gem/release/context/gemspec.rb', line 16 def version gemspec.version.to_s if gemspec end |