restify 0.1.1.1.b20 → 0.1.1.1.b22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NTE1ZGExNjFmYmI4N2IwMmVmNjZkNzZkZTAyM2IyNGRmNmZlNTBhNA==
4
+ YmU3OTMyNjA1OTU3NjFlNTc1ODY2MDIzOTE3MjhhNzA5ZDk1MzdlYw==
5
5
  data.tar.gz: !binary |-
6
- NGY5MWI3OGYzZTkxMzljZjQxOWM4OWMwODZmYmUyZGU2YzQ1ZjcxZA==
6
+ YjZiMDg0ZTYyZTJmMTQ0YTJlYjc1NDBiNTAwZjM1YmJhODE2MGRlZQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- OWNmODE4YWFjMGZkYzgwMWQzYjg0ZWMzM2Y4ZDFlZDcyYTdkMDMyZjQyMjcz
10
- Mzk1OTBkZTkyYjhkMDk5MGMyZGExMjcxYjg0OTkxOWMwNmNkYjM1OWVmNWYw
11
- MWRiYmY1ZTQyZjU2NTQyNmI1OGYxNTYyMzE0ZWNkMWIzMGYwYWI=
9
+ NTlhMWRhOTM5ODNiYzZlMzk3MmE3YTEwZmI1OTM2OGRlZTNiMWVlNjUwZmVi
10
+ NzYyMWJhYmYyMzBkZTdmOGJlYTBhNGI3YzYxZjIxNTYyZmQyM2UwYTczNGRh
11
+ OGIzMzYyZGI5YmFhNjQyOTE1YWM2MTRkYzc3NjYwZWM5YjdjZTU=
12
12
  data.tar.gz: !binary |-
13
- OTEwZTZhODgyYTcwY2IyY2VhNWM2NGY0NmZlYzJmMmYxOTNiNDkzMTdlZDhl
14
- MjkwZWM4ODY1NTBiNzlkZmU4MGZmMGI0ZjBhMGJjNjk5M2Q5YjA3MGY2ZDU0
15
- MTk1MmMwZmE2ZjFiYWIyNmYwZjllNWY3ZGIyM2NlZmRjZTM3NTE=
13
+ OWFjNjc0YWY0ZjJmMWYwMzRlMzA0ZTlkNjFiYmJhN2VkYmIwZjcwOWVlZjBh
14
+ MGJhNjQ5ZTNiYjBiY2JiMGY2ZmFlZTEwN2Q4OTYzMjYzNDUxODIzODM0NDZl
15
+ ZGQzY2UxNTJmMzgwNTY3MGE3ZDk0YTYyNzllMTU2ODIzNGNjOTM=
@@ -20,8 +20,7 @@ module Restify
20
20
  attr_reader :origin
21
21
 
22
22
  def initialize(origin)
23
- @origin = origin
24
- @pipeline = true
23
+ @origin = origin
25
24
  end
26
25
 
27
26
  def requests
@@ -37,14 +36,10 @@ module Restify
37
36
  @connection ||= EventMachine::HttpRequest.new(origin)
38
37
  end
39
38
 
40
- def pipeline?
41
- @pipeline
42
- end
43
-
44
39
  def process_next
45
40
  return if requests.empty?
46
41
 
47
- request, writer = pipeline? ? requests.shift : requests.first
42
+ request, writer = requests.first
48
43
  req = connection.send request.method.downcase,
49
44
  keepalive: true,
50
45
  redirects: 3,
@@ -53,11 +48,8 @@ module Restify
53
48
  body: request.body,
54
49
  head: request.headers
55
50
 
56
- # puts "REQUEST: #{request} #{pipeline? ? 'w/' : 'w/o'} pipelining"
57
-
58
51
  req.callback do
59
- # puts "SUCCESS: #{request}"
60
- requests.shift unless pipeline?
52
+ requests.shift
61
53
 
62
54
  writer.fulfill Response.new(
63
55
  request,
@@ -75,21 +67,14 @@ module Restify
75
67
  end
76
68
 
77
69
  req.errback do
78
- # puts "ERROR: #{request}"
70
+ requests.shift
79
71
  @connection = nil
80
72
 
81
- if pipeline?
82
- EventMachine.next_tick do
83
- @pipeline = false
84
- call request, writer
85
- end
86
- else
87
- begin
88
- raise RuntimeError.new \
89
- "(#{req.response_header.status}) #{req.error}"
90
- rescue => e
91
- writer.reject e
92
- end
73
+ begin
74
+ raise RuntimeError.new \
75
+ "(#{req.response_header.status}) #{req.error}"
76
+ rescue => e
77
+ writer.reject e
93
78
  end
94
79
  end
95
80
  end
@@ -35,7 +35,11 @@ module Restify
35
35
  # such a thing otherwise it returns nil.
36
36
  #
37
37
  def errors
38
- response.decoded_body['errors'] || response.decoded_body[:errors]
38
+ if response.decoded_body
39
+ response.decoded_body['errors'] || response.decoded_body[:errors]
40
+ else
41
+ response.body
42
+ end
39
43
  end
40
44
  end
41
45
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: restify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.1.b20
4
+ version: 0.1.1.1.b22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jan Graichen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-21 00:00:00.000000000 Z
11
+ date: 2014-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: obligation
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
161
161
  version: 1.3.1
162
162
  requirements: []
163
163
  rubyforge_project:
164
- rubygems_version: 2.2.2
164
+ rubygems_version: 2.4.1
165
165
  signing_key:
166
166
  specification_version: 4
167
167
  summary: An experimental hypermedia REST client.