Your just re-interpolating a single string, you can simplify by just using
the variable inside the brackets without interpolation (faster and simpler).
"... #{rails_env["#{workflow}"]} ..." == "... #{rails_env[workflow]} ..."
run "/opt/rpx/app/current/script/runner -e #{rails_env[workflow]} 'puts
#{status_check[check]}'"
as has been suggested if you are dealing with a string that includes double
quotes you have some choices.
Lets change your example:
this is invalid for the command you are doing; just using it as an example,
lets say what comes after -e should be a single argument
and you need to do interpolation inside of it so you are going to use double
quotes. But you have a nested object of single quotes,
and you need to quote the entire option to run for ruby.
This is the intent; but it is invalid:
run "/opt/rpx/app/current/script/runner -e "#{rails_env[workflow]} 'puts
#{status_check[check]}'""
%Q{} notation is interpolated and acts just like double quotes
%q{} notation is not interpolated and acts just like single quotes.
This would actually work:
run %Q{/opt/rpx/app/current/script/runner -e "#{rails_env[workflow]} 'puts
#{status_check[check]}'"}
or you could opt to escape the inner double quotes for ruby:
run "/opt/rpx/app/current/script/runner -e \"#{rails_env[workflow]} 'puts
#{status_check[check]}'\""
--
* You received this message because you are subscribed to the Google Groups
"Capistrano" group.
* To post to this group, send email to [email protected]
* To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/capistrano?hl=en