Skip to content

Instantly share code, notes, and snippets.

@J0J0
Created September 13, 2014 11:48
Show Gist options
  • Save J0J0/ccccc5947a3989751f7d to your computer and use it in GitHub Desktop.
Save J0J0/ccccc5947a3989751f7d to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'yaml'
f = ARGV.shift || exit(1)
y = YAML.load_file(f)
def make_cmd(article_file, article_name, editor_name)
fields = [ "#{article_file}.tex".ljust(33),
article_name,
editor_name
]
cmd = "git add %s; git commit -m 'Update: %s (%s)'"
cmd % fields
end
cmds = y.each_pair.inject([]){|cs,(k,h)|
cs << make_cmd(h[:file], k, h[:name])
}
cmds.unshift(make_cmd("alumni", "Alumniverein", "alumniverein"))
puts cmds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment