dynaccount 0.9.6 → 0.9.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: dc3ce0394d4e43b168869de0f91de34c822cbceb
4
- data.tar.gz: 4eebf520445b637226d4dc59d89bcfa6c0117f94
2
+ SHA256:
3
+ metadata.gz: b50703a5a2e1867a47e8da8a5b899e97e513d7dd94e8bfa1b19d99cb0fc2a152
4
+ data.tar.gz: 6604b58018b0aefb67aac564c2189e0c376237c40ca1288cb89847c27ba23d09
5
5
  SHA512:
6
- metadata.gz: 4cc21290765f3c42bfaba9cc6ba4746eaf56632e7e1b5bee6e6e33840e38403ca295e1f723def479838d91839788df93d753e2cad04f0118d46b3ab81a349f07
7
- data.tar.gz: 548a2d2657040c893fd76986c8d201589a7960bc5559169e5175f5bd75912c9c2e9af9c6f378e721a96790c9e94155a840aa8b9b77fc9cbf2368a19492b9a515
6
+ metadata.gz: 9b365e503006696c4eaac831b2ca7e281253f254798e9bc2ff911c98693dae8bc86f751219abe82ea917ecda576b7fb103ff6a7d56e3c8121baba9472a90c93d
7
+ data.tar.gz: 94a00480d3c367843100d8e1124f2b50fb73812c3d7314cd6eeb8a67ab586a58353b165d957a33dc6d840957e95e9b9f0288a8682192b603d620ad827b59413e
@@ -1,6 +1,6 @@
1
1
  require 'json'
2
2
  require 'faraday'
3
- require 'net/http'
3
+ require 'net/http/persistent'
4
4
  require 'logger'
5
5
 
6
6
  require 'dynaccount/dynaccount_object'
@@ -84,7 +84,7 @@ module Dynaccount
84
84
  logger = Logger.new STDOUT
85
85
  logger.level = debug ? Logger::DEBUG : Logger::INFO
86
86
  faraday.response :logger, logger, bodies: (debug || false)
87
- faraday.adapter Faraday.default_adapter
87
+ faraday.adapter :net_http_persistent
88
88
  end
89
89
 
90
90
  @api_connection.post do |req|
@@ -44,12 +44,16 @@ module Dynaccount
44
44
  req = JSON.parse(Dynaccount.request(url(id, 'get'), {}, :post).body)['result'].map { |res| new(res) }
45
45
  return req[0] if req.size == 1
46
46
  req
47
+ rescue JSON::ParserError => e
48
+ return nil
47
49
  end
48
50
 
49
51
  def self.find_by(params = {})
50
52
  req = JSON.parse(Dynaccount.request(url(nil, 'get', params), {}, :post).body)['result'].map { |res| new(res) }
51
53
  return req[0] if req.size == 1
52
54
  req
55
+ rescue JSON::ParserError => e
56
+ return nil
53
57
  end
54
58
 
55
59
  def self.url(id, action, params = {})
@@ -1,3 +1,3 @@
1
1
  module Dynaccount
2
- VERSION = '0.9.6'.freeze
2
+ VERSION = '0.9.7'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynaccount
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.6
4
+ version: 0.9.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frederik Spang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-13 00:00:00.000000000 Z
11
+ date: 2018-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json
@@ -44,6 +44,20 @@ dependencies:
44
44
  - - "~>"
45
45
  - !ruby/object:Gem::Version
46
46
  version: '0.10'
47
+ - !ruby/object:Gem::Dependency
48
+ name: net-http-persistent
49
+ requirement: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - "<"
52
+ - !ruby/object:Gem::Version
53
+ version: '3'
54
+ type: :runtime
55
+ prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ requirements:
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: '3'
47
61
  description: The dynaccount gem is an module-based integration for Dynaccount, with
48
62
  the classic ActiveRecord structure, find, all etc.
49
63
  email:
@@ -144,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
144
158
  version: '0'
145
159
  requirements: []
146
160
  rubyforge_project:
147
- rubygems_version: 2.6.14
161
+ rubygems_version: 2.7.7
148
162
  signing_key:
149
163
  specification_version: 4
150
164
  summary: The dynaccount gem is an module-based integration for Dynaccount