emmy-http 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/emmy_http/response.rb +12 -1
- data/lib/emmy_http/version.rb +1 -1
- data/spec/emmy_http/response_spec.rb +11 -0
- data/spec/emmy_http_spec.rb +1 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ee8be3827495aa336fb2971686ad1cbfa901e53
|
4
|
+
data.tar.gz: 72d47e9269d8dd829ecb9926260fda5189a91659
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b22d65f1c793b2ce8b12b16ef64080f65713d7d4b93b7f25eb53d794b41d5c558639422b7ee0d883e72412f96bd79b9fffdcbc4fdc346e686fe4396062d0d84b
|
7
|
+
data.tar.gz: aba78e417ac83c315bbf118e5e5b990394fdc49979853ded65a37d18d6b9adca5f641762444e3eaab76d87d1b752558d4c6ebda6221d162cd0b133566c5481a3
|
data/lib/emmy_http/response.rb
CHANGED
@@ -1,15 +1,26 @@
|
|
1
1
|
module EmmyHttp
|
2
2
|
class Response
|
3
|
+
using EventObject
|
3
4
|
include ModelPack::Document
|
4
5
|
|
5
6
|
attribute :status
|
6
7
|
dictionary :headers, writer: -> (head) { EmmyHttp::Utils.convert_headers(head) }
|
7
8
|
attribute :body
|
8
9
|
|
10
|
+
events :data
|
11
|
+
|
12
|
+
def initialize
|
13
|
+
on :data do |chunk|
|
14
|
+
body << chunk
|
15
|
+
end
|
16
|
+
|
17
|
+
reset
|
18
|
+
end
|
19
|
+
|
9
20
|
def reset
|
10
21
|
@status = 0
|
11
22
|
@headers = {}
|
12
|
-
@body =
|
23
|
+
@body = ''
|
13
24
|
end
|
14
25
|
|
15
26
|
def chunked_encoding?
|
data/lib/emmy_http/version.rb
CHANGED
data/spec/emmy_http_spec.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "spec_helper"
|
2
|
+
using EventObject
|
2
3
|
|
3
4
|
describe EmmyHttp do
|
4
5
|
Connection = EmmyMachine::Connection
|
@@ -20,7 +21,6 @@ describe EmmyHttp do
|
|
20
21
|
class FakeAdapter
|
21
22
|
attr_accessor :delegate
|
22
23
|
include EmmyHttp::Adapter
|
23
|
-
using EventObject
|
24
24
|
|
25
25
|
def initialize_connection
|
26
26
|
self.delegate.init! delegate
|
@@ -91,6 +91,5 @@ describe EmmyHttp do
|
|
91
91
|
EventMachine.stop
|
92
92
|
end
|
93
93
|
expect(request_hash).to include(type: 'get', url: 'http://google.com')
|
94
|
-
|
95
94
|
end
|
96
95
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: emmy-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- inre
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fibre
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- lib/emmy_http/version.rb
|
123
123
|
- pkg/emmy-http-0.1.0.gem
|
124
124
|
- pkg/emmy-http-0.1.1.gem
|
125
|
+
- spec/emmy_http/response_spec.rb
|
125
126
|
- spec/emmy_http_spec.rb
|
126
127
|
- spec/spec_helper.rb
|
127
128
|
homepage: ''
|
@@ -149,5 +150,6 @@ signing_key:
|
|
149
150
|
specification_version: 4
|
150
151
|
summary: EmmyHttp is a
|
151
152
|
test_files:
|
153
|
+
- spec/emmy_http/response_spec.rb
|
152
154
|
- spec/emmy_http_spec.rb
|
153
155
|
- spec/spec_helper.rb
|