diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..87c7464 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +SOURCES/activesupport-5.0.1-tests.tgz +SOURCES/activesupport-5.0.1.gem diff --git a/.rh-ror50-rubygem-activesupport.metadata b/.rh-ror50-rubygem-activesupport.metadata new file mode 100644 index 0000000..1365ac9 --- /dev/null +++ b/.rh-ror50-rubygem-activesupport.metadata @@ -0,0 +1,2 @@ +07fe0f1970d5ffc1ac328f37cd5665f33400ecf0 SOURCES/activesupport-5.0.1-tests.tgz +5c546eca785ea25624b5a80f0304fbac9f2efe44 SOURCES/activesupport-5.0.1.gem diff --git a/README.md b/README.md deleted file mode 100644 index 98f42b4..0000000 --- a/README.md +++ /dev/null @@ -1,4 +0,0 @@ -The master branch has no content - -Look at the c7 branch if you are working with CentOS-7, or the c4/c5/c6 branch for CentOS-4, 5 or 6 -If you find this file in a distro specific branch, it means that no content has been checked in yet diff --git a/SOURCES/rubygem-activesupport-5.0.0-DRY-Downloader.patch b/SOURCES/rubygem-activesupport-5.0.0-DRY-Downloader.patch new file mode 100644 index 0000000..4908fbb --- /dev/null +++ b/SOURCES/rubygem-activesupport-5.0.0-DRY-Downloader.patch @@ -0,0 +1,136 @@ +From 7d7c2d13ba896dd8b58fe91d2fe0c4fc588069ca Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Mon, 4 Jul 2016 13:11:44 +0200 +Subject: [PATCH 1/2] DRY Downloader. + +--- + activesupport/test/multibyte_conformance_test.rb | 18 ------------------ + .../test/multibyte_grapheme_break_conformance_test.rb | 19 ++----------------- + .../test/multibyte_normalization_conformance_test.rb | 18 ------------------ + activesupport/test/multibyte_test_helpers.rb | 18 ++++++++++++++++++ + 4 files changed, 20 insertions(+), 53 deletions(-) + +diff --git a/activesupport/test/multibyte_conformance_test.rb b/activesupport/test/multibyte_conformance_test.rb +index 9fca47a..709c63a 100644 +--- a/activesupport/test/multibyte_conformance_test.rb ++++ b/activesupport/test/multibyte_conformance_test.rb +@@ -6,24 +6,6 @@ + require 'tmpdir' + + class MultibyteConformanceTest < ActiveSupport::TestCase +- class Downloader +- def self.download(from, to) +- unless File.exist?(to) +- unless File.exist?(File.dirname(to)) +- system "mkdir -p #{File.dirname(to)}" +- end +- open(from) do |source| +- File.open(to, 'w') do |target| +- source.each_line do |l| +- target.write l +- end +- end +- end +- end +- true +- end +- end +- + include MultibyteTestHelpers + + UNIDATA_URL = "http://www.unicode.org/Public/#{ActiveSupport::Multibyte::Unicode::UNICODE_VERSION}/ucd" +diff --git a/activesupport/test/multibyte_grapheme_break_conformance_test.rb b/activesupport/test/multibyte_grapheme_break_conformance_test.rb +index 6e2f02a..45e1976 100644 +--- a/activesupport/test/multibyte_grapheme_break_conformance_test.rb ++++ b/activesupport/test/multibyte_grapheme_break_conformance_test.rb +@@ -1,29 +1,14 @@ + # encoding: utf-8 + + require 'abstract_unit' ++require 'multibyte_test_helpers' + + require 'fileutils' + require 'open-uri' + require 'tmpdir' + + class MultibyteGraphemeBreakConformanceTest < ActiveSupport::TestCase +- class Downloader +- def self.download(from, to) +- unless File.exist?(to) +- $stderr.puts "Downloading #{from} to #{to}" +- unless File.exist?(File.dirname(to)) +- system "mkdir -p #{File.dirname(to)}" +- end +- open(from) do |source| +- File.open(to, 'w') do |target| +- source.each_line do |l| +- target.write l +- end +- end +- end +- end +- end +- end ++ include MultibyteTestHelpers + + TEST_DATA_URL = "http://www.unicode.org/Public/#{ActiveSupport::Multibyte::Unicode::UNICODE_VERSION}/ucd/auxiliary" + TEST_DATA_FILE = '/GraphemeBreakTest.txt' +diff --git a/activesupport/test/multibyte_normalization_conformance_test.rb b/activesupport/test/multibyte_normalization_conformance_test.rb +index 0d31c95..ad2e651 100644 +--- a/activesupport/test/multibyte_normalization_conformance_test.rb ++++ b/activesupport/test/multibyte_normalization_conformance_test.rb +@@ -8,24 +8,6 @@ + require 'tmpdir' + + class MultibyteNormalizationConformanceTest < ActiveSupport::TestCase +- class Downloader +- def self.download(from, to) +- unless File.exist?(to) +- $stderr.puts "Downloading #{from} to #{to}" +- unless File.exist?(File.dirname(to)) +- system "mkdir -p #{File.dirname(to)}" +- end +- open(from) do |source| +- File.open(to, 'w') do |target| +- source.each_line do |l| +- target.write l +- end +- end +- end +- end +- end +- end +- + include MultibyteTestHelpers + + UNIDATA_URL = "http://www.unicode.org/Public/#{ActiveSupport::Multibyte::Unicode::UNICODE_VERSION}/ucd" +diff --git a/activesupport/test/multibyte_test_helpers.rb b/activesupport/test/multibyte_test_helpers.rb +index 58cf548..709586e 100644 +--- a/activesupport/test/multibyte_test_helpers.rb ++++ b/activesupport/test/multibyte_test_helpers.rb +@@ -1,4 +1,22 @@ + module MultibyteTestHelpers ++ class Downloader ++ def self.download(from, to) ++ unless File.exist?(to) ++ unless File.exist?(File.dirname(to)) ++ system "mkdir -p #{File.dirname(to)}" ++ end ++ open(from) do |source| ++ File.open(to, 'w') do |target| ++ source.each_line do |l| ++ target.write l ++ end ++ end ++ end ++ end ++ true ++ end ++ end ++ + UNICODE_STRING = 'こにちわ'.freeze + ASCII_STRING = 'ohayo'.freeze + BYTE_STRING = "\270\236\010\210\245".force_encoding("ASCII-8BIT").freeze +-- +2.9.0 + diff --git a/SOURCES/rubygem-activesupport-5.0.0-Skip-the-test-if-test-data-download-fails.patch b/SOURCES/rubygem-activesupport-5.0.0-Skip-the-test-if-test-data-download-fails.patch new file mode 100644 index 0000000..b4bc9a9 --- /dev/null +++ b/SOURCES/rubygem-activesupport-5.0.0-Skip-the-test-if-test-data-download-fails.patch @@ -0,0 +1,101 @@ +From c245ca30f248367e07d5d831195b12c93a1e3137 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=ADt=20Ondruch?= +Date: Mon, 4 Jul 2016 13:36:30 +0200 +Subject: [PATCH] Skip the test if test data download fails. + +--- + activesupport/test/multibyte_conformance_test.rb | 2 -- + .../test/multibyte_grapheme_break_conformance_test.rb | 13 +++++++------ + .../test/multibyte_normalization_conformance_test.rb | 9 +++++---- + activesupport/test/multibyte_test_helpers.rb | 4 ++++ + 4 files changed, 16 insertions(+), 12 deletions(-) + +diff --git a/activesupport/test/multibyte_conformance_test.rb b/activesupport/test/multibyte_conformance_test.rb +index 709c63a..c10133a 100644 +--- a/activesupport/test/multibyte_conformance_test.rb ++++ b/activesupport/test/multibyte_conformance_test.rb +@@ -8,9 +8,7 @@ + class MultibyteConformanceTest < ActiveSupport::TestCase + include MultibyteTestHelpers + +- UNIDATA_URL = "http://www.unicode.org/Public/#{ActiveSupport::Multibyte::Unicode::UNICODE_VERSION}/ucd" + UNIDATA_FILE = '/NormalizationTest.txt' +- CACHE_DIR = "#{Dir.tmpdir}/cache/unicode_conformance" + FileUtils.mkdir_p(CACHE_DIR) + RUN_P = begin + Downloader.download(UNIDATA_URL + UNIDATA_FILE, CACHE_DIR + UNIDATA_FILE) +diff --git a/activesupport/test/multibyte_grapheme_break_conformance_test.rb b/activesupport/test/multibyte_grapheme_break_conformance_test.rb +index 45e1976..61943b1 100644 +--- a/activesupport/test/multibyte_grapheme_break_conformance_test.rb ++++ b/activesupport/test/multibyte_grapheme_break_conformance_test.rb +@@ -10,13 +10,14 @@ + class MultibyteGraphemeBreakConformanceTest < ActiveSupport::TestCase + include MultibyteTestHelpers + +- TEST_DATA_URL = "http://www.unicode.org/Public/#{ActiveSupport::Multibyte::Unicode::UNICODE_VERSION}/ucd/auxiliary" +- TEST_DATA_FILE = '/GraphemeBreakTest.txt' +- CACHE_DIR = "#{Dir.tmpdir}/cache/unicode_conformance" ++ UNIDATA_FILE = '/auxiliary/GraphemeBreakTest.txt' ++ RUN_P = begin ++ Downloader.download(UNIDATA_URL + UNIDATA_FILE, CACHE_DIR + UNIDATA_FILE) ++ rescue ++ end + + def setup +- FileUtils.mkdir_p(CACHE_DIR) +- Downloader.download(TEST_DATA_URL + TEST_DATA_FILE, CACHE_DIR + TEST_DATA_FILE) ++ skip "Unable to download test data" unless RUN_P + end + + def test_breaks +@@ -31,7 +32,7 @@ def test_breaks + def each_line_of_break_tests(&block) + lines = 0 + max_test_lines = 0 # Don't limit below 21, because that's the header of the testfile +- File.open(File.join(CACHE_DIR, TEST_DATA_FILE), 'r') do | f | ++ File.open(File.join(CACHE_DIR, UNIDATA_FILE), 'r') do | f | + until f.eof? || (max_test_lines > 21 and lines > max_test_lines) + lines += 1 + line = f.gets.chomp! +diff --git a/activesupport/test/multibyte_normalization_conformance_test.rb b/activesupport/test/multibyte_normalization_conformance_test.rb +index ad2e651..77ed0ce 100644 +--- a/activesupport/test/multibyte_normalization_conformance_test.rb ++++ b/activesupport/test/multibyte_normalization_conformance_test.rb +@@ -10,14 +10,15 @@ + class MultibyteNormalizationConformanceTest < ActiveSupport::TestCase + include MultibyteTestHelpers + +- UNIDATA_URL = "http://www.unicode.org/Public/#{ActiveSupport::Multibyte::Unicode::UNICODE_VERSION}/ucd" + UNIDATA_FILE = '/NormalizationTest.txt' +- CACHE_DIR = "#{Dir.tmpdir}/cache/unicode_conformance" ++ RUN_P = begin ++ Downloader.download(UNIDATA_URL + UNIDATA_FILE, CACHE_DIR + UNIDATA_FILE) ++ rescue ++ end + + def setup +- FileUtils.mkdir_p(CACHE_DIR) +- Downloader.download(UNIDATA_URL + UNIDATA_FILE, CACHE_DIR + UNIDATA_FILE) + @proxy = ActiveSupport::Multibyte::Chars ++ skip "Unable to download test data" unless RUN_P + end + + def test_normalizations_C +diff --git a/activesupport/test/multibyte_test_helpers.rb b/activesupport/test/multibyte_test_helpers.rb +index 709586e..0ada8bc 100644 +--- a/activesupport/test/multibyte_test_helpers.rb ++++ b/activesupport/test/multibyte_test_helpers.rb +@@ -17,6 +17,10 @@ def self.download(from, to) + end + end + ++ UNIDATA_URL = "http://www.unicode.org/Public/#{ActiveSupport::Multibyte::Unicode::UNICODE_VERSION}/ucd" ++ CACHE_DIR = "#{Dir.tmpdir}/cache/unicode_conformance" ++ FileUtils.mkdir_p(CACHE_DIR) ++ + UNICODE_STRING = 'こにちわ'.freeze + ASCII_STRING = 'ohayo'.freeze + BYTE_STRING = "\270\236\010\210\245".force_encoding("ASCII-8BIT").freeze +-- +2.9.0 + diff --git a/SOURCES/rubygem-activesupport-5.0.1-Fix-Fixnum-duration-test.patch b/SOURCES/rubygem-activesupport-5.0.1-Fix-Fixnum-duration-test.patch new file mode 100644 index 0000000..456349e --- /dev/null +++ b/SOURCES/rubygem-activesupport-5.0.1-Fix-Fixnum-duration-test.patch @@ -0,0 +1,22 @@ +From 598f10c00084f20e277b82ed83a8ef8bd85a1a78 Mon Sep 17 00:00:00 2001 +From: utilum +Date: Thu, 15 Dec 2016 02:42:52 +0100 +Subject: [PATCH] Fix Fixnum deprecated warning in Ruby 2.4+ + +--- + activesupport/test/core_ext/duration_test.rb | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/activesupport/test/core_ext/duration_test.rb b/activesupport/test/core_ext/duration_test.rb +index 26a9ea4..6f7f16d 100644 +--- a/activesupport/test/core_ext/duration_test.rb ++++ b/activesupport/test/core_ext/duration_test.rb +@@ -21,7 +21,7 @@ class << k; undef_method :== end + end + + def test_instance_of +- assert 1.minute.instance_of?(Fixnum) ++ assert 1.minute.instance_of?(1.class) + assert 2.days.instance_of?(ActiveSupport::Duration) + assert !3.second.instance_of?(Numeric) + end diff --git a/SOURCES/rubygem-activesupport-5.0.1-Fixnum-and-Bignum-are-deprecated-in-Ruby-trunk-tests.patch b/SOURCES/rubygem-activesupport-5.0.1-Fixnum-and-Bignum-are-deprecated-in-Ruby-trunk-tests.patch new file mode 100644 index 0000000..99206fa --- /dev/null +++ b/SOURCES/rubygem-activesupport-5.0.1-Fixnum-and-Bignum-are-deprecated-in-Ruby-trunk-tests.patch @@ -0,0 +1,28 @@ +From b552b5edaffe5dae183ece4d8475a0e7005da6c7 Mon Sep 17 00:00:00 2001 +From: Matthew Draper +Date: Sat, 8 Oct 2016 10:50:36 +1030 +Subject: [PATCH] Merge pull request #26732 from matthewd/fixnum-warning + +Fixnum and Bignum are deprecated in Ruby trunk +--- + activesupport/test/core_ext/array/grouping_test.rb | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/activesupport/test/core_ext/array/grouping_test.rb b/activesupport/test/core_ext/array/grouping_test.rb +index 0682241..7479d8d 100644 +--- a/activesupport/test/core_ext/array/grouping_test.rb ++++ b/activesupport/test/core_ext/array/grouping_test.rb +@@ -4,11 +4,11 @@ + class GroupingTest < ActiveSupport::TestCase + def setup + # In Ruby < 2.4, test we avoid Integer#/ (redefined by mathn) +- Fixnum.send :private, :/ unless Fixnum == Integer ++ Fixnum.send :private, :/ unless 0.class == Integer + end + + def teardown +- Fixnum.send :public, :/ unless Fixnum == Integer ++ Fixnum.send :public, :/ unless 0.class == Integer + end + + def test_in_groups_of_with_perfect_fit diff --git a/SOURCES/rubygem-activesupport-5.0.1-Fixnum-and-Bignum-are-deprecated-in-Ruby-trunk.patch b/SOURCES/rubygem-activesupport-5.0.1-Fixnum-and-Bignum-are-deprecated-in-Ruby-trunk.patch new file mode 100644 index 0000000..2d0baa2 --- /dev/null +++ b/SOURCES/rubygem-activesupport-5.0.1-Fixnum-and-Bignum-are-deprecated-in-Ruby-trunk.patch @@ -0,0 +1,39 @@ +From b552b5edaffe5dae183ece4d8475a0e7005da6c7 Mon Sep 17 00:00:00 2001 +From: Matthew Draper +Date: Sat, 8 Oct 2016 10:50:36 +1030 +Subject: [PATCH] Merge pull request #26732 from matthewd/fixnum-warning + +Fixnum and Bignum are deprecated in Ruby trunk +--- + activesupport/lib/active_support/core_ext/numeric/conversions.rb | 2 +- + activesupport/lib/active_support/xml_mini.rb | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/activesupport/lib/active_support/core_ext/numeric/conversions.rb b/activesupport/lib/active_support/core_ext/numeric/conversions.rb +index 6586a35..193f6b2 100644 +--- a/activesupport/lib/active_support/core_ext/numeric/conversions.rb ++++ b/activesupport/lib/active_support/core_ext/numeric/conversions.rb +@@ -135,7 +135,7 @@ def to_formatted_s(*args) + end + + # Ruby 2.4+ unifies Fixnum & Bignum into Integer. +-if Integer == Fixnum ++if 0.class == Integer + Integer.prepend ActiveSupport::NumericWithFormat + else + Fixnum.prepend ActiveSupport::NumericWithFormat +diff --git a/activesupport/lib/active_support/xml_mini.rb b/activesupport/lib/active_support/xml_mini.rb +index 99fc265..1812de0 100644 +--- a/activesupport/lib/active_support/xml_mini.rb ++++ b/activesupport/lib/active_support/xml_mini.rb +@@ -48,8 +48,8 @@ def content_type + } + + # No need to map these on Ruby 2.4+ +- TYPE_NAMES["Fixnum"] = "integer" unless Fixnum == Integer +- TYPE_NAMES["Bignum"] = "integer" unless Bignum == Integer ++ TYPE_NAMES["Fixnum"] = "integer" unless 0.class == Integer ++ TYPE_NAMES["Bignum"] = "integer" unless 0.class == Integer + end + + FORMATTING = { diff --git a/SOURCES/rubygem-activesupport-5.0.1-duplicable-symbol-tests.patch b/SOURCES/rubygem-activesupport-5.0.1-duplicable-symbol-tests.patch new file mode 100644 index 0000000..cc45147 --- /dev/null +++ b/SOURCES/rubygem-activesupport-5.0.1-duplicable-symbol-tests.patch @@ -0,0 +1,15 @@ +diff --git a/activesupport/test/core_ext/object/duplicable_test.rb b/activesupport/test/core_ext/object/duplicable_test.rb +index c2d7c15..2e3b185 100644 +--- a/activesupport/test/core_ext/object/duplicable_test.rb ++++ b/activesupport/test/core_ext/object/duplicable_test.rb +@@ -5,8 +5,8 @@ + + class DuplicableTest < ActiveSupport::TestCase + if RUBY_VERSION >= "2.4.0" +- RAISE_DUP = [method(:puts)] +- ALLOW_DUP = ["1", Object.new, /foo/, [], {}, Time.now, Class.new, Module.new, BigDecimal.new("4.56"), nil, false, true, :symbol, 1, 2.3] ++ RAISE_DUP = [method(:puts), 'symbol_from_string'.to_sym] ++ ALLOW_DUP = ["1", Object.new, /foo/, [], {}, Time.now, Class.new, Module.new, BigDecimal.new("4.56"), nil, false, true, 1, 2.3] + else + RAISE_DUP = [nil, false, true, :symbol, 1, 2.3, method(:puts)] + ALLOW_DUP = ["1", Object.new, /foo/, [], {}, Time.now, Class.new, Module.new, BigDecimal.new("4.56")] diff --git a/SOURCES/rubygem-activesupport-5.0.1-duplicable-symbol.patch b/SOURCES/rubygem-activesupport-5.0.1-duplicable-symbol.patch new file mode 100644 index 0000000..d1e59c0 --- /dev/null +++ b/SOURCES/rubygem-activesupport-5.0.1-duplicable-symbol.patch @@ -0,0 +1,14 @@ +diff --git a/activesupport/lib/active_support/core_ext/object/duplicable.rb b/activesupport/lib/active_support/core_ext/object/duplicable.rb +index d4bf8ce..58045d5 100644 +--- a/activesupport/lib/active_support/core_ext/object/duplicable.rb ++++ b/activesupport/lib/active_support/core_ext/object/duplicable.rb +@@ -73,7 +73,8 @@ def duplicable? + + class Symbol + begin +- :symbol.dup ++ :symbol.dup # Ruby 2.4.x. ++ 'symbol_from_string'.to_sym.dup # Some symbols can't `dup` in Ruby 2.4.0. + rescue TypeError + + # Symbols are not duplicable: diff --git a/SOURCES/rubygem-activesupport-5.0.1-duplicable-tests.patch b/SOURCES/rubygem-activesupport-5.0.1-duplicable-tests.patch new file mode 100644 index 0000000..6ed6926 --- /dev/null +++ b/SOURCES/rubygem-activesupport-5.0.1-duplicable-tests.patch @@ -0,0 +1,21 @@ +diff --git a/activesupport/test/core_ext/object/duplicable_test.rb b/activesupport/test/core_ext/object/duplicable_test.rb +index 042f5cf..c2d7c15 100644 +--- a/activesupport/test/core_ext/object/duplicable_test.rb ++++ b/activesupport/test/core_ext/object/duplicable_test.rb +@@ -4,9 +4,13 @@ + require 'active_support/core_ext/numeric/time' + + class DuplicableTest < ActiveSupport::TestCase +- RAISE_DUP = [nil, false, true, :symbol, 1, 2.3, method(:puts)] +- ALLOW_DUP = ['1', Object.new, /foo/, [], {}, Time.now, Class.new, Module.new] +- ALLOW_DUP << BigDecimal.new('4.56') ++ if RUBY_VERSION >= "2.4.0" ++ RAISE_DUP = [method(:puts)] ++ ALLOW_DUP = ["1", Object.new, /foo/, [], {}, Time.now, Class.new, Module.new, BigDecimal.new("4.56"), nil, false, true, :symbol, 1, 2.3] ++ else ++ RAISE_DUP = [nil, false, true, :symbol, 1, 2.3, method(:puts)] ++ ALLOW_DUP = ["1", Object.new, /foo/, [], {}, Time.now, Class.new, Module.new, BigDecimal.new("4.56")] ++ end + + def test_duplicable + rubinius_skip "* Method#dup is allowed at the moment on Rubinius\n" \ diff --git a/SOURCES/rubygem-activesupport-5.0.1-duplicable.patch b/SOURCES/rubygem-activesupport-5.0.1-duplicable.patch new file mode 100644 index 0000000..fbcf495 --- /dev/null +++ b/SOURCES/rubygem-activesupport-5.0.1-duplicable.patch @@ -0,0 +1,130 @@ +diff --git a/activesupport/lib/active_support/core_ext/object/duplicable.rb b/activesupport/lib/active_support/core_ext/object/duplicable.rb +index 9bc5ee6..d4bf8ce 100644 +--- a/activesupport/lib/active_support/core_ext/object/duplicable.rb ++++ b/activesupport/lib/active_support/core_ext/object/duplicable.rb +@@ -1,7 +1,7 @@ + #-- +-# Most objects are cloneable, but not all. For example you can't dup +nil+: ++# Most objects are cloneable, but not all. For example you can't dup methods: + # +-# nil.dup # => TypeError: can't dup NilClass ++# method(:puts).dup # => TypeError: allocator undefined for Method + # + # Classes may signal their instances are not duplicable removing +dup+/+clone+ + # or raising exceptions from them. So, to dup an arbitrary object you normally +@@ -19,7 +19,7 @@ + class Object + # Can you safely dup this object? + # +- # False for +nil+, +false+, +true+, symbol, number, method objects; ++ # False for method objects; + # true otherwise. + def duplicable? + true +@@ -27,52 +27,77 @@ def duplicable? + end + + class NilClass +- # +nil+ is not duplicable: +- # +- # nil.duplicable? # => false +- # nil.dup # => TypeError: can't dup NilClass +- def duplicable? +- false ++ begin ++ nil.dup ++ rescue TypeError ++ ++ # +nil+ is not duplicable: ++ # ++ # nil.duplicable? # => false ++ # nil.dup # => TypeError: can't dup NilClass ++ def duplicable? ++ false ++ end + end + end + + class FalseClass +- # +false+ is not duplicable: +- # +- # false.duplicable? # => false +- # false.dup # => TypeError: can't dup FalseClass +- def duplicable? +- false ++ begin ++ false.dup ++ rescue TypeError ++ ++ # +false+ is not duplicable: ++ # ++ # false.duplicable? # => false ++ # false.dup # => TypeError: can't dup FalseClass ++ def duplicable? ++ false ++ end + end + end + + class TrueClass +- # +true+ is not duplicable: +- # +- # true.duplicable? # => false +- # true.dup # => TypeError: can't dup TrueClass +- def duplicable? +- false ++ begin ++ true.dup ++ rescue TypeError ++ ++ # +true+ is not duplicable: ++ # ++ # true.duplicable? # => false ++ # true.dup # => TypeError: can't dup TrueClass ++ def duplicable? ++ false ++ end + end + end + + class Symbol +- # Symbols are not duplicable: +- # +- # :my_symbol.duplicable? # => false +- # :my_symbol.dup # => TypeError: can't dup Symbol +- def duplicable? +- false ++ begin ++ :symbol.dup ++ rescue TypeError ++ ++ # Symbols are not duplicable: ++ # ++ # :my_symbol.duplicable? # => false ++ # :my_symbol.dup # => TypeError: can't dup Symbol ++ def duplicable? ++ false ++ end + end + end + + class Numeric +- # Numbers are not duplicable: +- # +- # 3.duplicable? # => false +- # 3.dup # => TypeError: can't dup Integer +- def duplicable? +- false ++ begin ++ 1.dup ++ rescue TypeError ++ ++ # Numbers are not duplicable: ++ # ++ # 3.duplicable? # => false ++ # 3.dup # => TypeError: can't dup Integer ++ def duplicable? ++ false ++ end + end + end diff --git a/SOURCES/rubygem-activesupport-5.0.1-iso8601_output.patch b/SOURCES/rubygem-activesupport-5.0.1-iso8601_output.patch new file mode 100644 index 0000000..5eea5d6 --- /dev/null +++ b/SOURCES/rubygem-activesupport-5.0.1-iso8601_output.patch @@ -0,0 +1,35 @@ +From c78410286672991cf6df25ef0a9f4529e6b2617b Mon Sep 17 00:00:00 2001 +From: Akira Matsuda +Date: Sat, 5 Nov 2016 16:12:30 +0900 +Subject: [PATCH] Tweaking some test data due to sprintf behavior change in 2.4 + +2.3: sprintf('%0.1f', 5.55) #=> "5.5" +2.4: sprintf('%0.1f', 5.55) #=> "5.6" + +see: https://github.com/ruby/ruby/commit/6ed8c79ddb11ccfb580bb0a22b22cc1362250255 and +https://github.com/ruby/ruby/commit/295f60b94d5ff6551fab7c55e18d1ffa6a4cf7e3 +--- + activesupport/test/core_ext/duration_test.rb | 10 +++++----- + 1 file changed, 5 insertions(+), 5 deletions(-) + +diff --git a/activesupport/test/core_ext/duration_test.rb b/activesupport/test/core_ext/duration_test.rb +index 15aee91..9fea9ab 100644 +--- a/activesupport/test/core_ext/duration_test.rb ++++ b/activesupport/test/core_ext/duration_test.rb +@@ -287,11 +287,11 @@ def test_iso8601_output + + def test_iso8601_output_precision + expectations = [ +- [nil, 'P1Y1MT5.55S', 1.year + 1.month + (5.55).seconds ], +- [0, 'P1Y1MT6S', 1.year + 1.month + (5.55).seconds ], +- [1, 'P1Y1MT5.5S', 1.year + 1.month + (5.55).seconds ], +- [2, 'P1Y1MT5.55S', 1.year + 1.month + (5.55).seconds ], +- [3, 'P1Y1MT5.550S', 1.year + 1.month + (5.55).seconds ], ++ [nil, 'P1Y1MT8.55S', 1.year + 1.month + (8.55).seconds ], ++ [0, 'P1Y1MT9S', 1.year + 1.month + (8.55).seconds ], ++ [1, 'P1Y1MT8.6S', 1.year + 1.month + (8.55).seconds ], ++ [2, 'P1Y1MT8.55S', 1.year + 1.month + (8.55).seconds ], ++ [3, 'P1Y1MT8.550S', 1.year + 1.month + (8.55).seconds ], + [nil, 'PT1S', 1.second ], + [2, 'PT1.00S', 1.second ], + [nil, 'PT1.4S', (1.4).seconds ], diff --git a/SOURCES/rubygem-activesupport-5.0.1-parsing-decimal.patch b/SOURCES/rubygem-activesupport-5.0.1-parsing-decimal.patch new file mode 100644 index 0000000..74f4db9 --- /dev/null +++ b/SOURCES/rubygem-activesupport-5.0.1-parsing-decimal.patch @@ -0,0 +1,34 @@ +From b3d811781ec24e5bc3710c62cedac472b7999082 Mon Sep 17 00:00:00 2001 +From: Akira Matsuda +Date: Mon, 12 Dec 2016 23:41:59 +0900 +Subject: [PATCH] Keep AS::XmlMini::PARSING["decimal"].call('') returning 0 + +BigDecimal('an invalid string') has changed its behavior to raise an ArgumentError since 1.3.0 +https://bugs.ruby-lang.org/issues/10286 +--- + activesupport/lib/active_support/xml_mini.rb | 12 +++++++++++- + 1 file changed, 11 insertions(+), 1 deletion(-) + +diff --git a/activesupport/lib/active_support/xml_mini.rb b/activesupport/lib/active_support/xml_mini.rb +index 1812de0..5275c0e 100644 +--- a/activesupport/lib/active_support/xml_mini.rb ++++ b/activesupport/lib/active_support/xml_mini.rb +@@ -68,7 +68,17 @@ def content_type + "datetime" => Proc.new { |time| Time.xmlschema(time).utc rescue ::DateTime.parse(time).utc }, + "integer" => Proc.new { |integer| integer.to_i }, + "float" => Proc.new { |float| float.to_f }, +- "decimal" => Proc.new { |number| BigDecimal(number) }, ++ "decimal" => Proc.new do |number| ++ if String === number ++ begin ++ BigDecimal(number) ++ rescue ArgumentError ++ BigDecimal('0') ++ end ++ else ++ BigDecimal(number) ++ end ++ end, + "boolean" => Proc.new { |boolean| %w(1 true).include?(boolean.to_s.strip) }, + "string" => Proc.new { |string| string.to_s }, + "yaml" => Proc.new { |yaml| YAML::load(yaml) rescue yaml }, diff --git a/SOURCES/rubygem-activesupport-5.0.1-remove-warning-from-Bignum.patch b/SOURCES/rubygem-activesupport-5.0.1-remove-warning-from-Bignum.patch new file mode 100644 index 0000000..d28afef --- /dev/null +++ b/SOURCES/rubygem-activesupport-5.0.1-remove-warning-from-Bignum.patch @@ -0,0 +1,22 @@ +From 8683ac5983ddfd8b47b6aac6ab51269611610f42 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Rafael=20Fran=C3=A7a?= +Date: Sun, 13 Nov 2016 19:58:52 -0500 +Subject: [PATCH] Merge pull request #27033 from vipulnsward/fix-bignum-warning + +Remove warning from Bignum constant access +--- + activesupport/test/core_ext/numeric_ext_test.rb | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/activesupport/test/core_ext/numeric_ext_test.rb b/activesupport/test/core_ext/numeric_ext_test.rb +index 69c30a8..79a4802 100644 +--- a/activesupport/test/core_ext/numeric_ext_test.rb ++++ b/activesupport/test/core_ext/numeric_ext_test.rb +@@ -425,7 +425,6 @@ def test_in_milliseconds + + # TODO: Remove positive and negative tests when we drop support to ruby < 2.3 + b = 2**64 +- b *= b until Bignum === b + + T_ZERO = b.coerce(0).first + T_ONE = b.coerce(1).first diff --git a/SPECS/rubygem-activesupport.spec b/SPECS/rubygem-activesupport.spec new file mode 100644 index 0000000..ea2834c --- /dev/null +++ b/SPECS/rubygem-activesupport.spec @@ -0,0 +1,352 @@ +%{?scl:%scl_package rubygem-%{gem_name}} +%{!?scl:%global pkg_name %{name}} + +%global gem_name activesupport + +Summary: A support libraries and Ruby core extensions extracted from the Rails framework +Name: %{?scl_prefix}rubygem-%{gem_name} +Epoch: 1 +Version: 5.0.1 +Release: 3%{?dist} +Group: Development/Languages +License: MIT +URL: http://rubyonrails.org + +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem + +# The activesupport gem doesn't ship with the test suite like the other +# Rails rpms, you may check it out like so +# git clone http://github.com/rails/rails.git +# cd rails/activesupport/ +# git checkout v5.0.1 && tar czvf activesupport-5.0.1-tests.tgz test/ +Source1: %{gem_name}-%{version}-tests.tgz + +# Make the test which needs online access optional. +# https://github.com/rails/rails/pull/25678 +Patch1: rubygem-activesupport-5.0.0-DRY-Downloader.patch +Patch2: rubygem-activesupport-5.0.0-Skip-the-test-if-test-data-download-fails.patch + +# Fixnum and Bignum are deprecated in Ruby trunk +# https://github.com/rails/rails/pull/26732 +Patch3: rubygem-activesupport-5.0.1-Fixnum-and-Bignum-are-deprecated-in-Ruby-trunk.patch +Patch4: rubygem-activesupport-5.0.1-Fixnum-and-Bignum-are-deprecated-in-Ruby-trunk-tests.patch + +# Fix parsing decimal on Ruby 2.4. +# https://github.com/rails/rails/commit/b3d8117 +Patch5: rubygem-activesupport-5.0.1-parsing-decimal.patch + +# Fix duplicable on Ruby 2.4. +# https://github.com/rails/rails/commit/89fcd13 +Patch6: rubygem-activesupport-5.0.1-duplicable.patch +Patch7: rubygem-activesupport-5.0.1-duplicable-tests.patch + +# Fix duplicable symbol on Ruby 2.4. +# https://github.com/rails/rails/commit/2badd55 +Patch8: rubygem-activesupport-5.0.1-duplicable-symbol.patch +Patch9: rubygem-activesupport-5.0.1-duplicable-symbol-tests.patch + +# Fix iso8601 output on Ruby 2.4. +# https://github.com/rails/rails/commit/c784102 +Patch10: rubygem-activesupport-5.0.1-iso8601_output.patch + +# Fix Fixnum deprecated warning in Ruby 2.4+ +# https://github.com/rails/rails/commit/598f10c +Patch11: rubygem-activesupport-5.0.1-Fix-Fixnum-duration-test.patch + +# Remove Bignum deprecated warning in Ruby 2.4+ +# https://github.com/rails/rails/commit/8683ac5 +Patch12: rubygem-activesupport-5.0.1-remove-warning-from-Bignum.patch + +# ruby package has just soft dependency on rubygem(bigdecimal), while +# ActiveSupport always requires it. +Requires: %{?scl_prefix_ruby}rubygem(bigdecimal) + +# Let's keep Requires and BuildRequires sorted alphabeticaly +Requires: %{?scl_prefix_ruby}ruby(release) +Requires: %{?scl_prefix_ruby}ruby(rubygems) +Requires: %{?scl_prefix}rubygem(i18n) >= 0.7 +Requires: %{?scl_prefix}rubygem(i18n) < 1 +Requires: %{?scl_prefix_ruby}rubygem(json) +Requires: %{?scl_prefix_ruby}rubygem(minitest) >= 5.1 +Requires: %{?scl_prefix_ruby}rubygem(minitest) < 6 +Requires: %{?scl_prefix}rubygem(tzinfo) >= 1.1 +Requires: %{?scl_prefix}rubygem(tzinfo) < 2 +Requires: %{?scl_prefix}rubygem(concurrent-ruby) +BuildRequires: %{?scl_prefix_ruby}ruby(release) +BuildRequires: %{?scl_prefix_ruby}ruby(rubygems) +BuildRequires: %{?scl_prefix_ruby}ruby +BuildRequires: %{?scl_prefix_ruby}rubygems-devel +BuildRequires: %{?scl_prefix_ruby}rubygem(bigdecimal) +BuildRequires: %{?scl_prefix}rubygem(builder) +BuildRequires: %{?scl_prefix}rubygem(concurrent-ruby) +BuildRequires: %{?scl_prefix}rubygem(dalli) +BuildRequires: %{?scl_prefix}rubygem(i18n) >= 0.6.9 +BuildRequires: %{?scl_prefix}rubygem(i18n) < 1.0 +BuildRequires: %{?scl_prefix_ruby}rubygem(minitest) >= 5.0.0 +BuildRequires: %{?scl_prefix}rubygem(rack) +BuildRequires: %{?scl_prefix}rubygem(tzinfo) >= 1.1 +BuildRequires: %{?scl_prefix}rubygem(tzinfo) < 2.0 +BuildArch: noarch +Provides: %{?scl_prefix}rubygem(%{gem_name}) = %{version} + +# Explicitly require runtime subpackage, as long as older scl-utils do not generate it +%{?scl:Requires: %{?scl_prefix}runtime} + + +%description +A toolkit of support libraries and Ruby core extensions extracted from the +Rails framework. Rich support for multibyte strings, internationalization, +time zones, and testing. + +%package doc +Summary: Documentation for %{pkg_name} +Group: Documentation +Requires: %{?scl_prefix}%{pkg_name} = %{epoch}:%{version}-%{release} +BuildArch: noarch + +%description doc +Documentation for %{pkg_name}. + +%prep +%setup -n %{pkg_name}-%{version} -q -c -T +%{?scl:scl enable %{scl} - << \EOF} +set -e +%gem_install -n %{SOURCE0} +pushd .%{gem_instdir} +%patch3 -p2 +%patch5 -p2 +%patch6 -p2 +%patch8 -p2 +popd +%{?scl:EOF} + +%build + +%install +mkdir -p %{buildroot}%{gem_dir} +cp -a .%{gem_dir}/* \ + %{buildroot}%{gem_dir}/ + +%check +pushd .%{gem_instdir} +# Move the tests into place +tar xzvf %{SOURCE1} + +cat %{PATCH1} | patch -p2 +cat %{PATCH2} | patch -p2 +patch -p2 < %{PATCH4} +cat %{PATCH7} | patch -p2 +cat %{PATCH9} | patch -p2 +cat %{PATCH10} | patch -p2 +cat %{PATCH11} | patch -p2 +cat %{PATCH12} | patch -p2 + +# These tests are really unstable, but they seems to be passing upstream :/ +for f in test/evented_file_update_checker_test.rb test/file_update_checker_test.rb; do + mv $f{,.disable} +done + +# These seems to be unstable as well ... +# https://github.com/rails/rails/issues/25683 +sed -i '/^class MemoryStoreTest/,/^end/ s/^/#/' test/caching_test.rb +# https://github.com/rails/rails/issues/25682 +sed -i '/def test_iso8601_output_and_reparsing$/,/^ end$/ s/^/#/' test/core_ext/duration_test.rb + +%{?scl:scl enable %{scl} - << \EOF} +ruby -Ilib:test -e 'Dir.glob "./test/**/*_test.rb", &method(:require)' +%{?scl:EOF} +popd + +%files +# There is no %%license macro on RHEL6. +# https://bugzilla.redhat.com/show_bug.cgi?id=1386246 +%{!?_licensedir:%global license %%doc} + +%dir %{gem_instdir} +%license %{gem_instdir}/MIT-LICENSE +%{gem_libdir} +%exclude %{gem_cache} +%{gem_spec} + +%files doc +%doc %{gem_docdir} +%doc %{gem_instdir}/CHANGELOG.md +%doc %{gem_instdir}/README.rdoc + +%changelog +* Tue Feb 14 2017 Jun Aruga - 1:5.0.1-3 +- Fix Fixnum/Bignum deprecated warning for Ruby 2.4.0. + +* Thu Jan 12 2017 Jun Aruga - 1:5.0.1-2 +- Update Requires rubygem-json for SCL rh-ruby24. + +* Thu Jan 12 2017 Jun Aruga - 1:5.0.1-1 +- Update to Active Support 5.0.1. +- Fix warnings: Fixnum and Bignum are deprecated in Ruby trunk +- Fix Ruby 2.4.0 compatibility. + +* Mon Apr 04 2016 Pavel Valena - 1:4.2.6-1 +- Update to 4.2.6 + +* Mon Feb 29 2016 Pavel Valena - 1:4.2.5.1-4 +- Remove unused patch + +* Wed Feb 17 2016 Pavel Valena - 1:4.2.5.1-3 +- Update to 4.2.5.1 + +* Tue Feb 16 2016 Pavel Valena - 1:4.1.5-3 +- Fix offset in patch for CVE-2016-0753 + +* Wed Feb 10 2016 Pavel Valena - 1:4.1.5-2 +- Fix possible input validation circumvention - rhbz#1301973 + - Resolves: CVE-2016-0753 +- Fix Timing attack vulnerability in basic authentication - rhbz#1301933 + - Resolves: CVE-2015-7576 + +* Mon Jan 19 2015 Josef Stribny - 1:4.1.5-1 +- Update to 4.1.5 + +* Fri Jan 31 2014 Vít Ondruch - 1:4.0.2-3 +- Remove unneeded patch. + +* Thu Jan 23 2014 Vít Ondruch - 1:4.0.2-2 +- Fix minitest dependency. + +* Wed Dec 04 2013 Josef Stribny - 1:4.0.2-1 +- Update to ActionSupport 4.0.2 + - Resolves: rhbz#1037985 + +* Thu Nov 21 2013 Josef Stribny - 1:4.0.1-1 +- Update to ActiveSupport 4.0.1 + +* Thu Oct 17 2013 Josef Stribny - 1:4.0.0-2 +- Add missing minitest runtime dep + +* Thu Oct 03 2013 Josef Stribny - 1:4.0.0-1 +- Update to ActiveSupport 4.0.0. + +* Fri Jun 07 2013 Josef Stribny - 1:3.2.13-1 +- Rebuild for https://fedoraproject.org/wiki/Features/Ruby_2.0.0 +- Update to ActiveSupport 3.2.13. + +* Wed Feb 27 2013 Vít Ondruch - 1:3.2.8-4 +- Rebuild to fix documentation vulnerability due to CVE-2013-0256. + +* Thu Jan 10 2013 Bohuslav Kabrda - 1:3.2.8-3 +- Fix for CVE-2013-0156. + +* Thu Oct 04 2012 Bohuslav Kabrda - 1:3.2.8-2 +- Fix name given to %%scl_package. + +* Tue Sep 18 2012 Bohuslav Kabrda - 1:3.2.8-1 +- Update to ActiveSupport 3.2.8. + +* Tue Jul 31 2012 Bohuslav Kabrda - 1:3.2.6-3 +- Remove the cached gem. + +* Wed Jul 25 2012 Bohuslav Kabrda - 1:3.2.6-2 +- Recreated for SCL from Fedora again. + +* Wed Jul 18 2012 Bohuslav Kabrda - 1:3.2.6-1 +- Update to ActiveSupport 3.2.6. +- Removed unneeded BuildRoot tag. +- Tests no longer fail with newer versions of Mocha, remove workaround. + +* Fri Jun 15 2012 Vít Ondruch - 1:3.0.15-1 +- Update to ActiveSupport 3.0.15. + +* Fri Jun 01 2012 Vít Ondruch - 1:3.0.13-1 +- Update to ActiveSupport 3.0.13. + +* Wed Apr 18 2012 Bohuslav Kabrda - 1:3.0.11-5 +- Add the bigdecimal dependency to gemspec. + +* Fri Mar 16 2012 Bohuslav Kabrda - 1:3.0.11-4 +- The CVE patch name now contains the CVE id. + +* Mon Mar 05 2012 Bohuslav Kabrda - 1:3.0.11-3 +- Patch for CVE-2012-1098 + +* Tue Jan 24 2012 Bohuslav Kabrda - 1:3.0.11-1 +- Rebuilt for Ruby 1.9.3. +- Update to ActiveSupport 3.0.11. + +* Mon Aug 22 2011 Vít Ondruch - 1:3.0.10-1 +- Update to ActiveSupport 3.0.10 + +* Fri Jul 01 2011 Vít Ondruch - 1:3.0.9-1 +- Update to ActiveSupport 3.0.9 +- Changed %%define into %%global +- Removed unnecessary %%clean section + +* Thu Jun 16 2011 Mo Morsi - 1:3.0.5-3 +- Reverting accidental change adding a few gem flags + +* Thu Jun 16 2011 Mo Morsi - 1:3.0.5-2 +- Include fix for CVE-2011-2197 + +* Thu Mar 24 2011 Vít Ondruch - 1:3.0.5-1 +- Update to ActiveSupport 3.0.5 +- Remove Rake dependnecy + +* Mon Feb 14 2011 Mohammed Morsi - 1:3.0.3-4 +- fix bad dates in the spec changelog + +* Thu Feb 10 2011 Mohammed Morsi - 1:3.0.3-3 +- include i18n runtime dependency + +* Wed Feb 09 2011 Fedora Release Engineering - 1:3.0.3-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Mon Jan 10 2011 Mohammed Morsi - 1:3.0.3-1 +- update to rails 3 + +* Wed Aug 25 2010 Mohammed Morsi - 1:2.3.8-2 +- bumped version + +* Wed Aug 04 2010 Mohammed Morsi - 1:2.3.8-1 +- Update to 2.3.8 +- Added check section with rubygem-mocha dependency +- Added upsteam Rakefile and test suite to run tests + +* Thu Jan 28 2010 Mamoru Tasaka - 1:2.3.5-1 +- Update to 2.3.5 + +* Wed Oct 7 2009 David Lutterkort - 1:2.3.4-2 +- Bump Epoch to ensure upgrade path from F-11 + +* Mon Sep 7 2009 Mamoru Tasaka - 2.3.4-1 +- Update to 2.3.4 (bug 520843, CVE-2009-3009) + +* Sun Jul 26 2009 Jeroen van Meeuwen - 2.3.3-1 +- New upstream version + +* Mon Mar 16 2009 Jeroen van Meeuwen - 2.3.2-1 +- New upstream version + +* Wed Feb 25 2009 Fedora Release Engineering - 2.2.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Nov 24 2008 Jeroen van Meeuwen - 2.2.2-1 +- New upstream version + +* Tue Sep 16 2008 David Lutterkort - 2.1.1-1 +- New version (fixes CVE-2008-4094) + +* Thu Jul 31 2008 Michael Stahnke - 2.1.0-1 +- New Upstream + +* Mon Apr 07 2008 David Lutterkort - 2.0.2-1 +- New version + +* Mon Dec 10 2007 David Lutterkort - 2.0.1-1 +- New version + +* Wed Nov 28 2007 David Lutterkort - 1.4.4-3 +- Fix buildroot + +* Tue Nov 14 2007 David Lutterkort - 1.4.4-2 +- Install README and CHANGELOG in _docdir + +* Tue Oct 30 2007 David Lutterkort - 1.4.4-1 +- Initial package