class Gem2Rpm::RpmFile

Public Instance Methods

doc?() click to toggle source

Returs true for documentation files.

# File lib/gem2rpm/rpm_file.rb, line 27
def doc?
  Helpers.check_str_on_conditions(self, Gem2Rpm::Configuration.instance.rule_for(:doc))
end
ignore?() click to toggle source

Returns true for files which should be ommited from the package.

# File lib/gem2rpm/rpm_file.rb, line 37
def ignore?
  Helpers.check_str_on_conditions(self, Gem2Rpm::Configuration.instance.rule_for(:ignore))
end
license?() click to toggle source

Returns true for license files.

# File lib/gem2rpm/rpm_file.rb, line 32
def license?
  Helpers.check_str_on_conditions(self, Gem2Rpm::Configuration.instance.rule_for(:license))
end
misc?() click to toggle source

Returns true for other known miscellaneous files.

# File lib/gem2rpm/rpm_file.rb, line 47
def misc?
  Helpers.check_str_on_conditions(self, Gem2Rpm::Configuration.instance.rule_for(:misc))
end
test?() click to toggle source

Returns true for files which are part of package test suite.

# File lib/gem2rpm/rpm_file.rb, line 42
def test?
  Helpers.check_str_on_conditions(self, Gem2Rpm::Configuration.instance.rule_for(:test))
end
to_rpm() click to toggle source

Returns string with entry suitable for RPM .spec file. This typically includes all necessary macros depending on file categorization.

# File lib/gem2rpm/rpm_file.rb, line 8
def to_rpm
  config = Gem2Rpm::Configuration.instance

  case
  when license?
    "#{config.macro_for(:license)} #{config.macro_for(:instdir)}/#{self}".strip
  when doc?
    "#{config.macro_for(:doc)} #{config.macro_for(:instdir)}/#{self}".strip
  when ignore?
    "#{config.macro_for(:ignore)} #{config.macro_for(:instdir)}/#{self}".strip
  # /lib should have its own macro
  when self == 'lib'
    "#{config.macro_for(:libdir)}"
  else
    "#{config.macro_for(:instdir)}/#{self}"
  end
end