kjson-roda 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kjson/roda.rb +10 -11
- data/lib/kjson/roda/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfe02084725e0cf06be435b99653dd536d9b7bb6
|
4
|
+
data.tar.gz: 598593e0d6e614510bcf71585f76f92898bcad9f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8661a7709bf544f0d88f79174c99001d23c34e9f8e53ce452affa44e4822399216382750d0f203562dcd5371d03516684eac3bc7e95f1e0f37270c79c9099ae9
|
7
|
+
data.tar.gz: ea7bdeae72b225ef0a8131c81ce7cdc7fcb1c0a4bad2cfa14c8e7bd2b1488f90555d605ca3c2699a87c40a63f13a846b4aa86b76579adbee18aba975bfd75b43
|
data/lib/kjson/roda.rb
CHANGED
@@ -66,7 +66,7 @@ module Kjson
|
|
66
66
|
stored_endpoints = @remaining_endpoints
|
67
67
|
@remaining_endpoints = @remaining_endpoints.drop(path.size)
|
68
68
|
if @remaining_endpoints.empty?
|
69
|
-
|
69
|
+
yield
|
70
70
|
throw :error, [NO_DATA, RESPONSE_ERROR] if @remaining_endpoints.empty?
|
71
71
|
else
|
72
72
|
yield
|
@@ -118,7 +118,7 @@ module Kjson
|
|
118
118
|
yield
|
119
119
|
}
|
120
120
|
response.data(data)
|
121
|
-
throw :halt, response.
|
121
|
+
throw :halt, response.kjson_finish
|
122
122
|
end
|
123
123
|
|
124
124
|
def catch_error(&_b)
|
@@ -131,7 +131,7 @@ module Kjson
|
|
131
131
|
}
|
132
132
|
error = [error] unless error.is_a?(Array)
|
133
133
|
response.error(*error)
|
134
|
-
throw :halt, response.
|
134
|
+
throw :halt, response.kjson_finish
|
135
135
|
end
|
136
136
|
|
137
137
|
def kjson_decode(str)
|
@@ -164,14 +164,13 @@ module Kjson
|
|
164
164
|
nil
|
165
165
|
end
|
166
166
|
|
167
|
-
def
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
super
|
167
|
+
def kjson_finish
|
168
|
+
raise Roda::RodaError, "should call #data or #error before finish response" unless @kjson_response
|
169
|
+
write(kjson_encode(
|
170
|
+
"data" => @data,
|
171
|
+
"error" => @error
|
172
|
+
))
|
173
|
+
finish
|
175
174
|
end
|
176
175
|
|
177
176
|
private
|
data/lib/kjson/roda/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kjson-roda
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Maksim V.
|
@@ -119,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
119
119
|
version: '0'
|
120
120
|
requirements: []
|
121
121
|
rubyforge_project:
|
122
|
-
rubygems_version: 2.
|
122
|
+
rubygems_version: 2.4.8
|
123
123
|
signing_key:
|
124
124
|
specification_version: 4
|
125
125
|
summary: KJson Roda plugin
|