Skip to content

Upgrade Ruby 2.7 #114

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 17, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,506 changes: 1,506 additions & 0 deletions .downloaded-cache/config.guess

Large diffs are not rendered by default.

1,793 changes: 1,793 additions & 0 deletions .downloaded-cache/config.sub

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
*.swp
*.yarb
*~
.*-*
.*.list
.*.time
.DS_Store
Expand Down Expand Up @@ -212,10 +211,6 @@ lcov*.info
# /spec/bundler
/.rspec_status

# /tool/
/tool/config.guess
/tool/config.sub

# /win32/
/win32/*.ico

Expand Down
27 changes: 27 additions & 0 deletions Dockerfile.container
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM ubuntu:18.04

RUN apt-get update && apt-get install -y \
build-essential autoconf libtool \
git \
ruby \
pkg-config \
libffi-dev \
libffi6 \
&& apt-get clean

RUN apt-get install -y \
cmake \
gdb \
valgrind

RUN apt-get install -y libssl-dev \
libgdbm5 \
libgdbm-dev \
libedit-dev \
libedit2 \
bison \
hugepages \
leaktracer \
libgdbm-dev

RUN apt-get install -y libjemalloc-dev
7 changes: 7 additions & 0 deletions Dockerfile.ruby
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ruby-test:latest

ADD . .
RUN autoconf
RUN ./configure --disable-install-rdoc --with-jemalloc
RUN make -s -j$(nproc)
RUN make test
18 changes: 15 additions & 3 deletions proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2230,10 +2230,22 @@ method_clone(VALUE self)
*/


/* Document-method: Method#[]
*
* call-seq:
* meth[args, ...] -> obj
*
* Invokes the <i>meth</i> with the specified arguments, returning the
* method's return value, like #call.
*
* m = 12.method("+")
* m[3] #=> 15
* m[20] #=> 32
*/

/*
* call-seq:
* meth.call(args, ...) -> obj
* meth[args, ...] -> obj
*
* Invokes the <i>meth</i> with the specified arguments, returning the
* method's return value.
Expand Down Expand Up @@ -3479,8 +3491,8 @@ rb_method_compose_to_left(VALUE self, VALUE g)
* meth >> g -> a_proc
*
* Returns a proc that is the composition of this method and the given <i>g</i>.
* The returned proc takes a variable number of arguments, calls <i>g</i> with them
* then calls this method with the result.
* The returned proc takes a variable number of arguments, calls this method
* with them then calls <i>g</i> with the result.
*
* def f(x)
* x * x
Expand Down
7 changes: 7 additions & 0 deletions script/cibuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
# Usage: script/cibuild
# CI build script
set -e

docker build -t ruby-test . -f Dockerfile.container
docker build -t ruby-test . -f Dockerfile.ruby --network=none
4 changes: 2 additions & 2 deletions test/psych/test_nil.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ module Psych
class TestNil < TestCase
def test_nil
yml = Psych.dump nil
assert_match(/--- \n(?:\.\.\.\n)?/, yml)
assert_match(/---[ ]?\n(?:\.\.\.\n)?/, yml)
assert_nil Psych.load(yml)
end

def test_array_nil
yml = Psych.dump [nil]
assert_equal "---\n- \n", yml
assert_match(/---\n-[ ]?\n/, yml)
assert_equal [nil], Psych.load(yml)
end

Expand Down
17 changes: 7 additions & 10 deletions test/psych/test_psych.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,17 +178,17 @@ def test_add_builtin_type

def test_domain_types
got = nil
Psych.add_domain_type 'foo.bar,2002', 'foo' do |type, val|
Psych.add_domain_type 'foo.bar/2002', 'foo' do |type, val|
got = val
end

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

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

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

Expand Down Expand Up @@ -295,16 +295,13 @@ def test_callbacks
types = []
appender = lambda { |*args| types << args }

Psych.add_builtin_type('foo', &appender)
Psych.add_domain_type('example.com,2002', 'foo', &appender)
Psych.add_domain_type('example.com:2002', 'foo', &appender)
Psych.load <<-eoyml
- !tag:yaml.org,2002:foo bar
- !tag:example.com,2002:foo bar
- !tag:example.com:2002:foo bar
eoyml

assert_equal [
["tag:yaml.org,2002:foo", "bar"],
["tag:example.com,2002:foo", "bar"]
["tag:example.com:2002:foo", "bar"]
], types
end

Expand Down
24 changes: 12 additions & 12 deletions test/psych/test_yaml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -617,11 +617,11 @@ def test_spec_domain_prefix
raise ArgumentError, "Not a Hash in domain.tld,2002/invoice: " + val.inspect
end
}
Psych.add_domain_type( "domain.tld,2002", 'invoice', &customer_proc )
Psych.add_domain_type( "domain.tld,2002", 'customer', &customer_proc )
Psych.add_domain_type( "domain.tld/2002", 'invoice', &customer_proc )
Psych.add_domain_type( "domain.tld/2002", 'customer', &customer_proc )
assert_parse_only( { "invoice"=> { "customers"=> [ { "given"=>"Chris", "type"=>"domain customer", "family"=>"Dumars" } ], "type"=>"domain invoice" } }, <<EOY
# 'http://domain.tld,2002/invoice' is some type family.
invoice: !domain.tld,2002/invoice
invoice: !domain.tld/2002:invoice
# 'seq' is shorthand for 'http://yaml.org/seq'.
# This does not effect '^customer' below
# because it is does not specify a prefix.
Expand Down Expand Up @@ -705,7 +705,7 @@ def test_spec_override_anchor
end

def test_spec_explicit_families
Psych.add_domain_type( "somewhere.com,2002", 'type' ) { |type, val|
Psych.add_domain_type( "somewhere.com/2002", 'type' ) { |type, val|
"SOMEWHERE: #{val}"
}
assert_parse_only(
Expand All @@ -717,7 +717,7 @@ def test_spec_explicit_families
Pz7Y6OjuDg4J+fn5OTk6enp
56enmleECcgggoBADs=

hmm: !somewhere.com,2002/type |
hmm: !somewhere.com/2002:type |
family above is short for
http://somewhere.com/type
EOY
Expand All @@ -726,7 +726,7 @@ def test_spec_explicit_families

def test_spec_application_family
# Testing the clarkevans.com graphs
Psych.add_domain_type( "clarkevans.com,2002", 'graph/shape' ) { |type, val|
Psych.add_domain_type( "clarkevans.com/2002", 'graph/shape' ) { |type, val|
if Array === val
val << "Shape Container"
val
Expand All @@ -743,13 +743,13 @@ def test_spec_application_family
raise ArgumentError, "Invalid graph of type #{val.class}: " + val.inspect
end
}
Psych.add_domain_type( "clarkevans.com,2002", 'graph/circle', &one_shape_proc )
Psych.add_domain_type( "clarkevans.com,2002", 'graph/line', &one_shape_proc )
Psych.add_domain_type( "clarkevans.com,2002", 'graph/text', &one_shape_proc )
Psych.add_domain_type( "clarkevans.com/2002", 'graph/circle', &one_shape_proc )
Psych.add_domain_type( "clarkevans.com/2002", 'graph/line', &one_shape_proc )
Psych.add_domain_type( "clarkevans.com/2002", 'graph/text', &one_shape_proc )
# MODIFIED to remove invalid Psych
assert_parse_only(
[[{"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
- !clarkevans.com,2002/graph/shape
- !clarkevans.com/2002:graph/shape
- !/graph/circle
center: &ORIGIN {x: 73, y: 129}
radius: 7
Expand All @@ -771,8 +771,8 @@ def test_spec_float_explicit
# have the same type and value.
- 10.0
- !float 10
- !yaml.org,2002/float '10'
- !yaml.org,2002/float "\\
- !yaml.org/2002/float '10'
- !yaml.org/2002/float "\\
1\\
0"
EOY
Expand Down
1 change: 1 addition & 0 deletions tool/config.guess
1 change: 1 addition & 0 deletions tool/config.sub
6 changes: 3 additions & 3 deletions version.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
# define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
#define RUBY_VERSION_TEENY 1
#define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
#define RUBY_PATCHLEVEL 83
#define RUBY_PATCHLEVEL 85

#define RUBY_RELEASE_YEAR 2020
#define RUBY_RELEASE_MONTH 3
#define RUBY_RELEASE_DAY 31
#define RUBY_RELEASE_MONTH 6
#define RUBY_RELEASE_DAY 13

#include "ruby/version.h"

Expand Down