Reputation: 6345
I'm absolutely new to Ruby having just read some tutorials. It looks like I can read the file content as
svg = File.read(path)
Now it looks like the file content is treated as a string and regular expression replace is used:
svg = svg.gsub(/(width|height)="\d+px"/, '')
How to define the encoding to use the text file? How to read the file contents into a byte array (leaving the regular expression aside)?
Upvotes: 1
Views: 1611