Class: MyPrecious::PyPackageInfo::ReqSpecTransform
- Inherits:
-
Parslet::Transform
- Object
- Parslet::Transform
- MyPrecious::PyPackageInfo::ReqSpecTransform
- Defined in:
- lib/myprecious/python_packages.rb
Overview
Transforms parse tree from ReqSpecParser to usable objects
Instance Method Summary collapse
-
#apply_spec(ptree) ⇒ Object
Apply transform after normalizing a parse tree.
Instance Method Details
#apply_spec(ptree) ⇒ Object
Apply transform after normalizing a parse tree
This method should be applied only to a parse tree expected to come from a requirement specification.
459 460 461 462 463 464 465 466 |
# File 'lib/myprecious/python_packages.rb', line 459 def apply_spec(ptree) norm_ptree = {} # TODO: :extras should be in this list, and we should default them to [] %i[package verreqs url].each do |c| norm_ptree[c] = ptree[c] if ptree.has_key?(c) end apply(norm_ptree) end |