summaryrefslogtreecommitdiff
path: root/sample/newver.rb
diff options
context:
space:
mode:
Diffstat (limited to 'sample/newver.rb')
-rw-r--r--sample/newver.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/sample/newver.rb b/sample/newver.rb
new file mode 100644
index 0000000..bbf03ae
--- /dev/null
+++ b/sample/newver.rb
@@ -0,0 +1,13 @@
+#! /usr/local/bin/ruby
+
+f = open("version.h", "r")
+f.gets()
+f.close
+
+if $_ =~ /"(\d)\.(\d+)"/;
+ f = open("version.h", "w")
+ i = $2.to_i + 1
+ printf("ruby version %d.%0d\n", $1, i)
+ printf(f, "#define RUBY_VERSION \"%d.%0d\"\n", $1, i)
+ f.close
+end