http 3.2.0 → 3.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
- SHA1:
3
- metadata.gz: f5e1c6e74ac078db494c4b2196a43018b75db1dc
4
- data.tar.gz: 8bf04adb251ff46dc31190ce865736c13c7317a2
2
+ SHA256:
3
+ metadata.gz: 7a096aa1b9d5191761bbd4cc1205b371038bac039e7b7eff2bf1a95d25f4cc20
4
+ data.tar.gz: 9c27c29310fda99f663a2c52dddab4bf1541e51b34c74cd6fac7b0c34f0b8eae
5
5
  SHA512:
6
- metadata.gz: 702c1c5e63d582319859b9f6da99d4192141f6162237e593bb50e70e87cb0a54e0b6bcc43bfedce1e02cb1b7cc2c7cfbf18fcab903cf99a5b4f6362419a98d44
7
- data.tar.gz: 44e4070afc9aeae5b0ba5c5f6c74d87df2c5a5656175e26d3cc485418316e84ec23c36dccd7e9b4d2a9595b09d117a1bdff0714cca432f337cc770b3840da222
6
+ metadata.gz: 5034ce467b1a9d72be5272a1c1aa1060e29a2c52badf1fbc413559c5027a36f0d052c7f9a69d6ef66d45aae814d57a44e022758908670d3e27aca650c6f957a2
7
+ data.tar.gz: 48d814174b0d98a6d4722f144f423ab755eabf48cfb56246bbee6d2ab53dad3d37a162ce696a49a82c34d4de97469393b8668863a6ac8a4b611522c01204ac99
data/CHANGES.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 3.2.1 (2018-04-24)
2
+
3
+ * [#468](https://github.com/httprb/http/pull/468)
4
+ Rewind `HTTP::Request::Body#source` once `#each` is complete.
5
+ ([@ixti])
6
+
7
+
1
8
  ## 3.2.0 (2018-04-22)
2
9
 
3
10
  This vresion backports one change we missed to backport in previous release:
@@ -35,6 +35,7 @@ module HTTP
35
35
  yield @source
36
36
  elsif @source.respond_to?(:read)
37
37
  IO.copy_stream(@source, ProcIO.new(block))
38
+ @source.rewind if @source.respond_to?(:rewind)
38
39
  elsif @source.is_a?(Enumerable)
39
40
  @source.each(&block)
40
41
  end
data/lib/http/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module HTTP
4
- VERSION = "3.2.0"
4
+ VERSION = "3.2.1"
5
5
  end
@@ -126,10 +126,26 @@ RSpec.describe HTTP::Request::Body do
126
126
  end
127
127
 
128
128
  context "when body is an Enumerable IO" do
129
- let(:body) { StringIO.new("a" * 16 * 1024 + "b" * 10 * 1024) }
129
+ let(:data) { "a" * 16 * 1024 + "b" * 10 * 1024 }
130
+ let(:body) { StringIO.new data }
130
131
 
131
132
  it "yields chunks of content" do
132
- expect(chunks.inject("", :+)).to eq "a" * 16 * 1024 + "b" * 10 * 1024
133
+ expect(chunks.inject("", :+)).to eq data
134
+ end
135
+
136
+ it "allows to enumerate multiple times" do
137
+ results = []
138
+
139
+ 2.times do
140
+ result = ""
141
+ subject.each { |chunk| result += chunk }
142
+ results << result
143
+ end
144
+
145
+ aggregate_failures do
146
+ expect(results.count).to eq 2
147
+ expect(results).to all eq data
148
+ end
133
149
  end
134
150
  end
135
151
 
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: 3.2.0
4
+ version: 3.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: 2018-04-22 00:00:00.000000000 Z
14
+ date: 2018-04-24 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: http_parser.rb
@@ -195,7 +195,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
195
195
  version: '0'
196
196
  requirements: []
197
197
  rubyforge_project:
198
- rubygems_version: 2.5.2.3
198
+ rubygems_version: 2.7.6
199
199
  signing_key:
200
200
  specification_version: 4
201
201
  summary: HTTP should be easy