Class: Revamp::Persister::Rpm
- Inherits:
-
Object
- Object
- Revamp::Persister::Rpm
- Defined in:
- lib/revamp/persister/rpm.rb
Overview
A main RPM persister
Defined Under Namespace
Modules: BuilderInternals Classes: Builder, CommandLine
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize ⇒ Rpm
constructor
A new instance of Rpm.
- #persist(model) ⇒ Object
- #persisted? ⇒ Boolean
Constructor Details
#initialize ⇒ Rpm
Returns a new instance of Rpm.
10 11 12 |
# File 'lib/revamp/persister/rpm.rb', line 10 def initialize @options = nil end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
14 15 16 |
# File 'lib/revamp/persister/rpm.rb', line 14 def @options end |
Instance Method Details
#persist(model) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/revamp/persister/rpm.rb', line 16 def persist(model) dir = File.('~') workdir = Pathname.new(dir).join('rpmbuild') @builder = Builder.new(model, workdir, ) @builder.make_structure @builder.write_spec @builder.write_sources target = @builder.produce @builder.cleanup if [:cleanup] target end |
#persisted? ⇒ Boolean
28 29 30 |
# File 'lib/revamp/persister/rpm.rb', line 28 def persisted? @builder.nil? ? false : @builder.produced? end |