[rubygem-test-unit] Patch for CSV support (patch by upstream)

Mamoru Tasaka mtasaka at fedoraproject.org
Thu Feb 28 04:30:13 UTC 2013


commit 8d8245ebdff9079c3fc9dd77c55e18f23dda646f
Author: TASAKA Mamoru <mtasaka at localhost.localdomain>
Date:   Thu Feb 28 13:30:07 2013 +0900

    Patch for CSV support (patch by upstream)

 rubygem-gettext-2.3.7-CSV-detect-newer.patch |   30 ++++++++++++++++++++++++++
 rubygem-test-unit.spec                       |   15 +++++++++---
 2 files changed, 41 insertions(+), 4 deletions(-)
---
diff --git a/rubygem-gettext-2.3.7-CSV-detect-newer.patch b/rubygem-gettext-2.3.7-CSV-detect-newer.patch
new file mode 100644
index 0000000..afb9b24
--- /dev/null
+++ b/rubygem-gettext-2.3.7-CSV-detect-newer.patch
@@ -0,0 +1,30 @@
+From 936bb463e1e47f5bee767027a25bf211876d8be9 Mon Sep 17 00:00:00 2001
+From: Kouhei Sutou <kou at clear-code.com>
+Date: Thu, 28 Feb 2013 00:15:51 +0900
+Subject: [PATCH] Use CSV::VERSION to detect newer CSV library
+
+CSV.dump (and CSV.load) had been removed since Ruby 2.0.0.
+
+GitHub: fix #54
+
+Reported by mtasaka. Thanks!!!
+---
+ lib/test/unit/data.rb |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/lib/test/unit/data.rb b/lib/test/unit/data.rb
+index 3fec326..9f71f01 100644
+--- a/lib/test/unit/data.rb
++++ b/lib/test/unit/data.rb
+@@ -194,7 +194,7 @@ def load_csv(file_name)
+           # @api private
+           def load_tsv(file_name)
+             require "csv"
+-            if CSV.respond_to?(:dump)
++            if CSV.const_defined?(:VERSION)
+               first_row = true
+               header = nil
+               CSV.foreach(file_name, :col_sep => "\t") do |row|
+-- 
+1.7.10
+
diff --git a/rubygem-test-unit.spec b/rubygem-test-unit.spec
index 660a447..41e49fa 100644
--- a/rubygem-test-unit.spec
+++ b/rubygem-test-unit.spec
@@ -6,7 +6,7 @@
 Summary:	Improved version of Test::Unit bundled in Ruby 1.8.x
 Name:		rubygem-%{gem_name}
 Version:	2.5.4
-Release:	2%{?dist}
+Release:	3%{?dist}
 Group:		Development/Languages
 # lib/test/unit/diff.rb is under GPLv2 or Ruby or Python
 # lib/test-unit.rb is under LGPLv2+ or Ruby
@@ -15,6 +15,10 @@ License:	(GPLv2 or Ruby) and (GPLv2 or Ruby or Python) and (LGPLv2+ or Ruby)
 URL:		http://rubyforge.org/projects/test-unit/
 
 Source0:	http://rubygems.org/gems/%{gem_name}-%{version}.gem
+# https://github.com/test-unit/test-unit/issues/54
+# https://github.com/test-unit/test-unit/commit/936bb463e1e47f5bee76702.patch
+Patch0:	rubygem-gettext-2.3.7-CSV-detect-newer.patch
+
 BuildRequires:	ruby(release)
 BuildRequires:	rubygems
 BuildRequires:	rubygems-devel
@@ -52,6 +56,8 @@ pushd tmpunpackdir
 gem unpack %{SOURCE0}
 cd %{gem_name}-%{version}
 
+%patch0 -p1
+
 gem specification -l --ruby %{SOURCE0} > %{gem_name}.gemspec
 gem build %{gem_name}.gemspec
 mv %{gem_name}-%{version}.gem $TOPDIR
@@ -80,9 +86,7 @@ chmod 0755 %{buildroot}%{_bindir}/testrb2
 %check
 pushd .%{gem_instdir}
 #rake test --trace
-# Handling tsv does not work currently
-# https://github.com/test-unit/test-unit/issues/54
-ruby -Ilib ./test/run-test.rb || :
+ruby -Ilib ./test/run-test.rb
 popd
 
 %files
@@ -107,6 +111,9 @@ popd
 %{gem_docdir}/
 
 %changelog
+* Thu Feb 28 2013 Mamoru TASAKA <mtasaka at fedoraproject.org> - 2.5.4-3
+- Patch for CSV support (patch by upstream)
+
 * Wed Feb 27 2013 Mamoru TASAKA <mtasaka at fedoraproject.org> - 2.5.4-2
 - Rebuild for ruby 2.0.0
 


More information about the scm-commits mailing list