[ale] (j)ruby question to the experts

Narahari 'n' Savitha savithari at gmail.com
Tue May 20 12:17:04 EDT 2014


Friends:

I have a html file on my box that looks like

<table id="${id}_pushbutton">

...
...
...
...
</table>

<div id="${id}_background" />



When I run them to the following code

Dir.glob(fileTypes) do |theFile|
                puts theFile
                data=File.read(theFile)
                puts data
                #output_of_gsub=data.gsub(/::STATIC_TAG_WITH_VER::/,
"$static_ver_with_tag")
                #print data
                #puts output_of_gsub
                File.open("/tmp/cool.txt", "w") {|file| file.puts data}
        end
end

The output I see is strange

The output looks like
id="com.adp.pid:configuration:jar:2.2-SNAPSHOT_toolbar_buttons"


so essentilly the ${id} is getting interpreted either by the read or by the
puts.

Any suggestion on how to read without interpreting ${id} please ?

-Narahari
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20140520/43ab0244/attachment.html>


More information about the Ale mailing list