[rubygem-actionpack] Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0

Vít Ondruch vondruch at fedoraproject.org
Fri Mar 8 11:36:15 UTC 2013


commit a0f2f94b885862e6efc5dc6da758683f82a8df41
Author: Vít Ondruch <vondruch at redhat.com>
Date:   Fri Mar 8 10:49:15 2013 +0100

    Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0

 ...as-changed-the-way-it-escapes-apostrophes.patch |   27 ++++++++++++++++++
 ...or-method_missing-in-public-and-protected.patch |   29 ++++++++++++++++++++
 ...y-2.0.0-defaults-source-encoding-to-utf-8.patch |   22 +++++++++++++++
 rubygem-actionpack.spec                            |   26 +++++++++++++-----
 4 files changed, 97 insertions(+), 7 deletions(-)
---
diff --git a/rubygem-actionpack-3.2.13-CGI.escapeHTML-has-changed-the-way-it-escapes-apostrophes.patch b/rubygem-actionpack-3.2.13-CGI.escapeHTML-has-changed-the-way-it-escapes-apostrophes.patch
new file mode 100644
index 0000000..9faa480
--- /dev/null
+++ b/rubygem-actionpack-3.2.13-CGI.escapeHTML-has-changed-the-way-it-escapes-apostrophes.patch
@@ -0,0 +1,27 @@
+From 42d7927c22a2c219d6145d9375be65a04a83dce3 Mon Sep 17 00:00:00 2001
+From: Jeremy Kemper <jeremy at bitsweat.net>
+Date: Sat, 6 Oct 2012 21:06:10 -0700
+Subject: [PATCH] Ruby 2 compat. CGI.escapeHTML has changed the way it escapes
+ apostrophes a few times, so fix up the test to work with
+ however it chooses to escape.
+
+---
+ actionpack/test/template/html-scanner/sanitizer_test.rb |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/actionpack/test/template/html-scanner/sanitizer_test.rb b/actionpack/test/template/html-scanner/sanitizer_test.rb
+index 62ad6be..844484e 100644
+--- a/actionpack/test/template/html-scanner/sanitizer_test.rb
++++ b/actionpack/test/template/html-scanner/sanitizer_test.rb
+@@ -210,7 +210,7 @@ def test_should_not_fall_for_ridiculous_hack
+ 
+   # TODO: Clean up
+   def test_should_sanitize_attributes
+-    assert_sanitized %(<SPAN title="'><script>alert()</script>">blah</SPAN>), %(<span title="'&gt;&lt;script&gt;alert()&lt;/script&gt;">blah</span>)
++    assert_sanitized %(<SPAN title="'><script>alert()</script>">blah</SPAN>), %(<span title="#{CGI.escapeHTML "'><script>alert()</script>"}">blah</span>)
+   end
+ 
+   def test_should_sanitize_illegal_style_properties
+-- 
+1.7.10
+
diff --git a/rubygem-actionpack-3.2.13-Check-for-method_missing-in-public-and-protected.patch b/rubygem-actionpack-3.2.13-Check-for-method_missing-in-public-and-protected.patch
new file mode 100644
index 0000000..4287a6e
--- /dev/null
+++ b/rubygem-actionpack-3.2.13-Check-for-method_missing-in-public-and-protected.patch
@@ -0,0 +1,29 @@
+From 979e198c14a95010aca17b6e640f386961360794 Mon Sep 17 00:00:00 2001
+From: Prem Sichanugrist <s at sikac.hu>
+Date: Fri, 22 Feb 2013 14:26:20 -0500
+Subject: [PATCH] Check for `method_missing` in public and protected
+
+Ruby 2.0 changed the behavior of `respond_to?` without argument to
+return only search for public method. We actually want to perform the
+action only if `method_missing` is either in public or protected.
+---
+ actionpack/lib/action_controller/metal/compatibility.rb |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/actionpack/lib/action_controller/metal/compatibility.rb b/actionpack/lib/action_controller/metal/compatibility.rb
+index de3354d..9d1ff8c 100644
+--- a/actionpack/lib/action_controller/metal/compatibility.rb
++++ b/actionpack/lib/action_controller/metal/compatibility.rb
+@@ -58,7 +58,8 @@ def _handle_method_missing
+     end
+ 
+     def method_for_action(action_name)
+-      super || (respond_to?(:method_missing) && "_handle_method_missing")
++      super || ((self.class.public_method_defined?(:method_missing) ||
++        self.class.protected_method_defined?(:method_missing)) && "_handle_method_missing")
+     end
+   end
+ end
+-- 
+1.7.10
+
diff --git a/rubygem-actionpack-3.2.13-Ruby-2.0.0-defaults-source-encoding-to-utf-8.patch b/rubygem-actionpack-3.2.13-Ruby-2.0.0-defaults-source-encoding-to-utf-8.patch
new file mode 100644
index 0000000..3975f7c
--- /dev/null
+++ b/rubygem-actionpack-3.2.13-Ruby-2.0.0-defaults-source-encoding-to-utf-8.patch
@@ -0,0 +1,22 @@
+From 2a5f6d8fe6898f2570ba66382336d56894a43322 Mon Sep 17 00:00:00 2001
+From: Aaron Patterson <aaron.patterson at gmail.com>
+Date: Mon, 12 Nov 2012 18:17:06 -0800
+Subject: [PATCH] Ruby 2.0.0 defaults source encoding to utf-8 so we need to
+ specifically tag this file with us-ascii
+
+---
+ actionpack/test/template/template_test.rb |    1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/actionpack/test/template/template_test.rb b/actionpack/test/template/template_test.rb
+index 5694338..b7f785f 100644
+--- a/actionpack/test/template/template_test.rb
++++ b/actionpack/test/template/template_test.rb
+@@ -1,3 +1,4 @@
++# encoding: US-ASCII
+ require "abstract_unit"
+ require "logger"
+ 
+-- 
+1.7.10
+
diff --git a/rubygem-actionpack.spec b/rubygem-actionpack.spec
index 88030a7..5f7c64e 100644
--- a/rubygem-actionpack.spec
+++ b/rubygem-actionpack.spec
@@ -1,13 +1,12 @@
 # Generated from actionpack-1.13.5.gem by gem2rpm -*- rpm-spec -*-
 %global gem_name actionpack
 
-%global rubyabi 1.9.1
 
 Summary: Web-flow and rendering framework putting the VC in MVC
 Name: rubygem-%{gem_name}
 Epoch: 1
 Version: 3.2.12
-Release: 1%{?dist}
+Release: 2%{?dist}
 Group: Development/Languages
 License: MIT
 URL: http://www.rubyonrails.org
@@ -28,6 +27,16 @@ Patch2: rubygem-actionpack-3.2.8-relax-builder-dependency.patch
 # https://github.com/rails/rails/pull/8546
 Patch3: rubygem-actionpack-4.0.0-change-spy-of-after-invoked-controller-action.-becau.patch
 
+# Fixes invalid multibyte escape: /\xFC/ (SyntaxError).
+# https://github.com/rails/rails/commit/2a5f6d8fe6898f2570ba66382336d56894a43322
+Patch100: rubygem-actionpack-3.2.13-Ruby-2.0.0-defaults-source-encoding-to-utf-8.patch
+# Fixes test_should_sanitize_attributes(SanitizerTest).
+# https://github.com/rails/rails/commit/42d7927c22a2c219d6145d9375be65a04a83dce3
+Patch101: rubygem-actionpack-3.2.13-CGI.escapeHTML-has-changed-the-way-it-escapes-apostrophes.patch
+# Fixes AbstractController::ActionNotFound error.
+# https://github.com/rails/rails/commit/979e198c14a95010aca17b6e640f386961360794
+Patch102: rubygem-actionpack-3.2.13-Check-for-method_missing-in-public-and-protected.patch
+
 # Let's keep Requires and BuildRequires sorted alphabeticaly
 Requires: ruby(rubygems)
 Requires: rubygem(activemodel) = %{version}
@@ -45,7 +54,7 @@ Requires: rubygem(rack-cache) < 2
 Requires: rubygem(rack-test) >= 0.6.1
 Requires: rubygem(rack-test) < 0.7
 Requires: rubygem(sprockets) >= 2.1.3
-Requires: ruby(abi) = %{rubyabi}
+Requires: ruby(release)
 BuildRequires: rubygems-devel
 BuildRequires: rubygem(activemodel) = %{version}
 BuildRequires: rubygem(activerecord) = %{version}
@@ -86,10 +95,7 @@ Documentation for %{name}
 
 %prep
 %setup -q -c -T
-mkdir -p .%{gem_dir}
-gem install --local --install-dir .%{gem_dir} \
-            -V \
-            --force --no-rdoc %{SOURCE0}
+%gem_install -n %{SOURCE0}
 
 # move the tests into place
 tar xzvf %{SOURCE2} -C .%{gem_instdir}
@@ -97,6 +103,9 @@ tar xzvf %{SOURCE2} -C .%{gem_instdir}
 pushd .%{gem_instdir}
 %patch0 -p0
 %patch3 -p2
+%patch100 -p2
+%patch101 -p2
+%patch102 -p2
 popd
 
 pushd .%{gem_dir}
@@ -163,6 +172,9 @@ popd
 %{gem_instdir}/test/
 
 %changelog
+* Fri Mar 08 2013 Vít Ondruch <vondruch at redhat.com> - 1:3.2.12-2
+- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0
+
 * Tue Feb 12 2013 Vít Ondruch <vondruch at redhat.com> - 1:3.2.12-1
 - Update to the ActionPack 3.2.12.
 


More information about the scm-commits mailing list