Moved glade ui files to .ui file extensions

socks-filter
xSmurf 8 years ago
parent 95c5e486ba
commit c10ba7df23

@ -2,7 +2,7 @@ generate:
ruby ./generate.rb
touch:
ls *.xml | xargs -n1 touch
ls *.ui | xargs -n1 touch
doctor: touch generate
git diff --exit-code .

@ -3,7 +3,7 @@
require 'fileutils'
def parse_go_name(file_name)
File.basename(file_name, ".xml").
File.basename(file_name, ".ui").
gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
gsub(/([a-z\d])([A-Z])/,'\1_\2').
tr("-", "_").
@ -13,7 +13,7 @@ end
def gen_go_file(xml_file, go_file)
xml_definition = File.read(xml_file)
ui_name = File.basename(xml_file, '.xml')
ui_name = File.basename(xml_file, '.ui')
File.open(go_file, 'w+') do |target|
target.puts <<TEMPLATE
package definitions
@ -38,7 +38,7 @@ def file_mtime(nm)
File.mtime(nm)
end
Dir[File.join(File.dirname(__FILE__), '*.xml')].each do |file_name|
Dir[File.join(File.dirname(__FILE__), '*.ui')].each do |file_name|
go_file = parse_go_name file_name
if file_mtime(file_name) > file_mtime(go_file) || file_mtime(__FILE__) > file_mtime(go_file)
STDERR.puts " - #{file_name} -> #{go_file}"

Loading…
Cancel
Save