jsonrpc-client 0.1.2 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +16 -0
- data/lib/jsonrpc/client.rb +1 -1
- data/lib/jsonrpc/version.rb +1 -1
- metadata +6 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9809b5bd50882f40cd6f24fcdf7c3d750d896b708efdae4b9f40f32af61f8c23
|
4
|
+
data.tar.gz: 8a47545474f4493f9f85869ba9dabc7b427e475c1a8ec1b757017713333deb52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a526f81e377c6d3fd560ee0774bc8b8e5c884d9aaa5db99aa9837d744fb9178143f019fbda41a3c2d4692c7966ada30abf3f75cf03722403d5250ad0b070b957
|
7
|
+
data.tar.gz: 81bf1e805fb0aea5303692bfa0bc064000bb3a02c5b8596e7a26167f1462be90134897f48ddce86ead1bde9e73be34758066608187d6fc619adbfaf9459c2bdb
|
data/README.md
CHANGED
@@ -23,6 +23,22 @@ client = JSONRPC::Client.new('http://example.com')
|
|
23
23
|
client.add_numbers(1, 2, 3)
|
24
24
|
```
|
25
25
|
|
26
|
+
### Passing a customized connection
|
27
|
+
|
28
|
+
By default, the client uses a plain Faraday connection with Faraday's default adapter to connect to the JSON-RPC endpoint. If you wish to customize this connection, you can pass your own Faraday object into the constructor. In this example, SSL verification is disabled and HTTP Basic Authentication is used:
|
29
|
+
|
30
|
+
```ruby
|
31
|
+
connection = Faraday.new { |connection|
|
32
|
+
connection.adapter Faraday.default_adapter
|
33
|
+
connection.ssl.verify = false # This is a baaaad idea!
|
34
|
+
connection.basic_auth('username', 'password')
|
35
|
+
}
|
36
|
+
client = JSONRPC::Client.new("http://example.com", { connection: connection })
|
37
|
+
```
|
38
|
+
|
39
|
+
More information about Faraday is available at [that project's GitHub page](https://github.com/lostisland/faraday).
|
40
|
+
|
41
|
+
|
26
42
|
## Contributing
|
27
43
|
|
28
44
|
1. Fork it
|
data/lib/jsonrpc/client.rb
CHANGED
@@ -200,7 +200,7 @@ module JSONRPC
|
|
200
200
|
return false
|
201
201
|
end
|
202
202
|
|
203
|
-
if !data['error']['code'].is_a?(::
|
203
|
+
if !data['error']['code'].is_a?(::Integer) || !data['error']['message'].is_a?(::String)
|
204
204
|
return false
|
205
205
|
end
|
206
206
|
end
|
data/lib/jsonrpc/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonrpc-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Forkert
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-07-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -90,7 +90,7 @@ files:
|
|
90
90
|
homepage: https://github.com/fxposter/jsonrpc-client
|
91
91
|
licenses: []
|
92
92
|
metadata: {}
|
93
|
-
post_install_message:
|
93
|
+
post_install_message:
|
94
94
|
rdoc_options: []
|
95
95
|
require_paths:
|
96
96
|
- lib
|
@@ -105,9 +105,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
|
-
|
109
|
-
|
110
|
-
signing_key:
|
108
|
+
rubygems_version: 3.4.6
|
109
|
+
signing_key:
|
111
110
|
specification_version: 4
|
112
111
|
summary: JSON-RPC 2.0 client
|
113
112
|
test_files:
|