resto 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -9,7 +9,8 @@ module Resto
9
9
  extend Resto::Extra::Delegation
10
10
 
11
11
  delegate :read_host, :read_port, :options, :read_body, :composed_path,
12
- :composed_headers, :scheme, :use_ssl, :to => :@request
12
+ :composed_headers, :scheme, :use_ssl, :current_formatter,
13
+ :to => :@request
13
14
 
14
15
  def initialize(request)
15
16
  @request = request
@@ -132,6 +133,10 @@ module Resto
132
133
 
133
134
  body = result.body.to_s
134
135
  length = body.length
136
+ if current_formatter == Resto::Format::Json and not body.empty?
137
+ body = Yajl::Encoder.encode(Format::Json.decode(body),
138
+ { :pretty => true, :indent => " " })
139
+ end
135
140
  out << "\n*** Body (#{length}) ***\n#{body}"
136
141
  end
137
142
 
data/lib/resto/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
 
3
3
  module Resto
4
- VERSION = "0.0.8"
4
+ VERSION = "0.0.9"
5
5
  end
metadata CHANGED
@@ -1,13 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resto
3
3
  version: !ruby/object:Gem::Version
4
- hash: 15
5
4
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 8
10
- version: 0.0.8
5
+ version: 0.0.9
11
6
  platform: ruby
12
7
  authors:
13
8
  - "Anders T\xC3\xB6rnqvist"
@@ -15,7 +10,7 @@ autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
12
 
18
- date: 2011-05-16 00:00:00 Z
13
+ date: 2011-05-17 00:00:00 Z
19
14
  dependencies:
20
15
  - !ruby/object:Gem::Dependency
21
16
  name: yajl-ruby
@@ -25,11 +20,6 @@ dependencies:
25
20
  requirements:
26
21
  - - "="
27
22
  - !ruby/object:Gem::Version
28
- hash: 59
29
- segments:
30
- - 0
31
- - 8
32
- - 2
33
23
  version: 0.8.2
34
24
  type: :runtime
35
25
  version_requirements: *id001
@@ -41,11 +31,6 @@ dependencies:
41
31
  requirements:
42
32
  - - ">="
43
33
  - !ruby/object:Gem::Version
44
- hash: 15
45
- segments:
46
- - 1
47
- - 4
48
- - 4
49
34
  version: 1.4.4
50
35
  type: :runtime
51
36
  version_requirements: *id002
@@ -57,11 +42,6 @@ dependencies:
57
42
  requirements:
58
43
  - - ">="
59
44
  - !ruby/object:Gem::Version
60
- hash: 13
61
- segments:
62
- - 1
63
- - 0
64
- - 13
65
45
  version: 1.0.13
66
46
  type: :development
67
47
  version_requirements: *id003
@@ -73,11 +53,6 @@ dependencies:
73
53
  requirements:
74
54
  - - ">="
75
55
  - !ruby/object:Gem::Version
76
- hash: 23
77
- segments:
78
- - 2
79
- - 6
80
- - 0
81
56
  version: 2.6.0
82
57
  type: :development
83
58
  version_requirements: *id004
@@ -89,11 +64,6 @@ dependencies:
89
64
  requirements:
90
65
  - - ">="
91
66
  - !ruby/object:Gem::Version
92
- hash: 23
93
- segments:
94
- - 0
95
- - 0
96
- - 4
97
67
  version: 0.0.4
98
68
  type: :development
99
69
  version_requirements: *id005
@@ -105,11 +75,6 @@ dependencies:
105
75
  requirements:
106
76
  - - ">="
107
77
  - !ruby/object:Gem::Version
108
- hash: 11
109
- segments:
110
- - 1
111
- - 6
112
- - 2
113
78
  version: 1.6.2
114
79
  type: :development
115
80
  version_requirements: *id006
@@ -121,11 +86,6 @@ dependencies:
121
86
  requirements:
122
87
  - - ">="
123
88
  - !ruby/object:Gem::Version
124
- hash: 59
125
- segments:
126
- - 0
127
- - 8
128
- - 2
129
89
  version: 0.8.2
130
90
  type: :development
131
91
  version_requirements: *id007
@@ -137,9 +97,6 @@ dependencies:
137
97
  requirements:
138
98
  - - ">="
139
99
  - !ruby/object:Gem::Version
140
- hash: 3
141
- segments:
142
- - 0
143
100
  version: "0"
144
101
  type: :development
145
102
  version_requirements: *id008
@@ -151,9 +108,6 @@ dependencies:
151
108
  requirements:
152
109
  - - ">="
153
110
  - !ruby/object:Gem::Version
154
- hash: 3
155
- segments:
156
- - 0
157
111
  version: "0"
158
112
  type: :development
159
113
  version_requirements: *id009
@@ -165,9 +119,6 @@ dependencies:
165
119
  requirements:
166
120
  - - ">="
167
121
  - !ruby/object:Gem::Version
168
- hash: 3
169
- segments:
170
- - 0
171
122
  version: "0"
172
123
  type: :development
173
124
  version_requirements: *id010
@@ -179,9 +130,6 @@ dependencies:
179
130
  requirements:
180
131
  - - ">="
181
132
  - !ruby/object:Gem::Version
182
- hash: 3
183
- segments:
184
- - 0
185
133
  version: "0"
186
134
  type: :development
187
135
  version_requirements: *id011
@@ -254,27 +202,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
254
202
  requirements:
255
203
  - - ">="
256
204
  - !ruby/object:Gem::Version
257
- hash: 57
258
- segments:
259
- - 1
260
- - 8
261
- - 7
262
205
  version: 1.8.7
263
206
  required_rubygems_version: !ruby/object:Gem::Requirement
264
207
  none: false
265
208
  requirements:
266
209
  - - ">="
267
210
  - !ruby/object:Gem::Version
268
- hash: 23
269
- segments:
270
- - 1
271
- - 3
272
- - 6
273
211
  version: 1.3.6
274
212
  requirements: []
275
213
 
276
214
  rubyforge_project: resto
277
- rubygems_version: 1.8.2
215
+ rubygems_version: 1.7.2
278
216
  signing_key:
279
217
  specification_version: 3
280
218
  summary: Restful Web Service