jimson 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/jimson/version.rb +3 -0
- data/spec/client_spec.rb +9 -9
- data/spec/server_spec.rb +1 -1
- metadata +124 -32
- data/VERSION +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4b63c7fb93daba21597687aef2fc96ca00449b21
|
4
|
+
data.tar.gz: 4fd4b23767311a5a9fccfe9a8cf78abc08236385
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 665e350135f80d85939ec5d14a4a203e11cb11f24efa76d7a18b3abb7018eac9012c8f926a502307826e86dc320d852937ba464f648c1c61fa8f482db8f87855
|
7
|
+
data.tar.gz: 356326ce26e13273ef237f86e04ca75c6c77e9231f6c4a77aee50db858a01358ea50d2df43773e1ab710fef6a7ebeb1ef1f644a0884bc5878c9d73fa07e4032f
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Jimson
|
2
2
|
### JSON-RPC 2.0 Client and Server for Ruby
|
3
|
-
![
|
3
|
+
[![Build Status](https://travis-ci.org/chriskite/jimson.svg?branch=master)](https://travis-ci.org/chriskite/jimson)
|
4
4
|
|
5
5
|
## Client: Quick Start
|
6
6
|
require 'jimson'
|
data/spec/client_spec.rb
CHANGED
@@ -5,8 +5,8 @@ module Jimson
|
|
5
5
|
BOILERPLATE = {'jsonrpc' => '2.0', 'id' => 1}
|
6
6
|
|
7
7
|
before(:each) do
|
8
|
-
@resp_mock =
|
9
|
-
ClientHelper.stub
|
8
|
+
@resp_mock = double('http_response')
|
9
|
+
ClientHelper.stub(:make_id).and_return(1)
|
10
10
|
end
|
11
11
|
|
12
12
|
after(:each) do
|
@@ -148,7 +148,7 @@ module Jimson
|
|
148
148
|
{"jsonrpc" => "2.0", "result" => ["hello", 5], "id" => "9"}
|
149
149
|
])
|
150
150
|
|
151
|
-
ClientHelper.stub
|
151
|
+
ClientHelper.stub(:make_id).and_return('1', '2', '5', '9')
|
152
152
|
RestClient.should_receive(:post).with(SPEC_URL, batch, {:content_type => 'application/json'}).and_return(@resp_mock)
|
153
153
|
@resp_mock.should_receive(:body).at_least(:once).and_return(response)
|
154
154
|
client = Client.new(SPEC_URL)
|
@@ -161,14 +161,14 @@ module Jimson
|
|
161
161
|
data = batch.get_data
|
162
162
|
end
|
163
163
|
|
164
|
-
sum.succeeded?.should
|
165
|
-
sum.is_error?.should
|
164
|
+
sum.succeeded?.should be true
|
165
|
+
sum.is_error?.should be false
|
166
166
|
sum.result.should == 7
|
167
167
|
|
168
168
|
subtract.result.should == 19
|
169
169
|
|
170
|
-
foo.is_error?.should
|
171
|
-
foo.succeeded?.should
|
170
|
+
foo.is_error?.should be true
|
171
|
+
foo.succeeded?.should be false
|
172
172
|
foo.error['code'].should == -32601
|
173
173
|
|
174
174
|
data.result.should == ['hello', 5]
|
@@ -179,9 +179,9 @@ module Jimson
|
|
179
179
|
context "when an error occurs in the Jimson::Client code" do
|
180
180
|
it "tags the raised exception with Jimson::Client::Error" do
|
181
181
|
client_helper = ClientHelper.new(SPEC_URL)
|
182
|
-
ClientHelper.stub
|
182
|
+
ClientHelper.stub(:new).and_return(client_helper)
|
183
183
|
client = Client.new(SPEC_URL)
|
184
|
-
client_helper.stub
|
184
|
+
client_helper.stub(:send_single_request).and_raise "intentional error"
|
185
185
|
lambda { client.foo }.should raise_error(Jimson::Client::Error)
|
186
186
|
end
|
187
187
|
end
|
data/spec/server_spec.rb
CHANGED
metadata
CHANGED
@@ -1,71 +1,163 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jimson
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.11.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Kite
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: blankslate
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 3.1
|
19
|
+
version: '3.1'
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 3.1.3
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - ~>
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.1'
|
30
|
+
- - ">="
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: 3.1.
|
32
|
+
version: 3.1.3
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rest-client
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
30
36
|
requirements:
|
31
|
-
- - ~>
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1'
|
40
|
+
- - ">="
|
32
41
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
42
|
+
version: 1.7.3
|
34
43
|
type: :runtime
|
35
44
|
prerelease: false
|
36
45
|
version_requirements: !ruby/object:Gem::Requirement
|
37
46
|
requirements:
|
38
|
-
- - ~>
|
47
|
+
- - "~>"
|
39
48
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1
|
49
|
+
version: '1'
|
50
|
+
- - ">="
|
51
|
+
- !ruby/object:Gem::Version
|
52
|
+
version: 1.7.3
|
41
53
|
- !ruby/object:Gem::Dependency
|
42
54
|
name: multi_json
|
43
55
|
requirement: !ruby/object:Gem::Requirement
|
44
56
|
requirements:
|
45
|
-
- - ~>
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '1'
|
60
|
+
- - ">="
|
46
61
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
62
|
+
version: 1.11.2
|
48
63
|
type: :runtime
|
49
64
|
prerelease: false
|
50
65
|
version_requirements: !ruby/object:Gem::Requirement
|
51
66
|
requirements:
|
52
|
-
- - ~>
|
67
|
+
- - "~>"
|
53
68
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1
|
69
|
+
version: '1'
|
70
|
+
- - ">="
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: 1.11.2
|
55
73
|
- !ruby/object:Gem::Dependency
|
56
74
|
name: rack
|
57
75
|
requirement: !ruby/object:Gem::Requirement
|
58
76
|
requirements:
|
59
|
-
- - ~>
|
77
|
+
- - "~>"
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '1'
|
80
|
+
- - ">="
|
60
81
|
- !ruby/object:Gem::Version
|
61
82
|
version: 1.4.5
|
62
83
|
type: :runtime
|
63
84
|
prerelease: false
|
64
85
|
version_requirements: !ruby/object:Gem::Requirement
|
65
86
|
requirements:
|
66
|
-
- - ~>
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1'
|
90
|
+
- - ">="
|
67
91
|
- !ruby/object:Gem::Version
|
68
92
|
version: 1.4.5
|
93
|
+
- !ruby/object:Gem::Dependency
|
94
|
+
name: rspec
|
95
|
+
requirement: !ruby/object:Gem::Requirement
|
96
|
+
requirements:
|
97
|
+
- - "~>"
|
98
|
+
- !ruby/object:Gem::Version
|
99
|
+
version: '2.14'
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: 2.14.1
|
103
|
+
type: :development
|
104
|
+
prerelease: false
|
105
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - "~>"
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '2.14'
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: 2.14.1
|
113
|
+
- !ruby/object:Gem::Dependency
|
114
|
+
name: rack-test
|
115
|
+
requirement: !ruby/object:Gem::Requirement
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
version: '0'
|
120
|
+
type: :development
|
121
|
+
prerelease: false
|
122
|
+
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
requirements:
|
124
|
+
- - ">="
|
125
|
+
- !ruby/object:Gem::Version
|
126
|
+
version: '0'
|
127
|
+
- !ruby/object:Gem::Dependency
|
128
|
+
name: rake
|
129
|
+
requirement: !ruby/object:Gem::Requirement
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :development
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
141
|
+
- !ruby/object:Gem::Dependency
|
142
|
+
name: rdoc
|
143
|
+
requirement: !ruby/object:Gem::Requirement
|
144
|
+
requirements:
|
145
|
+
- - "~>"
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
version: '4.2'
|
148
|
+
- - ">="
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: 4.2.2
|
151
|
+
type: :development
|
152
|
+
prerelease: false
|
153
|
+
version_requirements: !ruby/object:Gem::Requirement
|
154
|
+
requirements:
|
155
|
+
- - "~>"
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '4.2'
|
158
|
+
- - ">="
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: 4.2.2
|
69
161
|
description:
|
70
162
|
email:
|
71
163
|
executables: []
|
@@ -73,26 +165,26 @@ extensions: []
|
|
73
165
|
extra_rdoc_files:
|
74
166
|
- README.md
|
75
167
|
files:
|
76
|
-
- VERSION
|
77
|
-
- LICENSE.txt
|
78
168
|
- CHANGELOG.rdoc
|
169
|
+
- LICENSE.txt
|
79
170
|
- README.md
|
80
171
|
- Rakefile
|
81
172
|
- lib/jimson.rb
|
173
|
+
- lib/jimson/client.rb
|
174
|
+
- lib/jimson/client/error.rb
|
175
|
+
- lib/jimson/handler.rb
|
176
|
+
- lib/jimson/request.rb
|
82
177
|
- lib/jimson/response.rb
|
83
178
|
- lib/jimson/router.rb
|
84
|
-
- lib/jimson/server/error.rb
|
85
|
-
- lib/jimson/server.rb
|
86
|
-
- lib/jimson/handler.rb
|
87
179
|
- lib/jimson/router/map.rb
|
88
|
-
- lib/jimson/
|
89
|
-
- lib/jimson/
|
90
|
-
- lib/jimson/
|
180
|
+
- lib/jimson/server.rb
|
181
|
+
- lib/jimson/server/error.rb
|
182
|
+
- lib/jimson/version.rb
|
183
|
+
- spec/client_spec.rb
|
91
184
|
- spec/handler_spec.rb
|
185
|
+
- spec/router_spec.rb
|
92
186
|
- spec/server_spec.rb
|
93
187
|
- spec/spec_helper.rb
|
94
|
-
- spec/router_spec.rb
|
95
|
-
- spec/client_spec.rb
|
96
188
|
homepage: http://www.github.com/chriskite/jimson
|
97
189
|
licenses: []
|
98
190
|
metadata: {}
|
@@ -102,23 +194,23 @@ require_paths:
|
|
102
194
|
- lib
|
103
195
|
required_ruby_version: !ruby/object:Gem::Requirement
|
104
196
|
requirements:
|
105
|
-
- -
|
197
|
+
- - ">="
|
106
198
|
- !ruby/object:Gem::Version
|
107
199
|
version: '0'
|
108
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
201
|
requirements:
|
110
|
-
- -
|
202
|
+
- - ">="
|
111
203
|
- !ruby/object:Gem::Version
|
112
204
|
version: '0'
|
113
205
|
requirements: []
|
114
206
|
rubyforge_project:
|
115
|
-
rubygems_version: 2.
|
207
|
+
rubygems_version: 2.5.1
|
116
208
|
signing_key:
|
117
209
|
specification_version: 4
|
118
210
|
summary: JSON-RPC 2.0 client and server
|
119
211
|
test_files:
|
212
|
+
- spec/client_spec.rb
|
120
213
|
- spec/handler_spec.rb
|
121
|
-
- spec/server_spec.rb
|
122
|
-
- spec/spec_helper.rb
|
123
214
|
- spec/router_spec.rb
|
124
|
-
- spec/
|
215
|
+
- spec/spec_helper.rb
|
216
|
+
- spec/server_spec.rb
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.10.0
|