Module: Revamp::Persister::Rpm::BuilderInternals
- Included in:
- Builder
- Defined in:
- lib/revamp/persister/rpm/builder.rb
Overview
A internal methods for builder
Instance Method Summary collapse
- #cleanup_files(files) ⇒ Object
- #configure_rpm_requirements_line ⇒ Object
- #erbize(template, vars) ⇒ Object
Instance Method Details
#cleanup_files(files) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/revamp/persister/rpm/builder.rb', line 17 def cleanup_files(files) @log.debug("Files to be cleaned up: #{files}") readable = files.reject { |path| !path.readable? } readable.each do |path| path.directory? ? FileUtils.rm_r(path) : path.unlink end end |
#configure_rpm_requirements_line ⇒ Object
6 7 8 9 10 |
# File 'lib/revamp/persister/rpm/builder.rb', line 6 def configure_rpm_requirements_line req = [] model.dependencies.each { |dep| req += Revamp::Filter::PuppetVerToRpmReq.new.filter(dep) } req.join(', ') end |
#erbize(template, vars) ⇒ Object
12 13 14 15 |
# File 'lib/revamp/persister/rpm/builder.rb', line 12 def erbize(template, vars) values = OpenStruct.new(vars).instance_eval { binding } ERB.new(template).result(values) end |