Module: Gem2Rpm::TemplateHelpers

Included in:
Gem2Rpm
Defined in:
lib/gem2rpm/template_helpers.rb

Instance Method Summary collapse

Instance Method Details

#doc_file_entries(spec) ⇒ Object

File list block for the doc sub-package



13
14
15
16
# File 'lib/gem2rpm/template_helpers.rb', line 13

def doc_file_entries(spec)
  entries = RpmFileList.new(spec.files).top_level_entries.doc_entries
  entries.to_rpm
end

#main_file_entries(spec) ⇒ Object

File list block for the main package



7
8
9
10
# File 'lib/gem2rpm/template_helpers.rb', line 7

def main_file_entries(spec)
  entries = RpmFileList.new(spec.files).top_level_entries.main_entries
  entries.to_rpm
end

#requirement(name, version = nil) ⇒ Object

Provides well formatted requirement with version.



19
20
21
22
# File 'lib/gem2rpm/template_helpers.rb', line 19

def requirement(name, version = nil)
  version = nil if version && version.to_s.empty?
  RpmDependency.new(Gem::Dependency.new(name, version)).to_rpm
end