backports 1.17.0 → 1.17.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/backports.gemspec +2 -4
- data/lib/backports/1.9.2/array.rb +2 -2
- metadata +3 -5
- data/test/random_marshal_test.rb +0 -33
data/VERSION.yml
CHANGED
data/backports.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{backports}
|
8
|
-
s.version = "1.17.
|
8
|
+
s.version = "1.17.1"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Marc-Andr\303\251 Lafortune"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-06-07}
|
13
13
|
s.description = %q{ Essential backports that enable some of the really nice features of ruby 1.8.7, ruby 1.9 and rails from ruby 1.8.6 and earlier.
|
14
14
|
}
|
15
15
|
s.email = %q{github@marc-andre.ca}
|
@@ -108,7 +108,6 @@ Gem::Specification.new do |s|
|
|
108
108
|
"test/method_test.rb",
|
109
109
|
"test/module_test.rb",
|
110
110
|
"test/object_test.rb",
|
111
|
-
"test/random_marshal_test.rb",
|
112
111
|
"test/regexp_test.rb",
|
113
112
|
"test/string_test.rb",
|
114
113
|
"test/symbol_test.rb",
|
@@ -132,7 +131,6 @@ Gem::Specification.new do |s|
|
|
132
131
|
"test/method_test.rb",
|
133
132
|
"test/module_test.rb",
|
134
133
|
"test/object_test.rb",
|
135
|
-
"test/random_marshal_test.rb",
|
136
134
|
"test/regexp_test.rb",
|
137
135
|
"test/string_test.rb",
|
138
136
|
"test/symbol_test.rb",
|
@@ -30,7 +30,7 @@ class Array
|
|
30
30
|
# Note: Combinations are not yielded in the same order as MRI.
|
31
31
|
# This is not a bug; the spec states that the order is implementation dependent
|
32
32
|
def repeated_combination(num, &block)
|
33
|
-
return to_enum
|
33
|
+
return to_enum(:repeated_combination, num) unless block_given?
|
34
34
|
num = Backports.coerce_to_int(num)
|
35
35
|
if num <= 0
|
36
36
|
yield [] if num == 0
|
@@ -48,7 +48,7 @@ class Array
|
|
48
48
|
# Note: Permutations are not yielded in the same order as MRI.
|
49
49
|
# This is not a bug; the spec states that the order is implementation dependent
|
50
50
|
def repeated_permutation(num, &block)
|
51
|
-
return to_enum
|
51
|
+
return to_enum(:repeated_permutation, num) unless block_given?
|
52
52
|
num = Backports.coerce_to_int(num)
|
53
53
|
if num <= 0
|
54
54
|
yield [] if num == 0
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 17
|
8
|
-
-
|
9
|
-
version: 1.17.
|
8
|
+
- 1
|
9
|
+
version: 1.17.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- "Marc-Andr\xC3\xA9 Lafortune"
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-06-07 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -118,7 +118,6 @@ files:
|
|
118
118
|
- test/method_test.rb
|
119
119
|
- test/module_test.rb
|
120
120
|
- test/object_test.rb
|
121
|
-
- test/random_marshal_test.rb
|
122
121
|
- test/regexp_test.rb
|
123
122
|
- test/string_test.rb
|
124
123
|
- test/symbol_test.rb
|
@@ -171,7 +170,6 @@ test_files:
|
|
171
170
|
- test/method_test.rb
|
172
171
|
- test/module_test.rb
|
173
172
|
- test/object_test.rb
|
174
|
-
- test/random_marshal_test.rb
|
175
173
|
- test/regexp_test.rb
|
176
174
|
- test/string_test.rb
|
177
175
|
- test/symbol_test.rb
|
data/test/random_marshal_test.rb
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
# Run independently and with Ruby 1.9
|
2
|
-
|
3
|
-
def get_randomizer
|
4
|
-
r = Random.new(42)
|
5
|
-
1000.times{r.rand}
|
6
|
-
r
|
7
|
-
end
|
8
|
-
|
9
|
-
def get_info(r)
|
10
|
-
Hash[
|
11
|
-
[:state, :left, :seed].map{|info| [info, r.send(info)]}
|
12
|
-
]
|
13
|
-
end
|
14
|
-
|
15
|
-
MRIs = get_randomizer
|
16
|
-
dump = Marshal.dump(MRIs)
|
17
|
-
Object.send :remove_const, :Random # Kill original definition
|
18
|
-
|
19
|
-
require_relative "../lib/backports/1.9.2"
|
20
|
-
|
21
|
-
ours = get_randomizer
|
22
|
-
|
23
|
-
puts "Info ok" if get_info(MRIs) == get_info(ours)
|
24
|
-
if dump == (our_dump = Marshal.dump(get_randomizer))
|
25
|
-
puts "dump identical"
|
26
|
-
else
|
27
|
-
puts "Oups"
|
28
|
-
end
|
29
|
-
if get_info(MRIs) == get_info(Marshal.load(dump))
|
30
|
-
puts "load identical"
|
31
|
-
else
|
32
|
-
puts "Oups"
|
33
|
-
end
|