diff options
Diffstat (limited to 'update.rb')
-rwxr-xr-x | update.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/update.rb b/update.rb new file mode 100755 index 0000000000..87364d80aa --- /dev/null +++ b/update.rb @@ -0,0 +1,20 @@ +#!/usr/bin/env ruby + +RESULT = / * #(.*?)/ +CODE = / * (.*?)/ + +ARGV.each do |path| + lines = File.readlines(path) + + lines.each do |line| + if line =~ /\/\*/ + last = nil + elsif match = line.match(RESULT) + line.replace(" * \# => #{last}") + elsif match = line.match(CODE) + last = eval(match[1]) + end + end + + puts lines +end |