Class: Penchant::PropertyStack
- Inherits:
-
Object
- Object
- Penchant::PropertyStack
- Defined in:
- lib/penchant/property_stack.rb
Constant Summary collapse
- PATHING_OPTIONS =
[ :git, :branch, :path ].freeze
Instance Method Summary collapse
-
#initialize(builder, property_stack, strip_pathing_options) ⇒ PropertyStack
constructor
A new instance of PropertyStack.
- #process_for_gem(gem_name, additional_env = {}) ⇒ Object
- #processor ⇒ Object
Constructor Details
#initialize(builder, property_stack, strip_pathing_options) ⇒ PropertyStack
Returns a new instance of PropertyStack.
5 6 7 |
# File 'lib/penchant/property_stack.rb', line 5 def initialize(builder, property_stack, ) @builder, @property_stack, @strip_pathing_options = builder, property_stack.dup, end |
Instance Method Details
#process_for_gem(gem_name, additional_env = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/penchant/property_stack.rb', line 13 def process_for_gem(gem_name, additional_env = {}) properties = processor.process(gem_name, @property_stack) if @strip_pathing_options PATHING_OPTIONS.each { |key| properties.delete(key) } end properties = processor.process(gem_name, @builder.defaults[gem_name].merge(additional_env)).merge(properties) properties.delete(:opposite) Hash[properties.sort] end |
#processor ⇒ Object
9 10 11 |
# File 'lib/penchant/property_stack.rb', line 9 def processor @processor ||= PropertyStackProcessor.new(@builder) end |