jr 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data.tar.gz.sig +0 -0
  2. data/lib/jr.rb +6 -1
  3. metadata +2 -2
  4. metadata.gz.sig +0 -0
data.tar.gz.sig CHANGED
Binary file
data/lib/jr.rb CHANGED
@@ -96,7 +96,7 @@ module Jr
96
96
  id: reqid
97
97
  )
98
98
 
99
- r = JSON.parse(http_request(data))
99
+ r = parse_json_data(http_request(data))
100
100
  if r.has_key?('jsonrpc') and (r['jsonrpc'] != JSON_RPC_VERSION)
101
101
  # Even though the JSON RPC specification requires that a 'jsonrpc' key
102
102
  # is present, we don't require it because not all servers implement it.
@@ -143,5 +143,10 @@ module Jr
143
143
  @random_instance ||= Random.new
144
144
  Base64.urlsafe_encode64(@random_instance.bytes(12))
145
145
  end
146
+
147
+ # Parse JSON data.
148
+ def parse_json_data(data)
149
+ JSON.parse(data)
150
+ end
146
151
  end
147
152
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -50,7 +50,7 @@ cert_chain:
50
50
  -----END CERTIFICATE-----
51
51
 
52
52
  '
53
- date: 2012-04-25 00:00:00.000000000 Z
53
+ date: 2012-04-27 00:00:00.000000000 Z
54
54
  dependencies: []
55
55
  description: Jr. lets you communicate with an HTTP JSON RPC server.
56
56
  email: the.magical.kat@gmail.com
metadata.gz.sig CHANGED
Binary file