Class: Gem::Release::Context::Gemspec

Inherits:
Struct
  • Object
show all
Defined in:
lib/gem/release/context/gemspec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGemspec

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

#filenameObject (readonly)

Returns the value of attribute filename


5
6
7
# File 'lib/gem/release/context/gemspec.rb', line 5

def filename
  @filename
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name


4
5
6
# File 'lib/gem/release/context/gemspec.rb', line 4

def name
  @name
end

Instance Method Details

#exists?Boolean

Returns:

  • (Boolean)

12
13
14
# File 'lib/gem/release/context/gemspec.rb', line 12

def exists?
  filename && File.exist?(filename)
end

#gem_filenameObject


24
25
26
# File 'lib/gem/release/context/gemspec.rb', line 24

def gem_filename
  gemspec.file_name if gemspec
end

#gem_nameObject


16
17
18
# File 'lib/gem/release/context/gemspec.rb', line 16

def gem_name
  gemspec.name if gemspec
end

#homepageObject


32
33
34
# File 'lib/gem/release/context/gemspec.rb', line 32

def homepage
  gemspec.homepage if gemspec
end

#metadataObject


28
29
30
# File 'lib/gem/release/context/gemspec.rb', line 28

def 
  gemspec && gemspec. || {}
end

#versionObject


20
21
22
# File 'lib/gem/release/context/gemspec.rb', line 20

def version
  gemspec.version.to_s if gemspec
end