This repository has been archived on 2020-04-11. You can view files and clone it, but cannot push or open issues or pull requests.
gnoemoe/ui/fixglade.rb

18 lines
361 B
Ruby
Executable File

#!/usr/bin/env ruby1.8
files = Dir[File.dirname($0) + "/*.glade"]
files.each do |path|
lines = IO.readlines(path)
File.rename(path, path + ".tmp")
fw = File.new(path, "w");
lines.each do |line|
line = line.sub(/<property name=\"(pixbuf|icon)\">([^\/]+?<\/property>)/, '<property name="\1">../pixmaps/\2')
fw.puts(line)
end
fw.close
end