http 2.2.0 → 2.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 516d371c9aa3a19abeaabeefea99bd16be506f36
4
- data.tar.gz: 030d18563e33fc3aad5832cb98508013cba1a956
3
+ metadata.gz: d9dcdebfa768fef6850eb95f309e613e7dabff6e
4
+ data.tar.gz: ef6556edd618dc48d214b6e4dd0b3eae123a2640
5
5
  SHA512:
6
- metadata.gz: 33f746cb66e0493bb3ca2a272bbf7364a6a949e804dc7f581738a05b373367b08baf0798e838e3a7865d7ef782f0e74dd823204a63bb97b7f334964673e9ed0f
7
- data.tar.gz: c426e9ff531bbc8268b7bfd3d49276c0fb890e063a69fc3fd6000c8580631dfb62fd83d04088c1a77ed246078fe77c30364c42cdaa527a1f2cedcb1e55499c77
6
+ metadata.gz: 1c5b7284269683e79dc40f00784745498483ba98a9931ff1fcdd9141fdfeb77bddd96e29ee086c8611536ef6498456deb390afe64a138816f84eb347aaacd5a1
7
+ data.tar.gz: 4d6fd7a909cffcbd7618fae1cebf984de0d3a85753725ac79997febfa46f67526f9d0e0eb2dd9e605d6809ad686acc00fba98f9ada46fb2f8b67d125c6b233bc
data/CHANGES.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 2.2.1 (2017-02-06)
2
+
3
+ * [#395](https://github.com/httprb/http/issues/395)
4
+ Fix regression of API, that broke webmock integration.
5
+ ([@ixti])
6
+
7
+
1
8
  ## 2.2.0 (2017-02-03)
2
9
 
3
10
  * [#375](https://github.com/httprb/http/pull/375)
@@ -48,10 +48,9 @@ module HTTP
48
48
  if opts.include?(:connection)
49
49
  connection = opts.fetch(:connection)
50
50
  encoding = opts[:encoding] || charset || Encoding::BINARY
51
+ stream = body_stream_for(connection, opts)
51
52
 
52
- stream = body_stream_for(connection, opts)
53
-
54
- @body = Response::Body.new(connection, stream, encoding)
53
+ @body = Response::Body.new(stream, encoding)
55
54
  else
56
55
  @body = opts.fetch(:body)
57
56
  end
@@ -15,11 +15,11 @@ module HTTP
15
15
  # @return [HTTP::Connection]
16
16
  attr_reader :connection
17
17
 
18
- def initialize(connection, stream, encoding = Encoding::BINARY)
19
- @connection = connection
18
+ def initialize(stream, encoding = Encoding::BINARY)
19
+ @stream = stream
20
+ @connection = stream.is_a?(Inflater) ? stream.connection : stream
20
21
  @streaming = nil
21
22
  @contents = nil
22
- @stream = stream
23
23
  @encoding = encoding
24
24
  end
25
25
 
@@ -5,6 +5,8 @@ require "zlib"
5
5
  module HTTP
6
6
  class Response
7
7
  class Inflater
8
+ attr_reader :connection
9
+
8
10
  def initialize(connection)
9
11
  @connection = connection
10
12
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTTP
4
- VERSION = "2.2.0".freeze
4
+ VERSION = "2.2.1".freeze
5
5
  end
@@ -5,7 +5,7 @@ RSpec.describe HTTP::Response::Body do
5
5
 
6
6
  before { allow(connection).to receive(:readpartial) { chunks.shift } }
7
7
 
8
- subject(:body) { described_class.new(connection, connection, Encoding::UTF_8) }
8
+ subject(:body) { described_class.new(connection, Encoding::UTF_8) }
9
9
 
10
10
  it "streams bodies from responses" do
11
11
  expect(subject.to_s).to eq("Hello, World!")
@@ -47,7 +47,7 @@ RSpec.describe HTTP::Response::Body do
47
47
  end
48
48
  subject(:body) do
49
49
  inflater = HTTP::Response::Inflater.new(connection)
50
- described_class.new(connection, inflater, Encoding::UTF_8)
50
+ described_class.new(inflater, Encoding::UTF_8)
51
51
  end
52
52
 
53
53
  it "decodes body" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-02-03 00:00:00.000000000 Z
14
+ date: 2017-02-06 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: http_parser.rb