I have a heredoc where I am using #{}
to interpolate some other strings, but there is an instance where I also want to write the actual text #{some_ruby_stuff}
in my heredoc, WITHOUT it being interpolated. Is there a way to escape the #{.
I've tried "", but no luck. Although it escapes the #{}
, it also includes the "":
>> <<-END
#{RAILS_ENV} #{RAILS_ENV}
END
=> " development #{RAILS_ENV}
"
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…