backports 3.6.8 → 3.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +13 -5
- data/.gitmodules +4 -1
- data/.travis.yml +4 -1
- data/Gemfile +1 -1
- data/Gemfile.lock +3 -8
- data/README.rdoc +16 -2
- data/Rakefile +60 -20
- data/frozen_old_spec/tags/1.8.6/core/argf/each_line_spec.rb +6 -0
- data/frozen_old_spec/tags/1.8.6/core/argf/each_spec.rb +6 -0
- data/frozen_old_spec/tags/1.8.6/core/argf/lines_spec.rb +6 -0
- data/frozen_old_spec/tags/1.8.6/core/array/collect_spec.rb +7 -0
- data/frozen_old_spec/tags/1.8.6/core/array/rotate_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/array/uniq_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.6/core/complex/to_r_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.6/core/enumerable/each_entry_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/enumerator/next_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/env/to_h_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/file/join_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.6/core/file/lchmod_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/file/new_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/file/open_spec.rb +13 -0
- data/frozen_old_spec/tags/1.8.6/core/file/to_path_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/fixnum/fdiv_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/gc/stress_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/hash/assoc_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/hash/constructor_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.6/core/hash/default_proc_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.6/core/hash/delete_if_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/hash/each_pair_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/hash/eql_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.6/core/hash/hash_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.6/core/hash/keep_if_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/hash/rassoc_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/hash/reject_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/hash/select_spec.rb +8 -0
- data/frozen_old_spec/tags/1.8.6/core/integer/round_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/io/binread_spec.rb +7 -0
- data/frozen_old_spec/tags/1.8.6/core/io/chars_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/io/each_char_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/io/lines_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/io/open_spec.rb +24 -0
- data/frozen_old_spec/tags/1.8.6/core/io/ungetbyte_spec.rb +4 -0
- data/frozen_old_spec/tags/1.8.6/core/io/write_spec.rb +5 -0
- data/frozen_old_spec/tags/1.8.6/core/kernel/__callee___spec.rb +6 -0
- data/frozen_old_spec/tags/1.8.6/core/kernel/__method___spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/kernel/define_singleton_method_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/kernel/public_method_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/kernel/require_relative_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.6/core/math/log2_spec.rb +6 -0
- data/frozen_old_spec/tags/1.8.6/core/math/log_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.6/core/module/class_exec_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/module/module_exec_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/numeric/step_spec.rb +12 -0
- data/frozen_old_spec/tags/1.8.6/core/proc/curry_spec.rb +4 -0
- data/frozen_old_spec/tags/1.8.6/core/range/step_spec.rb +12 -0
- data/frozen_old_spec/tags/1.8.6/core/string/getbyte_spec.rb +6 -0
- data/frozen_old_spec/tags/1.8.6/core/string/partition_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/string/prepend_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/string/rpartition_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/string/setbyte_spec.rb +5 -0
- data/frozen_old_spec/tags/1.8.6/core/string/upto_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/symbol/capitalize_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.6/core/symbol/comparison_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/symbol/downcase_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/symbol/element_reference_spec.rb +4 -0
- data/frozen_old_spec/tags/1.8.6/core/symbol/empty_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/symbol/match_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/symbol/swapcase_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.6/core/symbol/to_proc_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.6/core/symbol/upcase_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.7/core/array/keep_if_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.7/core/array/rotate_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.7/core/array/select_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.7/core/array/uniq_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.7/core/complex/to_r_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.7/core/enumerable/collect_concat_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.7/core/enumerable/flat_map_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.7/core/env/to_h_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.7/core/file/lchmod_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.7/core/file/new_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.7/core/file/open_spec.rb +5 -0
- data/frozen_old_spec/tags/1.8.7/core/file/readlink_spec.rb +6 -0
- data/frozen_old_spec/tags/1.8.7/core/file/to_path_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.7/core/hash/assoc_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.7/core/hash/default_proc_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.7/core/hash/keep_if_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.7/core/hash/rassoc_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.7/core/hash/select_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.7/core/integer/round_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.7/core/io/binread_spec.rb +7 -0
- data/frozen_old_spec/tags/1.8.7/core/io/open_spec.rb +32 -0
- data/frozen_old_spec/tags/1.8.7/core/io/ungetbyte_spec.rb +4 -0
- data/frozen_old_spec/tags/1.8.7/core/io/write_spec.rb +5 -0
- data/frozen_old_spec/tags/1.8.7/core/kernel/__callee___spec.rb +6 -0
- data/frozen_old_spec/tags/1.8.7/core/kernel/define_singleton_method_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.7/core/kernel/public_method_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.7/core/kernel/require_relative_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.7/core/math/log2_spec.rb +6 -0
- data/frozen_old_spec/tags/1.8.7/core/math/log_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.7/core/module/include_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.7/core/proc/curry_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.7/core/proc/yield_spec.rb +4 -0
- data/frozen_old_spec/tags/1.8.7/core/range/size_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.7/core/string/getbyte_spec.rb +5 -0
- data/frozen_old_spec/tags/1.8.7/core/string/prepend_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.7/core/string/setbyte_spec.rb +5 -0
- data/frozen_old_spec/tags/1.8.7/core/symbol/capitalize_spec.rb +3 -0
- data/frozen_old_spec/tags/1.8.7/core/symbol/comparison_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.7/core/symbol/downcase_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.7/core/symbol/element_reference_spec.rb +4 -0
- data/frozen_old_spec/tags/1.8.7/core/symbol/empty_spec.rb +1 -0
- data/frozen_old_spec/tags/1.8.7/core/symbol/match_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.7/core/symbol/swapcase_spec.rb +2 -0
- data/frozen_old_spec/tags/1.8.7/core/symbol/upcase_spec.rb +1 -0
- data/frozen_old_spec/tags/1.9.1/core/array/rotate_spec.rb +1 -0
- data/frozen_old_spec/tags/1.9.1/core/env/to_h_spec.rb +2 -0
- data/frozen_old_spec/tags/1.9.1/core/hash/default_proc_spec.rb +1 -0
- data/frozen_old_spec/tags/1.9.1/core/io/write_spec.rb +2 -0
- data/frozen_old_spec/tags/1.9.2/core/io/write_spec.rb +3 -0
- data/lib/backports/1.8.7/fixnum/div.rb +1 -1
- data/lib/backports/1.8.7/fixnum/fdiv.rb +1 -1
- data/lib/backports/1.9.2/stdlib/matrix.rb +3 -3
- data/lib/backports/2.0.0/range/bsearch.rb +5 -7
- data/lib/backports/2.1.0/bignum/bit_length.rb +1 -1
- data/lib/backports/2.1.0/fixnum/bit_length.rb +1 -1
- data/lib/backports/2.2.0.rb +3 -0
- data/lib/backports/2.2.0/enumerable.rb +3 -0
- data/lib/backports/2.2.0/enumerable/slice_after.rb +25 -0
- data/lib/backports/2.2.0/enumerable/slice_when.rb +27 -0
- data/lib/backports/2.2.0/float.rb +3 -0
- data/lib/backports/2.2.0/float/next_float.rb +11 -0
- data/lib/backports/2.2.0/float/prev_float.rb +11 -0
- data/lib/backports/2.2.rb +2 -0
- data/lib/backports/2.3.0.rb +3 -0
- data/lib/backports/2.3.0/.git_keep +0 -0
- data/lib/backports/2.3.rb +2 -0
- data/lib/backports/2.4.0.rb +3 -0
- data/lib/backports/2.4.0/comparable.rb +3 -0
- data/lib/backports/2.4.0/comparable/clamp.rb +20 -0
- data/lib/backports/2.4.rb +2 -0
- data/lib/backports/tools/extreme_object.rb +2 -2
- data/lib/backports/tools/float_integer_conversion.rb +17 -0
- data/lib/backports/version.rb +1 -1
- data/set_version/2.2.0.rb +1 -0
- data/set_version/2.3.0.rb +1 -0
- data/set_version/2.4.0.rb +1 -0
- metadata +141 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
|
|
2
|
+
!binary "U0hBMQ==":
|
|
3
|
+
metadata.gz: !binary |-
|
|
4
|
+
ZTAxODgxMGVjYjhjMWY4YThjZDA0OWU2MjMxZGJkNzA2Y2QyNzM3ZA==
|
|
5
|
+
data.tar.gz: !binary |-
|
|
6
|
+
OWJhNGEwNDRiZDhlYjlkOWMyZDg0Yzc2ZTI3YTk3Y2Y3Y2IzYmViYQ==
|
|
5
7
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
|
|
8
|
+
metadata.gz: !binary |-
|
|
9
|
+
OWJlMTk0N2FjY2RmN2RlYzFkZWY5ZTZlYjQxNjMxNmQ1NzBkMzkwMTgwYzk3
|
|
10
|
+
MWYyYzMwMTM4M2VhMmZiM2M2MzY3YTEzMmM5M2M0ODNjMzFiMzk4NThmMzU1
|
|
11
|
+
ZDVkNGQwN2QzZWY0ZjFhZDM4NDAzMWIyMjk3NWRhMzU1Y2I0YTM=
|
|
12
|
+
data.tar.gz: !binary |-
|
|
13
|
+
ODMwZGRiZmY0NTU1MjI3ZDM1Zjc4NmU5YTlhOWE0NTM1NjQzNWFjN2RjMDJh
|
|
14
|
+
ODRkMjMzNjM3MjU4OWJlNDhmOTMwZjI0MmQ2Mjg2Njk0ZWM0ODI3MjE2ZGY0
|
|
15
|
+
ZWZiMWI1MTM5ODNiN2UyNTNkMzFhYjg3NTZiNmI0OWFhNjM3YzI=
|
data/.gitmodules
CHANGED
data/.travis.yml
CHANGED
|
@@ -3,9 +3,11 @@ language: ruby
|
|
|
3
3
|
rvm:
|
|
4
4
|
- "1.8.7"
|
|
5
5
|
- "1.9.2"
|
|
6
|
-
- "1.9.3"
|
|
7
6
|
- "2.0.0"
|
|
8
7
|
- "2.1.0"
|
|
8
|
+
- "2.2.0"
|
|
9
|
+
- "2.3.0"
|
|
10
|
+
- "2.4.0"
|
|
9
11
|
- ruby-head
|
|
10
12
|
- jruby-18mode
|
|
11
13
|
- jruby-19mode
|
|
@@ -14,6 +16,7 @@ rvm:
|
|
|
14
16
|
|
|
15
17
|
matrix:
|
|
16
18
|
allow_failures:
|
|
19
|
+
- rvm: "1.9.3"
|
|
17
20
|
- rvm: jruby-18mode
|
|
18
21
|
- rvm: jruby-19mode
|
|
19
22
|
- rvm: rbx-18mode
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
GIT
|
|
2
|
-
remote: git://github.com/rubyspec/mspec.git
|
|
3
|
-
revision: 69c388b1187789f4996eda7dec4c1404fcd6b742
|
|
4
|
-
specs:
|
|
5
|
-
mspec (1.5.18)
|
|
6
|
-
|
|
7
1
|
PATH
|
|
8
2
|
remote: .
|
|
9
3
|
specs:
|
|
10
|
-
backports (3.
|
|
4
|
+
backports (3.7.0)
|
|
11
5
|
|
|
12
6
|
GEM
|
|
13
7
|
remote: http://rubygems.org/
|
|
@@ -17,6 +11,7 @@ GEM
|
|
|
17
11
|
multi_json (~> 1.0)
|
|
18
12
|
i18n (0.6.1)
|
|
19
13
|
minitest (4.7.5)
|
|
14
|
+
mspec (1.9.1)
|
|
20
15
|
multi_json (1.7.2)
|
|
21
16
|
rake (10.1.0)
|
|
22
17
|
test-unit (2.1.1.0)
|
|
@@ -29,6 +24,6 @@ DEPENDENCIES
|
|
|
29
24
|
activesupport
|
|
30
25
|
backports!
|
|
31
26
|
minitest (< 5.0.0)
|
|
32
|
-
mspec
|
|
27
|
+
mspec
|
|
33
28
|
rake
|
|
34
29
|
test-unit
|
data/README.rdoc
CHANGED
|
@@ -65,10 +65,24 @@ With bundler, add to your Gemfile:
|
|
|
65
65
|
|
|
66
66
|
Run <tt>bundle install</tt> and require the desired backports.
|
|
67
67
|
|
|
68
|
-
Compatible with Ruby 1.8.6
|
|
68
|
+
Compatible with Ruby 1.8.6-2.4, JRuby and Rubinius.
|
|
69
69
|
|
|
70
70
|
= Complete List of backports
|
|
71
71
|
|
|
72
|
+
== Ruby 2.4 backports
|
|
73
|
+
|
|
74
|
+
* Comparable
|
|
75
|
+
* +clamp+
|
|
76
|
+
|
|
77
|
+
== Ruby 2.2 backports
|
|
78
|
+
|
|
79
|
+
* Enumerable
|
|
80
|
+
* +slice_after+
|
|
81
|
+
* +slice_when+
|
|
82
|
+
* Float
|
|
83
|
+
* +prev_float+
|
|
84
|
+
* +next_float+
|
|
85
|
+
|
|
72
86
|
== Ruby 2.1 backports
|
|
73
87
|
|
|
74
88
|
* Array
|
|
@@ -142,7 +156,7 @@ Compatible with Ruby 1.8.6, 1.8.7, 1.9.1, 1.9.2, 1.9.3, 2.0, 2.1, JRuby and Rubi
|
|
|
142
156
|
|
|
143
157
|
* Random (new class)
|
|
144
158
|
|
|
145
|
-
*Note*: The methods of +Random+ can't be required individually; the class can only be required whole with <tt>require 'backports/1.9.2/random'</tt>.
|
|
159
|
+
*Note*: The methods of +Random+ can't be required individually; the class can only be required whole with <tt>require 'backports/1.9.2/random'</tt>.
|
|
146
160
|
|
|
147
161
|
== Ruby 1.9.1 backports
|
|
148
162
|
|
data/Rakefile
CHANGED
|
@@ -11,23 +11,28 @@ Rake::TestTask.new(:test) do |test|
|
|
|
11
11
|
test.verbose = false
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
class SpecRunner
|
|
15
|
+
STATS = [:files, :examples, :expectations, :failures, :errors]
|
|
16
|
+
attr_reader :stats, :not_found
|
|
17
|
+
|
|
18
|
+
def initialize
|
|
19
|
+
@counts = [0] * 5
|
|
20
|
+
@not_found = []
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def run(cmd, path)
|
|
20
24
|
result = `#{cmd}`
|
|
21
25
|
match = result.match(/(\d+) files?, (\d+) examples?, (\d+) expectations?, (\d+) failures?, (\d+) errors?/)
|
|
22
26
|
if match.nil?
|
|
23
27
|
puts "*** mspec returned with unexpected results:"
|
|
24
28
|
puts result
|
|
25
29
|
puts "Command was:", cmd
|
|
26
|
-
fail "Unexpected output from mspec"
|
|
27
30
|
end
|
|
28
31
|
_, ex, p, f, e = data = match.captures.map{|x| x.to_i}
|
|
29
32
|
not_found << path if ex == 0
|
|
30
|
-
|
|
33
|
+
STATS.each_with_index do |_, i|
|
|
34
|
+
@counts[i] += data[i]
|
|
35
|
+
end
|
|
31
36
|
if f + e > 0
|
|
32
37
|
puts cmd
|
|
33
38
|
puts result
|
|
@@ -36,12 +41,35 @@ task :spec, :path, :action do |t, args|
|
|
|
36
41
|
STDOUT.flush
|
|
37
42
|
end
|
|
38
43
|
end
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
|
|
45
|
+
def stats
|
|
46
|
+
h = {}
|
|
47
|
+
STATS.zip(@counts).each{|k, v| h[k]=v}
|
|
48
|
+
h
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def report
|
|
52
|
+
puts "*** Overall:", stats.map{|a| a.join(' ')}.join(', ')
|
|
53
|
+
puts "No spec found for #{@not_found.join(', ')}" unless @not_found.empty?
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def success?
|
|
57
|
+
stats[:failures] == 0 && stats[:errors] == 0
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
desc "Run specs, where path can be '*/*' (default), 'class/*' or 'class/method'."
|
|
62
|
+
task :spec, :path, :action do |t, args|
|
|
63
|
+
args.with_defaults(:path => '*/*', :action => 'ci')
|
|
64
|
+
specs = SpecRunner.new
|
|
65
|
+
mspec_cmds(args[:path], 'frozen_old_spec', args[:action]) do |cmd, path|
|
|
66
|
+
specs.run(cmd, path)
|
|
67
|
+
end
|
|
68
|
+
mspec_cmds(args[:path], 'spec', args[:action]) do |cmd, path|
|
|
69
|
+
specs.run(cmd, path)
|
|
70
|
+
end
|
|
71
|
+
specs.report
|
|
72
|
+
fail unless specs.success?
|
|
45
73
|
end
|
|
46
74
|
|
|
47
75
|
task :all_spec do # Necessary because of argument passing bug in 1.8.7
|
|
@@ -67,7 +95,9 @@ DEPENDENCIES = Hash.new([]).merge!(
|
|
|
67
95
|
'1.9.2/array/select' => 'backports/1.8.7/array/select',
|
|
68
96
|
'1.9.2/hash/select' => 'backports/1.8.7/hash/select',
|
|
69
97
|
'1.9.2/enumerable/each_entry' => 'backports/1.8.7/enumerable/each_with_index',
|
|
70
|
-
'2.0.0/hash/to_h' => 'backports/1.9.1/hash/default_proc'
|
|
98
|
+
'2.0.0/hash/to_h' => 'backports/1.9.1/hash/default_proc',
|
|
99
|
+
'2.2.0/float/next_float' => 'backports/2.2.0/float/prev_float',
|
|
100
|
+
'2.2.0/float/prev_float' => 'backports/2.2.0/float/next_float'
|
|
71
101
|
)
|
|
72
102
|
{
|
|
73
103
|
:each_with_index => %w[enumerable/detect enumerable/find enumerable/find_all enumerable/select enumerable/to_a],
|
|
@@ -76,22 +106,32 @@ DEPENDENCIES = Hash.new([]).merge!(
|
|
|
76
106
|
libs.each{|l| DEPENDENCIES["1.8.7/#{l}"] = "backports/1.8.7/enumerable/#{req}" }
|
|
77
107
|
end
|
|
78
108
|
|
|
79
|
-
# These cause actual errors while loading in 1.8:
|
|
80
|
-
|
|
109
|
+
# These **old** specs cause actual errors while loading in 1.8:
|
|
110
|
+
OLD_IGNORE_IN_18 = %w[
|
|
81
111
|
1.9.1/symbol/length
|
|
82
112
|
1.9.1/symbol/size
|
|
83
113
|
1.9.3/string/byteslice
|
|
84
114
|
1.8.7/proc/yield
|
|
85
115
|
1.9.1/proc/case_compare
|
|
86
116
|
]
|
|
87
|
-
|
|
117
|
+
# These **new** specs cause actual errors while loading in 1.8:
|
|
118
|
+
IGNORE_IN_18 = %w[
|
|
119
|
+
2.1.0/enumerable/to_h
|
|
120
|
+
2.1.0/array/to_h
|
|
121
|
+
2.1.0/module/include
|
|
122
|
+
]
|
|
123
|
+
def mspec_cmds(pattern, spec_folder, action='ci')
|
|
88
124
|
pattern = "lib/backports/*.*.*/#{pattern}.rb"
|
|
89
125
|
Dir.glob(pattern) do |lib_path|
|
|
90
126
|
_match, version, path = lib_path.match(/backports\/(\d\.\d\.\d)\/(.*)\.rb/).to_a
|
|
91
127
|
next if path =~ /stdlib/
|
|
92
128
|
next if version <= RUBY_VERSION
|
|
93
129
|
version_path = "#{version}/#{path}"
|
|
94
|
-
|
|
130
|
+
if RUBY_VERSION <= '2.0.0'
|
|
131
|
+
next if OLD_IGNORE_IN_18.include? version_path if RUBY_VERSION < '1.9'
|
|
132
|
+
next if IGNORE_IN_18.include? version_path
|
|
133
|
+
next if spec_folder != 'frozen_old_spec' && version <= '2.0.0' # Don't run new specs for pre 2.0 features & ruby
|
|
134
|
+
end
|
|
95
135
|
deps = [*DEPENDENCIES[version_path]].map{|p| "-r #{p}"}.join(' ')
|
|
96
136
|
klass, method = path.split('/')
|
|
97
137
|
path = [klass.gsub('_', ''), method].join('/') # don't ask me why RubySpec uses matchdata instead of match_data
|
|
@@ -100,7 +140,7 @@ def mspec_cmds(pattern, action='ci')
|
|
|
100
140
|
-r ./set_version/#{version}
|
|
101
141
|
#{deps}
|
|
102
142
|
-r backports/#{version_path}
|
|
103
|
-
|
|
143
|
+
#{spec_folder}/rubyspec/core/#{path}_spec.rb
|
|
104
144
|
].join(' '), path
|
|
105
145
|
end
|
|
106
146
|
end
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
fails:ARGF.each_line is a public method
|
|
2
|
+
fails:ARGF.each_line requires multiple arguments
|
|
3
|
+
fails:ARGF.each_line reads each line of files
|
|
4
|
+
fails:ARGF.each_line returns self when passed a block
|
|
5
|
+
fails:ARGF.each_line returns an Enumerator when passed no block
|
|
6
|
+
fails:ARGF.each_line with a separator yields each separated section of all streams
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
fails:ARGF.each is a public method
|
|
2
|
+
fails:ARGF.each requires multiple arguments
|
|
3
|
+
fails:ARGF.each reads each line of files
|
|
4
|
+
fails:ARGF.each returns self when passed a block
|
|
5
|
+
fails:ARGF.each returns an Enumerator when passed no block
|
|
6
|
+
fails:ARGF.each with a separator yields each separated section of all streams
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
fails:ARGF.lines is a public method
|
|
2
|
+
fails:ARGF.lines requires multiple arguments
|
|
3
|
+
fails:ARGF.lines reads each line of files
|
|
4
|
+
fails:ARGF.lines returns self when passed a block
|
|
5
|
+
fails:ARGF.lines returns an Enumerator when passed no block
|
|
6
|
+
fails:ARGF.lines with a separator yields each separated section of all streams
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
fails:Array#collect returns an Enumerator when no block given
|
|
2
|
+
fails:Array#collect does not copy untrusted status
|
|
3
|
+
fails:Array#collect! keeps untrusted status
|
|
4
|
+
fails:Array#collect! when frozen raises a RuntimeError
|
|
5
|
+
fails:Array#collect! when frozen raises a RuntimeError when empty
|
|
6
|
+
fails:Array#collect! when frozen raises a RuntimeError when calling #each on the returned Enumerator
|
|
7
|
+
fails:Array#collect! when frozen raises a RuntimeError when calling #each on the returned Enumerator when empty
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
fails:Complex#to_r when the imaginary part is Fixnum 0 returns the result of sending #to_r to the real part
|
|
2
|
+
fails:Complex#to_r when the imaginary part is Rational 0 returns the result of sending #to_r to the real part
|
|
3
|
+
fails:Complex#to_r when the imaginary part responds to #== 0 with true returns the result of sending #to_r to the real part
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fails:Enumerable#each_entry passes through the values yielded by #each_with_index
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fails:Enumerator#next is rewound after encountering a StopIteration
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
fails:File.open on a FIFO opens it as a normal file
|
|
2
|
+
fails:File.open opens file when call with a block (basic case)
|
|
3
|
+
fails:File.open opens a file with mode string and block
|
|
4
|
+
fails:File.open opens a file with mode num and block
|
|
5
|
+
fails:File.open opens the file when passed mode, num, permissions and block
|
|
6
|
+
fails:File.open opens the file when call with fd
|
|
7
|
+
fails:File.open opens a file with a file descriptor d and a block
|
|
8
|
+
fails:File.open raises a SystemCallError if passed an invalid Integer type
|
|
9
|
+
fails:File.open raises an IOError when read in a block opened with File::RDONLY|File::APPEND mode
|
|
10
|
+
fails:File.open raises an IOError if the file exists when open with File::RDONLY|File::APPEND
|
|
11
|
+
fails:File.open defaults external_encoding to ASCII-8BIT for binary modes
|
|
12
|
+
fails:File.open when passed a file descriptor opens a file
|
|
13
|
+
fails:File.open when passed a file descriptor opens a file when passed a block
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fails:File#to_path preserves the encoding of the path
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fails:Fixnum#fdiv follows the coercion protocol
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fails:Hash#assoc only returns the first matching key-value pair for identity hashes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fails:Hash#delete_if raises a RuntimeError if called on a frozen instance
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fails:Hash#each_pair yields a [[key, value]] Array for each pair to a block expecting |*args|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fails:Hash#rassoc only returns the first matching key-value pair
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
fails:Hash#select returns a Hash of entries for which block is true
|
|
2
|
+
fails:Hash#select! is equivalent to keep_if if changes are made
|
|
3
|
+
fails:Hash#select! returns nil if no changes were made
|
|
4
|
+
fails:Hash#select! raises a RuntimeError if called on an empty frozen instance
|
|
5
|
+
fails:Hash#select! raises a RuntimeError if called on a frozen instance that would not be modified
|
|
6
|
+
fails:Hash#select! returns an Enumerator if called on a non-empty hash without a block
|
|
7
|
+
fails:Hash#select! returns an Enumerator if called on an empty hash without a block
|
|
8
|
+
fails:Hash#select! returns an Enumerator if called on a frozen instance
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
fails:IO.binread reads the contents of a file
|
|
2
|
+
fails:IO.binread reads the contents of a file up to a certain size when specified
|
|
3
|
+
fails:IO.binread reads the contents of a file from an offset of a specific size when specified
|
|
4
|
+
fails:IO.binread returns a String in ASCII-8BIT encoding
|
|
5
|
+
fails:IO.binread returns a String in ASCII-8BIT encoding regardless of Encoding.default_internal
|
|
6
|
+
fails:IO.binread raises an ArgumentError when not passed a valid length
|
|
7
|
+
fails:IO.binread raises an Errno::EINVAL when not passed a valid offset
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fails:IO#chars yields each character
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fails:IO#each_char yields each character
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
fails:IO#lines ignores a given block
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
fails:IO.open uses the external encoding specified in the mode argument
|
|
2
|
+
fails:IO.open uses the external and the internal encoding specified in the mode argument
|
|
3
|
+
fails:IO.open uses the external encoding specified via the :external_encoding option
|
|
4
|
+
fails:IO.open uses the internal encoding specified via the :internal_encoding option
|
|
5
|
+
fails:IO.open uses the colon-separated encodings specified via the :encoding option
|
|
6
|
+
fails:IO.open ingores the :encoding option when the :external_encoding option is present
|
|
7
|
+
fails:IO.open ingores the :encoding option when the :internal_encoding option is present
|
|
8
|
+
fails:IO.open uses the encoding specified via the :mode option hash
|
|
9
|
+
fails:IO.open ignores the :internal_encoding option when the same as the external encoding
|
|
10
|
+
fails:IO.open sets internal encoding to nil when passed '-'
|
|
11
|
+
fails:IO.open sets binmode from mode string
|
|
12
|
+
fails:IO.open does not set binmode without being asked
|
|
13
|
+
fails:IO.open sets binmode from :binmode option
|
|
14
|
+
fails:IO.open does not set binmode from false :binmode
|
|
15
|
+
fails:IO.open raises an error if passed binary/text mode two ways
|
|
16
|
+
fails:IO.open sets external encoding to binary with binmode in mode string
|
|
17
|
+
fails:IO.open sets external encoding to binary with :binmode option
|
|
18
|
+
fails:IO.open does not use binary encoding when mode encoding is specified
|
|
19
|
+
fails:IO.open does not use binary encoding when :encoding option is specified
|
|
20
|
+
fails:IO.open does not use binary encoding when :external_encoding option is specified
|
|
21
|
+
fails:IO.open does not use binary encoding when :internal_encoding option is specified
|
|
22
|
+
fails:IO.open coerces mode with #to_int
|
|
23
|
+
fails:IO.open coerces options as second argument with #to_hash
|
|
24
|
+
fails:IO.open raises ArgumentError if not passed a hash or nil for options
|