Skip to content

Commit

Permalink
Add Ruby 3.0 to CI matrix. (#2459)
Browse files Browse the repository at this point in the history
  • Loading branch information
alextwoods authored Jan 6, 2021
1 parent 23f41c1 commit cc06703
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [2.3, 2.4, 2.5, 2.6, 2.7, jruby-9.2]
ruby: [2.3, 2.4, 2.5, 2.6, 2.7, '3.0', jruby-9.2]
env: [PURE_RUBY, KITCHEN_SINK]
exclude:
- ruby: jruby-9.1
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ group :test do
gem 'cucumber', '2.99.0'
# hashdiff drop support for Ruby under 2.0 since 0.3.9
gem 'hashdiff', '0.3.8'
# crack added a dependency on rexml in 0.4.5
gem 'crack', '0.4.4'
elsif RUBY_VERSION == '2.0.0'
# public_suffix released 3.0.3 which support ruby >= 2.1
gem 'public_suffix', '2.0.5'
Expand Down
2 changes: 1 addition & 1 deletion gems/aws-eventstream/spec/decoder_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module EventStream
expect(msg).to be_nil
expect(eof).to be true

expect(decoder.send(:message_buffer)).to eq(first_part)
expect(decoder.send(:message_buffer).force_encoding('utf-8')).to eq(first_part)

msg, eof = decoder.decode_chunk(second_part)
expect_msg = SpecHelper.expected_decoded_message(file)
Expand Down
5 changes: 5 additions & 0 deletions gems/aws-sdk-core/lib/aws-sdk-core/xml/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ def set_default_engine
[:ox, :oga, :libxml, :nokogiri, :rexml].each do |name|
@engine ||= try_load_engine(name)
end
unless @engine
raise 'Unable to find a compatible xml library. ' \
'Ensure that you have installed or added to your Gemfile one of ' \
'ox, oga, libxml, nokogiri or rexml'
end
end

private
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# frozen_string_literal: true

use_system_rexml = ((RUBY_VERSION <=> "2.0.0") < 0)
if use_system_rexml
require "rbconfig"
$LOAD_PATH.unshift(RbConfig::CONFIG["rubylibdir"])
end

require 'rexml/document'
require 'rexml/streamlistener'

$LOAD_PATH.shift if use_system_rexml

module Aws
module Xml
class Parser
Expand Down
3 changes: 1 addition & 2 deletions gems/aws-sdk-core/lib/seahorse/client/h2/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def new_stream
def connect(endpoint)
@mutex.synchronize {
if @status == :ready
tcp, addr = _tcp_socket(endpoint)
tcp, addr = _tcp_socket(endpoint)
debug_output("opening connection to #{endpoint.host}:#{endpoint.port} ...")
_nonblocking_connect(tcp, addr)
debug_output('opened')
Expand Down Expand Up @@ -245,4 +245,3 @@ def _default_ca_directory
end
end
end

0 comments on commit cc06703

Please sign in to comment.