Class: Gem2Rpm::Specification

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/gem2rpm/specification.rb

Instance Method Summary collapse

Instance Method Details

#dependenciesObject

A list of Gem::Dependency objects this gem depends on (includes every runtime or development dependency).



16
17
18
# File 'lib/gem2rpm/specification.rb', line 16

def dependencies
  super.map {|d| Gem2Rpm::Dependency.new d}
end

#descriptionObject

A long description of gem wrapped to 78 characters.



8
9
10
11
12
# File 'lib/gem2rpm/specification.rb', line 8

def description
  d = super.to_s.chomp
  d.gsub!(/([^.])\Z/, "\\1.")
  Helpers::word_wrap(d, 78) + "\n"
end

#development_dependenciesObject

List of dependencies that are used for development.



21
22
23
# File 'lib/gem2rpm/specification.rb', line 21

def development_dependencies
  super.map {|d| Gem2Rpm::Dependency.new d}
end

#licensesObject

The license(s) for the library. Each license must be a short name, no more than 64 characters. Returns empty array if RubyGems does not provide the field.



28
29
30
31
32
# File 'lib/gem2rpm/specification.rb', line 28

def licenses
  super
rescue
  []
end

#required_ruby_versionObject

The version of Ruby required by the gem. Returns array with empty string if the method is not provided by RubyGems yet.



41
42
43
44
45
46
47
# File 'lib/gem2rpm/specification.rb', line 41

def required_ruby_version
  @required_ruby_version ||= begin
    Helpers.requirement_versions_to_rpm(super)
  rescue
    ['']
  end
end

#required_rubygems_versionObject

The RubyGems version required by gem. For RubyGems < 0.9.5 returns only array with empty string. However, this should happen only in rare cases.



51
52
53
54
55
56
57
# File 'lib/gem2rpm/specification.rb', line 51

def required_rubygems_version
  @required_rubygems_version ||= begin
    Helpers::requirement_versions_to_rpm(super)
  rescue
    ['']
  end
end

#runtime_dependenciesObject

List of dependencies that will automatically be activated at runtime.



35
36
37
# File 'lib/gem2rpm/specification.rb', line 35

def runtime_dependencies
  super.map {|d| Gem2Rpm::Dependency.new d}
end