Class: Revamp::Filter::PuppetVerToRpmReq
- Inherits:
-
Object
- Object
- Revamp::Filter::PuppetVerToRpmReq
- Defined in:
- lib/revamp/filter/puppetver2rpmreq.rb
Overview
A filter that process Puppet dependency into RPM requirements lines More info: docs.puppetlabs.com/puppet/latest/reference/modules_publishing.html#dependencies-in-metadatajson Even more info: robots.thoughtbot.com/rubys-pessimistic-operator
Constant Summary collapse
- PUPPETMODULE =
'puppetmodule'
- TWIDDLE_WAKKA =
'~>'
Instance Attribute Summary collapse
-
#slug ⇒ Object
Returns the value of attribute slug.
-
#slugger ⇒ Object
Returns the value of attribute slugger.
Instance Method Summary collapse
-
#filter(puppetver) ⇒ Object
Filters a Puppet version.
-
#initialize ⇒ PuppetVerToRpmReq
constructor
A new instance of PuppetVerToRpmReq.
Constructor Details
#initialize ⇒ PuppetVerToRpmReq
Returns a new instance of PuppetVerToRpmReq.
13 14 15 |
# File 'lib/revamp/filter/puppetver2rpmreq.rb', line 13 def initialize @slugger = Revamp::Mapper::PuppetNameSlugger.new end |
Instance Attribute Details
#slug ⇒ Object
Returns the value of attribute slug.
11 12 13 |
# File 'lib/revamp/filter/puppetver2rpmreq.rb', line 11 def slug @slug end |
#slugger ⇒ Object
Returns the value of attribute slugger.
11 12 13 |
# File 'lib/revamp/filter/puppetver2rpmreq.rb', line 11 def slugger @slugger end |
Instance Method Details
#filter(puppetver) ⇒ Object
Filters a Puppet version
20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/revamp/filter/puppetver2rpmreq.rb', line 20 def filter(puppetver) @slug = slugger.map(puppetver.name) reqs = [] requirements = puppetver.version.requirements if singular?(requirements) reqs += filter_single(requirements.first) else reqs += filter_many(requirements) end reqs end |