fix defaults precedence for gems
This commit is contained in:
parent
fbbf14d639
commit
4f15f45492
@ -234,3 +234,18 @@ Feature: Gemfiles
|
|||||||
# generated by penchant, environment: local
|
# generated by penchant, environment: local
|
||||||
gem "one", "1.2.3", {:path=>"../one"}
|
gem "one", "1.2.3", {:path=>"../one"}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
Scenario: Override defaults for an environment
|
||||||
|
Given I have the file "Gemfile.penchant" with the content:
|
||||||
|
"""
|
||||||
|
defaults_for env(:local), :path => '../%s'
|
||||||
|
env :local do
|
||||||
|
gem 'one', '1.2.3', :path => '../cats'
|
||||||
|
end
|
||||||
|
"""
|
||||||
|
When I rebuild the Gemfile for "local" mode
|
||||||
|
Then the file "Gemfile" should have the following content:
|
||||||
|
"""
|
||||||
|
# generated by penchant, environment: local
|
||||||
|
gem "one", "1.2.3", {:path=>"../cats"}
|
||||||
|
"""
|
||||||
|
@ -193,7 +193,7 @@ module Penchant
|
|||||||
|
|
||||||
def process_options(gem_name, template = {})
|
def process_options(gem_name, template = {})
|
||||||
Hash[
|
Hash[
|
||||||
template.merge(_defaults_for(gem_name)).collect { |key, value|
|
_defaults_for(gem_name).dup.merge(template).collect { |key, value|
|
||||||
value = value % gem_name if value.respond_to?(:%)
|
value = value % gem_name if value.respond_to?(:%)
|
||||||
|
|
||||||
[ key, value ]
|
[ key, value ]
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
module Penchant
|
module Penchant
|
||||||
VERSION = "0.2.8.1"
|
VERSION = "0.2.9"
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user