I am refactoring some code that I did not write, and I found a line that looks like this (it is much longer, i used just a little bit for this example):
system("rubyw -e \"require 'win32ole'; @autoit=WIN32OLE.new('AutoItX3.Control');")
To increase readability, I refactored it to
do_something =
"rubyw -e \"
require 'win32ole'
@autoit=WIN32OLE.new('AutoItX3.Control')"
system do_something
Then I wanted to make some changes, but since the code I am working on is in a string, I loose syntax highlighting, parenthesis matching and all that good stuff.
Is there an easy way to write some code outside of the string and then convert it to string?
I have searched the web and stackoverflow, but could not find the answer.
For more information, take a look at original code at bret/watir (Watir::FileField#set, line 445), and my fork at zeljkofilipin/watir (lines 447-459).