8000 Merge pull request #114 from github/upgrade-ruby-2-7 · github/ruby@9720435 · GitHub
[go: up one dir, main page]

Skip to content

Commit 9720435

Browse files
authored
Merge pull request #114 from github/upgrade-ruby-2-7
Upgrade Ruby 2.7
2 parents c40a542 + 82d3cb9 commit 9720435

File tree

5 files changed

+39
-30
lines changed

5 files changed

+39
-30
lines changed

proc.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,10 +2230,22 @@ method_clone(VALUE self)
22302230
*/
22312231

22322232

2233+
/* Document-method: Method#[]
2234+
*
2235+
* call-seq:
2236+
* meth[args, ...] -> obj
2237+
*
2238+
* Invokes the <i>meth</i> with the specified arguments, returning the
2239+
* method's return value, like #call.
2240+
*
2241+
* m = 12.method("+")
2242+
* m[3] #=> 15
2243+
* m[20] #=> 32
2244+
*/
2245+
22332246
/*
22342247
* call-seq:
22352248
* meth.call(args, ...) -> obj
2236-
* meth[args, ...] -> obj
22372249
*
22382250
* Invokes the <i>meth</i> with the specified arguments, returning the
22392251
* method's return value.
@@ -3479,8 +3491,8 @@ rb_method_compose_to_left(VALUE self, VALUE g)
34793491
* meth >> g -> a_proc
34803492
*
34813493
* Returns a proc that is the composition of this method and the given <i>g</i>.
3482-
* The returned proc takes a variable number of arguments, calls <i>g</i> with them
3483-
* then calls this method with the result.
3494+
* The returned proc takes a variable number of arguments, calls this method
3495+
* with them then calls <i>g</i> with the result.
34843496
*
34853497
* def f(x)
34863498
* x * x

test/psych/test_nil.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ module Psych
55
class TestNil < TestCase
66
def test_nil
77
yml = Psych.dump nil
8-
assert_match(/--- \n(?:\.\.\.\n)?/, yml)
8+
assert_match(/---[ ]?\n(?:\.\.\.\n)?/, yml)
99
assert_nil Psych.load(yml)
1010
end
1111

1212
def test_array_nil
1313
yml = Psych.dump [nil]
14-
assert_equal "---\n- \n", yml
14+
assert_match(/---\n-[ ]?\n/, yml)
1515
assert_equal [nil], Psych.load(yml)
1616
end
1717

test/psych/test_psych.rb

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,17 @@ def test_add_builtin_type
178178

179179
def test_domain_types
180180
got = nil
181-
Psych.add_domain_type 'foo.bar,2002', 'foo' do |type, val|
181+
Psych.add_domain_type 'foo.bar/2002', 'foo' do |type, val|
182182
got = val
183183
end
184184

185-
Psych.load('--- !foo.bar,2002/foo hello')
185+
Psych.load('--- !foo.bar/2002:foo hello')
186186
assert_equal 'hello', got
187187

188-
Psych.load("--- !foo.bar,2002/foo\n- hello\n- world")
188+
Psych.load("--- !foo.bar/2002:foo\n- hello\n- world")
189189
assert_equal %w{ hello world }, got
190190

191-
Psych.load("--- !foo.bar,2002/foo\nhello: world")
191+
Psych.load("--- !foo.bar/2002:foo\nhello: world")
192192
assert_equal({ 'hello' => 'world' }, got)
193193
end
194194

@@ -295,16 +295,13 @@ def test_callbacks
295295
types = []
296296
appender = lambda { |*args| types << args }
297297

298-
Psych.add_builtin_type('foo', &appender)
299-
Psych.add_domain_type('example.com,2002', 'foo', &appender)
298+
Psych.add_domain_type('example.com:2002', 'foo', &appender)
300299
Psych.load <<-eoyml
301-
- !tag:yaml.org,2002:foo bar
302-
- !tag:example.com,2002:foo bar
300+
- !tag:example.com:2002:foo bar
303301
eoyml
304302

305303
assert_equal [
306-
["tag:yaml.org,2002:foo", "bar"],
307-
["tag:example.com,2002:foo", "bar"]
304+
["tag:example.com:2002:foo", "bar"]
308305
], types
309306
end
310307

test/psych/test_yaml.rb

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -617,11 +617,11 @@ def test_spec_domain_prefix
617617
raise ArgumentError, "Not a Hash in domain.tld,2002/invoice: " + val.inspect
618618
end
619619
}
620-
Psych.add_domain_type( "domain.tld,2002", 'invoice', &customer_proc )
621-
Psych.add_domain_type( "domain.tld,2002", 'customer', &customer_proc )
620+
Psych.add_domain_type( "domain.tld/2002", 'invoice', &customer_proc )
621+
Psych.add_domain_type( "domain.tld/2002", 'customer', &customer_proc )
622622
assert_parse_only( { "invoice"=> { "customers"=> [ { "given"=>"Chris", "type"=>"domain customer", "family"=>"Dumars" } ], "type"=>"domain invoice" } }, <<EOY
623623
# 'http://domain.tld,2002/invoice' is some type family.
624-
invoice: !domain.tld,2002/invoice
624+
invoice: !domain.tld/2002:invoice
625625
# 'seq' is shorthand for 'http://yaml.org/seq'.
626626
# This does not effect '^customer' below
627627
# because it is does not specify a prefix.
@@ -705,7 +705,7 @@ def test_spec_override_anchor
705705
end
706706

707707
def test_spec_explicit_families
708-
Psych.add_domain_type( "somewhere.com,2002", 'type' ) { |type, val|
708+
Psych.add_domain_type( "somewhere.com/2002", 'type' ) { |type, val|
709709
"SOMEWHERE: #{val}"
710710
}
711711
assert_parse_only(
@@ -717,7 +717,7 @@ def test_spec_explicit_families
717717
Pz7Y6OjuDg4J+fn5OTk6enp
718718
56enmleECcgggoBADs=
719719
720-
hmm: !somewhere.com,2002/type |
720+
hmm: !somewhere.com/2002:type |
721721
family above is short for
722722
http://somewhere.com/type
723723
EOY
@@ -726,7 +726,7 @@ def test_spec_explicit_families
726726

727727
def test_spec_application_family
728728
# Testing the clarkevans.com graphs
729-
Psych.add_domain_type( "clarkevans.com,2002", 'graph/shape' ) { |type, val|
729+
Psych.add_domain_type( "clarkevans.com/2002", 'graph/shape' ) { |type, val|
730730
if Array === val
731731
val << "Shape Container"
732732
val
@@ -743,13 +743,13 @@ def test_spec_application_family
743743
raise ArgumentError, "Invalid graph of type #{val.class}: " + val.inspect
744744
end
745745
}
746-
Psych.add_domain_type( "clarkevans.com,2002", 'graph/circle', &one_shape_proc )
747-
Psych.add_domain_type( "clarkevans.com,2002", 'graph/line', &one_shape_proc )
748-
Psych.add_domain_type( "clarkevans.com,2002", 'graph/text', &one_shape_proc )
746+
Psych.add_domain_type( "clarkevans.com/2002", 'graph/circle', &one_shape_proc )
747+
Psych.add_domain_type( "clarkevans.com/2002", 'graph/line', &one_shape_proc )
748+
Psych.add_domain_type( "clarkevans.com/2002", 'graph/text', &one_shape_proc )
749749
# MODIFIED to remove invalid Psych
750750
assert_parse_only(
751751
[[{"radius"=>7, "center"=>{"x"=>73, "y"=>129}, "TYPE"=>"Shape: graph/circle"}, {"finish"=>{"x"=>89, "y"=>102}, "TYPE"=>"Shape: graph/line", "start"=>{"x"=>73, "y"=>129}}, {"TYPE"=>"Shape: graph/text", "value"=>"Pretty vector drawing.", "start"=>{"x"=>73, "y"=>129}, "color"=>16772795}, "Shape Container"]], <<EOY
752-
- !clarkevans.com,2002/graph/shape
752+
- !clarkevans.com/2002:graph/shape
753753
- !/graph/circle
754754
center: &ORIGIN {x: 73, y: 129}
755755
radius: 7
@@ -771,8 +771,8 @@ def test_spec_float_explicit
771771
# have the same type and value.
772772
- 10.0
773773
- !float 10
774-
- !yaml.org,2002/float '10'
775-
- !yaml.org,2002/float "\\
774+
- !yaml.org/2002/float '10'
775+
- !yaml.org/2002/float "\\
776776
1\\
777777
0"
778778
EOY

version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
33
#define RUBY_VERSION_TEENY 1
44
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
5-
#define RUBY_PATCHLEVEL 83
5+
#define RUBY_PATCHLEVEL 85
66

77
#define RUBY_RELEASE_YEAR 2020
8-
#define RUBY_RELEASE_MONTH 3
9-
#define RUBY_RELEASE_DAY 31
8+
#define RUBY_RELEASE_MONTH 6
9+
#define RUBY_RELEASE_DAY 13
1010

1111
#include "ruby/version.h"
1212

0 commit comments

Comments
 (0)
0