I refactored a code that I did not write, and found a line that looks like this (this is a lot more, I used a bit for this example):
system("rubyw -e \"require 'win32ole'; @autoit=WIN32OLE.new('AutoItX3.Control');")
To improve readability, I reorganized it into
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'm working on is on the line, I lose syntax highlighting, matching in brackets and all that is good.
Is there an easy way to write some code outside the string and then convert it to a string?
I searched the web and stackoverflow but couldn't find the answer.
For more information, check out the source code at bret / watir (Watir :: FileField # set, line 445) and my plug in zeljkofilipin / watir (lines 447-459).
source share