From null+ranguba at clear-code.com Sun Feb 5 06:34:43 2012 From: null+ranguba at clear-code.com (null+ranguba at clear-code.com) Date: Sun, 05 Feb 2012 20:34:43 +0900 Subject: [groonga-commit:4256] ranguba/rroonga [master] Merge pull request #4 from takkanm/patch-1 Message-ID: <20120205113449.8AAB09A0A0@jenkins.clear-code.com> Kouhei Sutou 2012-02-05 20:34:43 +0900 (Sun, 05 Feb 2012) New Revision: 770eadbcf767817ad068b2e16ef720b8bcdd3475 Log: Merge pull request #4 from takkanm/patch-1 fix test failure with release version groonga that doesn't have tag in version. Patch by takkanm. Thanks!!! From null+ranguba at clear-code.com Sun Feb 5 06:11:29 2012 From: null+ranguba at clear-code.com (null+ranguba at clear-code.com) Date: Sun, 05 Feb 2012 20:11:29 +0900 Subject: [groonga-commit:4257] ranguba/rroonga [master] fix fail test Message-ID: <20120205113449.79DFE9A09D@jenkins.clear-code.com> takkanm 2012-02-05 20:11:29 +0900 (Sun, 05 Feb 2012) New Revision: 819096a74985ed473ea26c68000ab3ceffb8eec2 Merged 770eadb: Merge pull request #4 from takkanm/patch-1 Log: fix fail test Modified files: lib/groonga.rb Modified: lib/groonga.rb (+1 -1) =================================================================== --- lib/groonga.rb 2012-01-30 17:55:00 +0900 (688dd74) +++ lib/groonga.rb 2012-02-05 20:11:29 +0900 (918ddc5) @@ -63,7 +63,7 @@ module Groonga # ?????.?????????"?????????? # ????? def version - VERSION.join(".") + VERSION.compact.join(".") end ## From null+ranguba at clear-code.com Sun Feb 5 06:46:38 2012 From: null+ranguba at clear-code.com (null+ranguba at clear-code.com) Date: Sun, 05 Feb 2012 20:46:38 +0900 Subject: [groonga-commit:4258] ranguba/rroonga [master] use "-" as versions and tag separator. Message-ID: <20120205114650.4C4579A09D@jenkins.clear-code.com> Kouhei Sutou 2012-02-05 20:46:38 +0900 (Sun, 05 Feb 2012) New Revision: a9a8886e62eb024c7783e95eea981a4dba801a67 Log: use "-" as versions and tag separator. Modified files: lib/groonga.rb test/test-version.rb Modified: lib/groonga.rb (+9 -6) =================================================================== --- lib/groonga.rb 2012-02-05 20:34:43 +0900 (918ddc5) +++ lib/groonga.rb 2012-02-05 20:46:38 +0900 (c1a1ae5) @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2009-2011 Kouhei Sutou +# Copyright (C) 2009-2012 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -58,12 +58,15 @@ module Groonga BUILD_VERSION.join(".") end - ## - # VERSION?"."?????"?????????.???? - # ?????.?????????"?????????? - # ????? + # Format version. + # + # @return [String] If Groonga::VERSION has tag, + # @MAJOR.MINOR.MICRO-TAG at . Otherwise, @MAJOR.MINOR.MICRO at . def version - VERSION.compact.join(".") + major, minor, micro, tag = VERSION + version_string = [major, minor, micro].join(".") + version_string << "-#{tag}" if tag + version_string end ## Modified: test/test-version.rb (+36 -10) =================================================================== --- test/test-version.rb 2012-02-05 20:34:43 +0900 (c6b89de) +++ test/test-version.rb 2012-02-05 20:46:38 +0900 (ac0afe8) @@ -1,4 +1,4 @@ -# Copyright (C) 2009 Kouhei Sutou +# Copyright (C) 2009-2012 Kouhei Sutou # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -14,18 +14,44 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA class VersionTest < Test::Unit::TestCase - def test_build_version - assert_match(/\A\d+\.\d+\.\d+\z/, Groonga.build_version) - assert_match(Groonga.build_version, Groonga::BUILD_VERSION.join(".")) + def test_build_version_format + assert_equal("X.X.X", normalize(Groonga.build_version)) end - def test_version - assert_match(/\A\d+\.\d+\.\d+(?:\.\d+-[a-zA-Z\d]+)?\z/, Groonga.version) - assert_match(Groonga.version, Groonga::VERSION.join(".")) + def test_build_version_value + assert_equal(Groonga.build_version, Groonga::BUILD_VERSION.join(".")) end - def test_bindings_version - assert_match(/\A\d+\.\d+\.\d+\z/, Groonga.bindings_version) - assert_match(Groonga.bindings_version, Groonga::BINDINGS_VERSION.join(".")) + def test_version_format + assert_equal("X.X.X-XXX", normalize(Groonga.version)) + end + + def test_version_value + major, minor, micro, tag = Groonga::VERSION + versions = [major, minor, micro] + assert_equal(Groonga.version, [versions.join("."), tag].compact.join("-")) + end + + def test_bindings_version_format + assert_equal("X.X.X", normalize(Groonga.bindings_version)) + end + + def test_bindings_version_value + assert_equal(Groonga.bindings_version, Groonga::BINDINGS_VERSION.join(".")) + end + + private + def normalize(version) + versions_component, tag_component = version.split(/-/, 2) + versions = versions_component.split(/\./) + normalized_versions = versions.collect do |component| + component.gsub(/\d+/, "X") + end + if tag_component + normalized_tag = "XXX" + else + normalized_tag = nil + end + [normalized_versions.join("."), normalized_tag].compact.join("-") end end From null+ranguba at clear-code.com Thu Feb 9 21:32:54 2012 From: null+ranguba at clear-code.com (null+ranguba at clear-code.com) Date: Fri, 10 Feb 2012 11:32:54 +0900 Subject: [groonga-commit:4259] ranguba/rroonga [master] use test-unit >= 2.4.6. Message-ID: <20120210023303.D403C9A09D@jenkins.clear-code.com> Kouhei Sutou 2012-02-10 11:32:54 +0900 (Fri, 10 Feb 2012) New Revision: b9851d319c20a309f6f033fcc26b9502a1913da6 Log: use test-unit >= 2.4.6. Modified files: Gemfile test/run-test.rb Modified: Gemfile (+1 -1) =================================================================== --- Gemfile 2012-02-05 20:46:38 +0900 (0c85bec) +++ Gemfile 2012-02-10 11:32:54 +0900 (c4b6d87) @@ -21,7 +21,7 @@ gem 'pkg-config' gem 'json' group :development, :test do - gem "test-unit" + gem "test-unit", ">= 2.4.6" gem "test-unit-notify" gem "rake" gem "rake-compiler" Modified: test/run-test.rb (+1 -2) =================================================================== --- test/run-test.rb 2012-02-05 20:46:38 +0900 (c3de4c3) +++ test/run-test.rb 2012-02-10 11:32:54 +0900 (185eca7) @@ -36,8 +36,7 @@ if make system("cd #{base_dir.dump} && #{make} > /dev/null") or exit(false) end -require "rubygems" -gem "test-unit-notify" +require "test-unit" require "test/unit/notify" Test::Unit::Priority.enable