Ruby variable inside shorthand array -


i trying insert variable deploy[:deploy_to] shorthand array below.

node[:deploy].each |application, deploy|     %w[ #{deploy[:deploy_to]}/current/cache          #{deploy[:deploy_to]}/current/public/projects_icons ].each |path|             directory path                 user deploy[:user]                 group deploy[:group]                 mode "0777"             end        end end 

how can this?

%w supports interpolation:

%w[ #{deploy[:deploy_to]}/current/cache      #{deploy[:deploy_to]}/current/public/projects_icons ].each |path|         directory path             user deploy[:user]             group deploy[:group]             mode "0777"         end    end 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -