backports 3.9.0 → 3.9.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e69b091726d256896282d6dac7632b6c831919d
4
- data.tar.gz: 7a5356dbc27c6476079a97ce7921f6009dcb0e8e
3
+ metadata.gz: 7c118b5ba5463c0bdac0657f7684ba3a1d90f27c
4
+ data.tar.gz: 4e957388dd11e62d88ed07fde260281821343cc8
5
5
  SHA512:
6
- metadata.gz: 673d1f14e1162d73f98526b31412320bc85cdcb3d35fc19c8acf6f7e5dcf180e5b1961f340eca9ce56556055cfe713ebf030fbd28bd9640b0a003022b4533dff
7
- data.tar.gz: c5624389e866c2c2806932eaaeb34fd4c4f25b648ab807c81d193c249041fec2b9c044772b3c46d36faa901cc95247fc95f5c9156ca9058533cc8bb184c8ff72
6
+ metadata.gz: 2317868ee805dbf1b649dc3e9c0a41e7978825f2261567213ab823f4b31e29652bbc4b96b641023ce77cdfe9a1d322dbed1540b183917c64f8e972f601956512
7
+ data.tar.gz: 8106c6a77152559e60133020615dc807806e11cf3ae8f5cd3fd305853b8e12b6bbad0937396b68df98f4721e469b3734e665a6e90ae0fbaf537b69e5aee157e4
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- backports (3.9.0)
4
+ backports (3.9.1)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -2,4 +2,4 @@ class NilClass
2
2
  def dup
3
3
  self
4
4
  end
5
- end unless (0.0.dup rescue false)
5
+ end if (nil.dup rescue true)
@@ -2,5 +2,5 @@ class TrueClass
2
2
  def dup
3
3
  self
4
4
  end
5
- end unless (true rescue false)
5
+ end unless (true.dup rescue false)
6
6
 
@@ -1,3 +1,3 @@
1
1
  module Backports
2
- VERSION = "3.9.0" unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
2
+ VERSION = "3.9.1" unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
3
3
  end
@@ -41,16 +41,19 @@ class AAA_TestBackportGuards < Test::Unit::TestCase
41
41
  h
42
42
  end
43
43
 
44
+ # This returns all user defined methods on klass.
45
+ # For Ruby 1.8.7 or below, it returns all methods, so we can at least check we are not adding new methods needlessly
44
46
  def class_signature(klass)
45
- to_hash(
47
+ list =
46
48
  (klass.instance_methods - EXCLUDE).map{|m| [m, klass.instance_method(m)] } +
47
49
  (klass.methods - EXCLUDE).map{|m| [".#{m}", klass.method(m) ]}
48
- )
50
+ list.select!{|name, method| method.source_location } if UnboundMethod.method_defined? :source_location
51
+ to_hash(list)
49
52
  end
50
53
 
51
- CLASSES = [Array, Binding, Dir, Enumerable, Fixnum, Float, GC,
52
- Hash, Integer, IO, Kernel, Math, MatchData, Method, Module, Numeric,
53
- ObjectSpace, Proc, Process, Range, Regexp, String, Struct, Symbol] +
54
+ CLASSES = [Array, Binding, Bignum, Dir, Comparable, Enumerable, FalseClass, Fixnum, Float, GC,
55
+ Hash, Integer, IO, Kernel, Math, MatchData, Method, Module, NilClass, Numeric,
56
+ ObjectSpace, Proc, Process, Range, Regexp, String, Struct, Symbol, TrueClass] +
54
57
  [ENV, ARGF].map{|obj| class << obj; self; end }
55
58
 
56
59
  case RUBY_VERSION
@@ -89,13 +92,13 @@ class AAA_TestBackportGuards < Test::Unit::TestCase
89
92
  # Order super important!
90
93
  def test__2_backports_wont_override_unnecessarily
91
94
  before = digest
92
- latest = "2.0.0"
93
- unless RUBY_VERSION <= '1.8.6'
95
+ latest = "2.4.0"
96
+ if RUBY_VERSION > '1.8.6'
94
97
  require "backports/#{[RUBY_VERSION, latest].min}"
95
98
  after = digest
96
99
  assert_nil digest_delta(before, after)
97
100
  end
98
- unless RUBY_VERSION >= latest
101
+ if RUBY_VERSION < latest
99
102
  require "backports"
100
103
  after = digest
101
104
  assert !digest_delta(before, after).nil?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: backports
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.9.0
4
+ version: 3.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-André Lafortune
@@ -682,7 +682,6 @@ files:
682
682
  - spec/tags/1.8.6/core/symbol/swapcase_spec.rb
683
683
  - spec/tags/1.8.6/core/symbol/to_proc_spec.rb
684
684
  - spec/tags/1.8.6/core/symbol/upcase_spec.rb
685
- - spec/tags/1.8.6/core/true/dup_spec.rb
686
685
  - spec/tags/1.8.7/core/array/bsearch_index_spec.rb
687
686
  - spec/tags/1.8.7/core/array/keep_if_spec.rb
688
687
  - spec/tags/1.8.7/core/array/rotate_spec.rb
@@ -729,32 +728,24 @@ files:
729
728
  - spec/tags/1.8.7/core/symbol/match_spec.rb
730
729
  - spec/tags/1.8.7/core/symbol/swapcase_spec.rb
731
730
  - spec/tags/1.8.7/core/symbol/upcase_spec.rb
732
- - spec/tags/1.8.7/core/true/dup_spec.rb
733
731
  - spec/tags/1.9.1/core/array/bsearch_index_spec.rb
734
732
  - spec/tags/1.9.1/core/array/rotate_spec.rb
735
733
  - spec/tags/1.9.1/core/env/to_h_spec.rb
736
734
  - spec/tags/1.9.1/core/hash/default_proc_spec.rb
737
735
  - spec/tags/1.9.1/core/io/write_spec.rb
738
736
  - spec/tags/1.9.1/core/string/uplus_spec.rb
739
- - spec/tags/1.9.1/core/true/dup_spec.rb
740
737
  - spec/tags/1.9.2/core/array/bsearch_index_spec.rb
741
738
  - spec/tags/1.9.2/core/io/write_spec.rb
742
739
  - spec/tags/1.9.2/core/method/curry_spec.rb
743
740
  - spec/tags/1.9.2/core/string/uplus_spec.rb
744
- - spec/tags/1.9.2/core/true/dup_spec.rb
745
741
  - spec/tags/1.9.3/core/array/bsearch_index_spec.rb
746
742
  - spec/tags/1.9.3/core/io/write_spec.rb
747
743
  - spec/tags/1.9.3/core/method/curry_spec.rb
748
744
  - spec/tags/1.9.3/core/string/uplus_spec.rb
749
- - spec/tags/1.9.3/core/true/dup_spec.rb
750
745
  - spec/tags/2.0.0/core/string/uplus_spec.rb
751
- - spec/tags/2.0.0/core/true/dup_spec.rb
752
746
  - spec/tags/2.1.0/core/string/uplus_spec.rb
753
- - spec/tags/2.1.0/core/true/dup_spec.rb
754
747
  - spec/tags/2.2.0/core/string/uplus_spec.rb
755
- - spec/tags/2.2.0/core/true/dup_spec.rb
756
748
  - spec/tags/2.3.0/core/string/uplus_spec.rb
757
- - spec/tags/2.3.0/core/true/dup_spec.rb
758
749
  - test/README
759
750
  - test/_backport_guards_test.rb
760
751
  - test/bit_length_test.rb
@@ -851,7 +842,6 @@ test_files:
851
842
  - spec/tags/1.8.6/core/symbol/swapcase_spec.rb
852
843
  - spec/tags/1.8.6/core/symbol/to_proc_spec.rb
853
844
  - spec/tags/1.8.6/core/symbol/upcase_spec.rb
854
- - spec/tags/1.8.6/core/true/dup_spec.rb
855
845
  - spec/tags/1.8.7/core/array/bsearch_index_spec.rb
856
846
  - spec/tags/1.8.7/core/array/keep_if_spec.rb
857
847
  - spec/tags/1.8.7/core/array/rotate_spec.rb
@@ -898,32 +888,24 @@ test_files:
898
888
  - spec/tags/1.8.7/core/symbol/match_spec.rb
899
889
  - spec/tags/1.8.7/core/symbol/swapcase_spec.rb
900
890
  - spec/tags/1.8.7/core/symbol/upcase_spec.rb
901
- - spec/tags/1.8.7/core/true/dup_spec.rb
902
891
  - spec/tags/1.9.1/core/array/bsearch_index_spec.rb
903
892
  - spec/tags/1.9.1/core/array/rotate_spec.rb
904
893
  - spec/tags/1.9.1/core/env/to_h_spec.rb
905
894
  - spec/tags/1.9.1/core/hash/default_proc_spec.rb
906
895
  - spec/tags/1.9.1/core/io/write_spec.rb
907
896
  - spec/tags/1.9.1/core/string/uplus_spec.rb
908
- - spec/tags/1.9.1/core/true/dup_spec.rb
909
897
  - spec/tags/1.9.2/core/array/bsearch_index_spec.rb
910
898
  - spec/tags/1.9.2/core/io/write_spec.rb
911
899
  - spec/tags/1.9.2/core/method/curry_spec.rb
912
900
  - spec/tags/1.9.2/core/string/uplus_spec.rb
913
- - spec/tags/1.9.2/core/true/dup_spec.rb
914
901
  - spec/tags/1.9.3/core/array/bsearch_index_spec.rb
915
902
  - spec/tags/1.9.3/core/io/write_spec.rb
916
903
  - spec/tags/1.9.3/core/method/curry_spec.rb
917
904
  - spec/tags/1.9.3/core/string/uplus_spec.rb
918
- - spec/tags/1.9.3/core/true/dup_spec.rb
919
905
  - spec/tags/2.0.0/core/string/uplus_spec.rb
920
- - spec/tags/2.0.0/core/true/dup_spec.rb
921
906
  - spec/tags/2.1.0/core/string/uplus_spec.rb
922
- - spec/tags/2.1.0/core/true/dup_spec.rb
923
907
  - spec/tags/2.2.0/core/string/uplus_spec.rb
924
- - spec/tags/2.2.0/core/true/dup_spec.rb
925
908
  - spec/tags/2.3.0/core/string/uplus_spec.rb
926
- - spec/tags/2.3.0/core/true/dup_spec.rb
927
909
  - test/README
928
910
  - test/_backport_guards_test.rb
929
911
  - test/bit_length_test.rb
@@ -1 +0,0 @@
1
- fails:TrueClass#dup returns self
@@ -1 +0,0 @@
1
- fails:TrueClass#dup returns self
@@ -1 +0,0 @@
1
- fails:TrueClass#dup returns self
@@ -1 +0,0 @@
1
- fails:TrueClass#dup returns self
@@ -1 +0,0 @@
1
- fails:TrueClass#dup returns self
@@ -1 +0,0 @@
1
- fails:TrueClass#dup returns self
@@ -1 +0,0 @@
1
- fails:TrueClass#dup returns self
@@ -1 +0,0 @@
1
- fails:TrueClass#dup returns self
@@ -1 +0,0 @@
1
- fails:TrueClass#dup returns self