diff options
author | Ken Dreyer <ktdreyer@ktdreyer.com> | 2013-02-07 18:28:27 -0700 |
---|---|---|
committer | Ken Dreyer <ktdreyer@ktdreyer.com> | 2013-02-07 19:54:26 -0700 |
commit | 9613ddcd9c80b8cbad76e1814d1f3f809a03ebb9 (patch) | |
tree | 01d3c793a28c6c4176b18006c5f5f711c59c9633 | |
parent | d7750c1c48a8cffb2c088bc0225594fd101bafbf (diff) | |
download | rubygem-activesupport-9613ddcd9c80b8cbad76e1814d1f3f809a03ebb9.tar.gz rubygem-activesupport-9613ddcd9c80b8cbad76e1814d1f3f809a03ebb9.tar.xz rubygem-activesupport-9613ddcd9c80b8cbad76e1814d1f3f809a03ebb9.zip |
Downgrade to ActiveSupport 2.3.16 and add RHEL 6 compatibility
- Downgrade to ActiveSupport 2.3.16.
- RHEL 6 compatibility.
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | activesupport-4.0.0-Make-the-tests-pass-with-minitest-4.2.patch | 27 | ||||
-rw-r--r-- | activesupport-add-bigdecimal-dependency.patch | 19 | ||||
-rw-r--r-- | activesupport-remove-memcache-build-dep.patch | 67 | ||||
-rw-r--r-- | rubygem-activesupport-json-ordering.patch | 47 | ||||
-rw-r--r-- | rubygem-activesupport-xml-ordering.patch | 36 | ||||
-rw-r--r-- | rubygem-activesupport.spec | 101 | ||||
-rw-r--r-- | sources | 4 |
8 files changed, 142 insertions, 161 deletions
@@ -23,3 +23,5 @@ activesupport-2.3.8.gem /activesupport-3.2.10.gem /activesupport-3.2.11-tests.tgz /activesupport-3.2.11.gem +/activesupport-2.3.16-tests.tgz +/activesupport-2.3.16.gem diff --git a/activesupport-4.0.0-Make-the-tests-pass-with-minitest-4.2.patch b/activesupport-4.0.0-Make-the-tests-pass-with-minitest-4.2.patch deleted file mode 100644 index ee08fa1..0000000 --- a/activesupport-4.0.0-Make-the-tests-pass-with-minitest-4.2.patch +++ /dev/null @@ -1,27 +0,0 @@ -From ae6d2efd844cc6cf6822fe424d8e09c510153c90 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= - <rafaelmfranca@gmail.com> -Date: Mon, 5 Nov 2012 15:12:09 -0200 -Subject: [PATCH] Make the tests pass with minitest 4.2 - ---- - activesupport/test/test_case_test.rb | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/activesupport/test/test_case_test.rb b/activesupport/test/test_case_test.rb -index c02bfa8..64426d0 100644 ---- a/activesupport/test/test_case_test.rb -+++ b/activesupport/test/test_case_test.rb -@@ -16,6 +16,9 @@ module ActiveSupport - def options - nil - end -+ -+ def record(*args) -+ end - end - - if defined?(MiniTest::Assertions) && TestCase < MiniTest::Assertions --- -1.8.0.1 - diff --git a/activesupport-add-bigdecimal-dependency.patch b/activesupport-add-bigdecimal-dependency.patch deleted file mode 100644 index 5a4baa1..0000000 --- a/activesupport-add-bigdecimal-dependency.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- a/specifications/activesupport-3.2.11.gemspec.orig 2012-07-18 14:52:50.000000000 +0200 -+++ b/specifications/activesupport-3.2.11.gemspec 2012-07-18 14:56:49.367668024 +0200 -@@ -20,13 +20,16 @@ - s.specification_version = 4 - - if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then -+ s.add_runtime_dependency(%q<bigdecimal>, [">= 0"]) - s.add_runtime_dependency(%q<i18n>, ["~> 0.6"]) - s.add_runtime_dependency(%q<multi_json>, ["~> 1.0"]) - else -+ s.add_dependency(%q<bigdecimal>, [">= 0"]) - s.add_dependency(%q<i18n>, ["~> 0.6"]) - s.add_dependency(%q<multi_json>, ["~> 1.0"]) - end - else -+ s.add_dependency(%q<bigdecimal>, [">= 0"]) - s.add_dependency(%q<i18n>, ["~> 0.6"]) - s.add_dependency(%q<multi_json>, ["~> 1.0"]) - end diff --git a/activesupport-remove-memcache-build-dep.patch b/activesupport-remove-memcache-build-dep.patch deleted file mode 100644 index 12b8c14..0000000 --- a/activesupport-remove-memcache-build-dep.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- test/abstract_unit.rb.orig 2011-02-02 12:38:56.766898240 -0500 -+++ test/abstract_unit.rb 2011-02-02 12:38:55.397898289 -0500 -@@ -34,12 +34,16 @@ require 'active_support' - require 'active_support/ruby/shim' if RUBY_VERSION < '1.8.7' - - def uses_memcached(test_name) -- require 'memcache' - begin -- MemCache.new('localhost:11211').stats -- yield -- rescue MemCache::MemCacheError -- $stderr.puts "Skipping #{test_name} tests. Start memcached and try again." -+ require 'memcache' -+ begin -+ MemCache.new('localhost:11211').stats -+ yield -+ rescue MemCache::MemCacheError -+ $stderr.puts "Skipping #{test_name} tests. Start memcached and try again." -+ end -+ rescue LoadError -+ $stderr.puts "Skipping #{test_name} tests. Install memcache-client and try again." - end - end - ---- test/caching_test.rb.orig 2011-02-02 12:39:05.979900964 -0500 -+++ test/caching_test.rb 2011-02-02 12:41:10.089899015 -0500 -@@ -59,40 +59,6 @@ class CacheStoreSettingTest < ActiveSupp - assert_equal "/path/to/cache/directory", store.cache_path - end - -- def test_mem_cache_fragment_cache_store -- MemCache.expects(:new).with(%w[localhost], {}) -- store = ActiveSupport::Cache.lookup_store :mem_cache_store, "localhost" -- assert_kind_of(ActiveSupport::Cache::MemCacheStore, store) -- end -- -- def test_mem_cache_fragment_cache_store_with_given_mem_cache -- mem_cache = MemCache.new -- MemCache.expects(:new).never -- store = ActiveSupport::Cache.lookup_store :mem_cache_store, mem_cache -- assert_kind_of(ActiveSupport::Cache::MemCacheStore, store) -- end -- -- def test_mem_cache_fragment_cache_store_with_given_mem_cache_like_object -- MemCache.expects(:new).never -- memcache = Object.new -- def memcache.get() true end -- store = ActiveSupport::Cache.lookup_store :mem_cache_store, memcache -- assert_kind_of(ActiveSupport::Cache::MemCacheStore, store) -- end -- -- def test_mem_cache_fragment_cache_store_with_multiple_servers -- MemCache.expects(:new).with(%w[localhost 192.168.1.1], {}) -- store = ActiveSupport::Cache.lookup_store :mem_cache_store, "localhost", '192.168.1.1' -- assert_kind_of(ActiveSupport::Cache::MemCacheStore, store) -- end -- -- def test_mem_cache_fragment_cache_store_with_options -- MemCache.expects(:new).with(%w[localhost 192.168.1.1], { :timeout => 10 }) -- store = ActiveSupport::Cache.lookup_store :mem_cache_store, "localhost", '192.168.1.1', :namespace => 'foo', :timeout => 10 -- assert_kind_of(ActiveSupport::Cache::MemCacheStore, store) -- assert_equal 'foo', store.options[:namespace] -- end -- - def test_object_assigned_fragment_cache_store - store = ActiveSupport::Cache.lookup_store ActiveSupport::Cache::FileStore.new("/path/to/cache/directory") - assert_kind_of(ActiveSupport::Cache::FileStore, store) diff --git a/rubygem-activesupport-json-ordering.patch b/rubygem-activesupport-json-ordering.patch new file mode 100644 index 0000000..ee4f2b1 --- /dev/null +++ b/rubygem-activesupport-json-ordering.patch @@ -0,0 +1,47 @@ +From 415e11c830af0cfaa304268693d422e707ba0778 Mon Sep 17 00:00:00 2001 +From: Yehuda Katz <yehudakatz@YK.local> +Date: Wed, 10 Feb 2010 14:46:16 -0800 +Subject: [PATCH] Fix a JSON ordering issue + +(cherry picked from commit a3eaaf6b50b76a51080ec9ae6b217095868f3054) +--- + activesupport/test/json/encoding_test.rb | 10 +++++++--- + 1 files changed, 7 insertions(+), 3 deletions(-) + +diff --git a/activesupport/test/json/encoding_test.rb b/activesupport/test/json/encoding_test.rb +index 47b2ba2..d4be0bb 100644 +--- a/activesupport/test/json/encoding_test.rb ++++ b/activesupport/test/json/encoding_test.rb +@@ -49,13 +49,18 @@ class TestJSONEncoding < Test::Unit::TestCase + StandardDateTimeTests = [[ DateTime.civil(2005,2,1,15,15,10), %("2005-02-01T15:15:10+00:00") ]] + StandardStringTests = [[ 'this is the <string>', %("this is the <string>")]] + ++ def sorted_json(json) ++ return json unless json =~ /^\{.*\}$/ ++ '{' + json[1..-2].split(',').sort.join(',') + '}' ++ end ++ + constants.grep(/Tests$/).each do |class_tests| + define_method("test_#{class_tests[0..-6].underscore}") do + begin + ActiveSupport.escape_html_entities_in_json = class_tests !~ /^Standard/ + ActiveSupport.use_standard_json_time_format = class_tests =~ /^Standard/ + self.class.const_get(class_tests).each do |pair| +- assert_equal pair.last, ActiveSupport::JSON.encode(pair.first) ++ assert_equal pair.last, sorted_json(ActiveSupport::JSON.encode(pair.first)) + end + ensure + ActiveSupport.escape_html_entities_in_json = false +@@ -70,8 +75,7 @@ class TestJSONEncoding < Test::Unit::TestCase + assert_equal %({\"a\":[1,2]}), ActiveSupport::JSON.encode('a' => [1,2]) + assert_equal %({"1":2}), ActiveSupport::JSON.encode(1 => 2) + +- sorted_json = '{' + ActiveSupport::JSON.encode(:a => :b, :c => :d)[1..-2].split(',').sort.join(',') + '}' +- assert_equal %({\"a\":\"b\",\"c\":\"d\"}), sorted_json ++ assert_equal %({\"a\":\"b\",\"c\":\"d\"}), sorted_json(ActiveSupport::JSON.encode(:a => :b, :c => :d)) + end + + def test_utf8_string_encoded_properly_when_kcode_is_utf8 +-- +1.7.1 + diff --git a/rubygem-activesupport-xml-ordering.patch b/rubygem-activesupport-xml-ordering.patch new file mode 100644 index 0000000..8b0f247 --- /dev/null +++ b/rubygem-activesupport-xml-ordering.patch @@ -0,0 +1,36 @@ +From 32517cdb387a2e4922e31cddb38912148ddb4710 Mon Sep 17 00:00:00 2001 +From: Ken Dreyer <ktdreyer@ktdreyer.com> +Date: Thu, 7 Feb 2013 19:32:44 -0700 +Subject: [PATCH] Fixed failing test for ruby-1.8.7-p357 + +See #4292 + +(cherry picked from commit 91a9b2441783de118a2f9ec11b0aa3ae80133d91) + +Conflicts: + + activesupport/test/core_ext/hash_ext_test.rb +--- + activesupport/test/core_ext/hash_ext_test.rb | 6 +++--- + 1 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb +index 80873b4..308c6b0 100644 +--- a/activesupport/test/core_ext/hash_ext_test.rb ++++ b/activesupport/test/core_ext/hash_ext_test.rb +@@ -892,9 +892,9 @@ class HashToXmlTest < Test::Unit::TestCase + :bare_string => 'First & Last Name', + :pre_escaped_string => 'First & Last Name' + }.stringify_keys +- +- expected_xml = '<person><bare-string>First & Last Name</bare-string><pre-escaped-string>First &amp; Last Name</pre-escaped-string></person>' +- assert_equal expected_xml, hash.to_xml(@xml_options) ++ ++ assert hash.to_xml(@xml_options).include?("<bare-string>First & Last Name</bare-string>") ++ assert hash.to_xml(@xml_options).include?("<pre-escaped-string>First &amp; Last Name</pre-escaped-string>") + end + + def test_unescaping_from_xml +-- +1.7.1 + diff --git a/rubygem-activesupport.spec b/rubygem-activesupport.spec index c44774c..5dc8317 100644 --- a/rubygem-activesupport.spec +++ b/rubygem-activesupport.spec @@ -1,12 +1,15 @@ %global gem_name activesupport - +%if 0%{?el6} +%global rubyabi 1.8 +%else %global rubyabi 1.9.1 +%endif Summary: Support and utility classes used by the Rails framework Name: rubygem-%{gem_name} Epoch: 1 -Version: 3.2.11 +Version: 2.3.16 Release: 1%{?dist} Group: Development/Languages License: MIT @@ -18,50 +21,41 @@ Source0: http://rubygems.org/downloads/activesupport-%{version}.gem # Rails rpms, you may check it out like so # git clone http://github.com/rails/rails.git # cd rails/activesupport/ -# git checkout v3.2.11 -# tar czvf activesupport-3.2.11-tests.tgz test/ +# git checkout v2.3.16 +# tar czvf activesupport-2.3.16-tests.tgz test/ Source2: activesupport-%{version}-tests.tgz -# Removes code which breaks the test suite due to a -# dependency on a file in the greater rails proj -Patch1: activesupport-tests-fix.patch - -# Remove memcache build dependency until rubygem-memcache-client -# is in Fedora http://bugzilla.redhat.com/show_bug.cgi?id=668822 -Patch2: activesupport-remove-memcache-build-dep.patch - -# Rails 3.2 does not work with Minitest 4.2 yet. -# https://github.com/rails/rails/commit/ae6d2efd844cc6cf6822fe424d8e09c510153c90 -Patch3: activesupport-4.0.0-Make-the-tests-pass-with-minitest-4.2.patch +# JSON tests fail without a3eaaf6b50b76a51080ec9ae6b217095868f3054 +# This was merged upstream in Rails 3.0, but does not exist in 2.3.16. +# I've cherry-picked it onto v2.3.16 to account for line number differences. +Patch1: rubygem-activesupport-json-ordering.patch -# We need to add the bigdecimal dependency to gemspec, otherwise it won't be -# loaded. The reason for this is unbundling it from ruby libdir and moving -# it under %%{gem_dir} (therefore if not in Gemfile, it won't be found). -Patch4: activesupport-add-bigdecimal-dependency.patch +# XML encoding test fails without 91a9b2441783de118a2f9ec11b0aa3ae80133d91 +# Again, merged upstream in Rails 3.0, but does not exist in 2.3.16. +# I've cherry-picked it onto v2.3.16 to account for line number differences. +Patch2: rubygem-activesupport-xml-ordering.patch Requires: ruby(rubygems) Requires: ruby(abi) = %{rubyabi} # Let's keep Requires and BuildRequires sorted alphabeticaly -Requires: rubygem(bigdecimal) -Requires: rubygem(i18n) >= 0.6 -Requires: rubygem(i18n) < 1.0 -Requires: rubygem(multi_json) >= 1.0 -Requires: rubygem(multi_json) < 2 +%if 0%{?fedora} BuildRequires: rubygems-devel -BuildRequires: rubygem(bigdecimal) -BuildRequires: rubygem(builder) -BuildRequires: rubygem(i18n) >= 0.6 -BuildRequires: rubygem(i18n) < 1.0 -#BuildRequires: rubygem(memcache-client) -BuildRequires: rubygem(minitest) -BuildRequires: rubygem(mocha) -BuildRequires: rubygem(multi_json) >= 1.0 -BuildRequires: rubygem(multi_json) < 2 -BuildRequires: rubygem(rack) -BuildRequires: rubygem(tzinfo) +%else +BuildRequires: ruby(rubygems) +%endif +BuildRequires(check): rubygem(mocha) BuildArch: noarch Provides: rubygem(%{gem_name}) = %{version} +# macros for RHEL6 compatibility: +%{!?gem_dir: %global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)} +%{!?gem_instdir: %global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version}} +%{!?gem_libdir: %global gem_libdir %{gem_instdir}/lib} +%{!?gem_cache: %global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem} +%{!?gem_spec: %global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec} +%{!?gem_docdir: %global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version}} +%{!?gem_extdir: %global gem_extdir %{_libdir}/gems/exts/%{gem_name}-%{version}} + %description Utility library which carries commonly used classes and goodies from the Rails framework @@ -75,15 +69,9 @@ gem install --local --install-dir .%{gem_dir} \ # move the tests into place tar xzvf %{SOURCE2} -C .%{gem_instdir} - pushd .%{gem_instdir} -%patch1 -p0 -%patch2 -p0 -%patch3 -p2 -popd - -pushd .%{gem_dir} -%patch4 -p1 +%patch1 -p2 +%patch2 -p2 popd %build @@ -93,6 +81,24 @@ rm -rf %{buildroot} mkdir -p %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* %{buildroot}%{gem_dir} +# Remove bad shebangs +for file in %{buildroot}%{gem_instdir}/lib/active_support/vendor/builder-2.1.2/builder.rb \ + %{buildroot}%{gem_instdir}/lib/active_support/vendor/builder-2.1.2/blankslate.rb \ + %{buildroot}%{gem_instdir}/lib/active_support/vendor/builder-2.1.2/builder/* ; do + sed -i -e '1s/^\#!.*$//' $file +done + +# Fix anything executable that does not have a shebang +for file in `find %{buildroot}/%{gem_instdir} -type f -perm /a+x`; do + [ -z "`head -n 1 $file | grep \"^#!/\"`" ] && chmod -v 644 $file +done + +# Find files with a shebang that do not have executable permissions +for file in `find %{buildroot}/%{gem_instdir} -type f ! -perm /a+x -name "*.rb"`; do + [ ! -z "`head -n 1 $file | grep \"^#!/\"`" ] && chmod -v 755 $file +done + + %check pushd %{buildroot}%{gem_instdir} ruby -Itest -e "Dir.glob('./test/**/*_test.rb').each {|t| require t}" @@ -100,10 +106,9 @@ popd %files %dir %{gem_instdir} -%doc %{gem_instdir}/CHANGELOG.md +%doc %{gem_instdir}/CHANGELOG %{gem_libdir} -%doc %{gem_instdir}/MIT-LICENSE -%doc %{gem_instdir}/README.rdoc +%doc %{gem_instdir}/README %doc %{gem_docdir} %{gem_cache} %{gem_spec} @@ -111,6 +116,10 @@ popd %changelog +* Thu Feb 07 2013 Ken Dreyer <ktdreyer@ktdreyer.com> - 1:2.3.16-1 +- Downgrade to ActiveSupport 2.3.16. +- RHEL 6 compatibility. + * Wed Jan 09 2013 Vít Ondruch <vondruch@redhat.com> - 1:3.2.11-1 - Update to ActiveSupport 3.2.11. @@ -1,2 +1,2 @@ -6c183693788f23559a36007169b3045e activesupport-3.2.11-tests.tgz -0111d422d20221093990bac0a0d3b447 activesupport-3.2.11.gem +d704f24d6dbd23963c22fa6cbf837dd1 activesupport-2.3.16-tests.tgz +e8110faabd5f937191585fb1b2986b17 activesupport-2.3.16.gem |