OSDN Git Service

The separator line in the Ruby Dialog was not working correctly.
[molby/Molby.git] / update_version.rb
index 7234e38..ca3719c 100644 (file)
@@ -14,13 +14,14 @@ year = t.year
 month = t.month
 day = t.day
 d = sprintf("%04d%02d%02d", year, month, day)
-exit 0 if date == d
+exit 0 if date == d
 File.open("Version", "w") { |fp|
   fp.print "version = \"#{version}\"\n"
   fp.print "date = \"#{d}\"\n"
 }
 build = "build " + d
-verstr = "v#{ver} #{build}"
+# verstr = "v#{ver} #{build}"
+verstr = "v#{ver}"
 yrange = (year > 2008 ? "2008-#{year}" : "2008")
 
 def modify_file(name, &block)
@@ -86,7 +87,16 @@ modify_file("wxSources/MyVersion.c") { |s|
 
 #  Modify doc_source.html
 modify_file("Documents/src/doc_source.html") { |s|
-  if s =~ /Version/ && s.sub!(/[Vv][-.0-9 A-Za-z_]*/, "Version #{ver} #{build}")
+  if s =~ /Version/ && s.sub!(/[Vv][-.0-9 A-Za-z_]*/, "Version #{ver}")
+    s
+  else
+    nil
+  end
+}
+
+#  Modify README
+modify_file("README") { |s|
+  if s =~ /        Version/ && s.sub!(/[Vv][-.0-9 A-Za-z_]*/, "Version #{ver}")
     s
   else
     nil