diff --git a/.travis.yml b/.travis.yml index 34bafb0..d10a2ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,7 @@ cache: bundler matrix: include: + - rvm: 2.3 - rvm: 2.4 - rvm: 2.5 - rvm: 2.6 diff --git a/lib/protocol/http2/frame.rb b/lib/protocol/http2/frame.rb index 1e6ab3c..2f8307b 100644 --- a/lib/protocol/http2/frame.rb +++ b/lib/protocol/http2/frame.rb @@ -20,6 +20,7 @@ # THE SOFTWARE. require_relative 'error' +require_relative 'monkey_patch' module Protocol module HTTP2 diff --git a/lib/protocol/http2/monkey_patch.rb b/lib/protocol/http2/monkey_patch.rb new file mode 100644 index 0000000..058460b --- /dev/null +++ b/lib/protocol/http2/monkey_patch.rb @@ -0,0 +1,10 @@ +begin + ''.unpack1('*') +rescue => NoMethodError + # for compat ruby 2.3 + class String + def unpack1(template) + unpack(template).first + end + end +end