summaryrefslogtreecommitdiff
path: root/newver.rb
diff options
context:
space:
mode:
Diffstat (limited to 'newver.rb')
-rwxr-xr-xnewver.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/newver.rb b/newver.rb
new file mode 100755
index 0000000..48ff389
--- /dev/null
+++ b/newver.rb
@@ -0,0 +1,14 @@
+#! ./ruby
+f = open("version.h", "r")
+f.gets()
+f.close
+
+if $_ =~ /"(\d+)\.(\d+)"/;
+ f = open("version.h", "w")
+ i = $2.to_i + 1
+ date = Time.now.strftime("%d %b %y")
+ printf("ruby version %d.%0d (%s)\n", $1, i, date)
+ printf(f, "#define RUBY_VERSION \"%d.%0d\"\n", $1, i)
+ printf(f, "#define VERSION_DATE \"%s\"\n", date)
+ f.close
+end