我的代码execute
是Chef resource:
execute 'phpbrew_0' do
command 'phpbrew --verbose install 5.6 +apxs2'
end
execute 'phpbrew_1' do
command 'phpbrew --verbose install 7.0 +apxs2'
end
execute 'phpbrew_2' do
command 'phpbrew --verbose install 7.1 +apxs2'
end
ruby是否具有此功能,我可以提供command
的集合,并将它们全部传递给execute
资源。像Javascript的Array.map
?
答案 0 :(得分:2)
是的,<div style="margin: 0 auto; overflow: auto;">
<div style="background: #000; height: 200px; width: 100%; overflow: hidden;">
<h1 style="font-family: Snell Roundhand, cursive; padding-left: 10px; color: white; float: left;">New Trend Photography</h1>
<p style="font-size: 14px; color: white; float: right; padding-right: 10px; max-width: 35%;">
<span style="float:right">E-mail: </span>
<br> newtrendphotography23@gmail.com
</p>
</div>
</div>
,例如:https://ruby-doc.org/core-2.4.1/Hash.html#method-i-each
Hash#each