假设我有一个通用模板,其配方如下:
template '/tmp/message' do
source 'message.erb'
variables(
:version => 'common version',
:features => 'common features'
)
end
并且message.erb
看起来像这样:
The version is <%= @version %>
The features are <%= @features %>
现在让我们说在申请之后我想用另一条消息覆盖'features',但保持'version'不变,使它看起来像这样:
The version is common version
The features are really cool features
可以这样做吗?
我希望我能应用一个看起来像这样的“很酷的功能”配方:
template '/tmp/message' do
source 'message.erb'
variables(
:features => 'really cool features'
)
end
它只覆盖我想要覆盖的值并保留以前更改的值。