Ruby find/replace script
I newbie in ruby and need create ruby script that find by all my images, such as:
and transform to:
<img src="images/image.gif" />
but it only some images(that are in another folder)...
<img src="/layout/site/images/image.gif" />
here the code I already make, I need suggestion how read file and replace <img> tag:
Dir["Z:/dir_jsp_for_change/*.jsp"].each do |fileJsp|
File.open(fileJsp).each do |line|
Dir["dir_image_for_change/*.gif"].each do |file|
someone have any idea ?
This is much easier to accomplish with sed. Search for "sed documentation".