paychex 0.3.4 → 0.3.5

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
2
  SHA256:
3
- metadata.gz: 3a0e9b796ff8bbed7975f38538ce1249dba655105902ddb09d040ead0a1a73fb
4
- data.tar.gz: 82a381abe282825c4ea363dc529b6cc38d7d948177867acdbc7951cbd1748b48
3
+ metadata.gz: 45e870f2d315996be069c400602a4ccf366a9994cd266618114f6dffc54c9004
4
+ data.tar.gz: 92f46dee54c5fa14fb1b1b1ff10b7ac4615f57e2cae2eee3ee7dcde9090c7e60
5
5
  SHA512:
6
- metadata.gz: 4cf9c380ba369beff5ad7b654156e1d303ffaa6a11507e869cf6fd0032cd84b0d1ce231415e8910d882c7913c7bc22fee5923bb98ed87be37a15f46950d2ba6b
7
- data.tar.gz: f4f8e193fb4ae7aa82a0c36283f3500e13a12f9c654f286f4ad032436915757a6788fa932910f4149fd3866c6532539cef168180f78183fa58f7cff5c00be8d1
6
+ metadata.gz: a052c5f5d6ee6811fad22bf8391b302f274fb9fe2d794e21033e3180f8094a7528e79a8230e953b61c1aef239d028adf294ce85a3d13a4c58324664d2efe745f
7
+ data.tar.gz: 1bf76e48e2e5ed81b69fd055f01f84d5a042f11d9fd93ef7e8dcfe0b124c46458edaac46502e83c503d669e9ce05973d2466e0a9342447167344c7c5eae08a4a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- paychex (0.3.4)
4
+ paychex (0.3.5)
5
5
  addressable
6
6
  faraday
7
7
  faraday_middleware
@@ -12,11 +12,14 @@ module Paychex
12
12
 
13
13
  begin
14
14
  while response && response.body
15
- companies_count = response.body.fetch('metadata').fetch('pagination').fetch('total')
15
+ begin
16
+ companies_count = response.body.fetch('metadata').fetch('pagination').fetch('total')
16
17
 
17
- break unless companies_count
18
-
19
- no_of_pages = (companies_count.to_f / limit).ceil
18
+ no_of_pages = (companies_count.to_f / limit).ceil
19
+ rescue KeyError => e
20
+ # Consider no_of_pages = 1 unless pagination - total node is missing
21
+ no_of_pages = 1
22
+ end
20
23
 
21
24
  companies_content = response.body.fetch('content').to_a
22
25
  companies_content = companies_content.select { |c| c['hasPermission'] } if companies_content
@@ -1,32 +1,32 @@
1
- require 'faraday_middleware'
2
- require 'faraday/raise_paychex_http_exception'
3
-
4
- module Paychex
5
- module Connection
6
- private
7
-
8
- def connection
9
- options = {
10
- headers: {
11
- 'Accept' => "application/#{format}",
12
- 'User-Agent' => user_agent
13
- },
14
- proxy: proxy,
15
- url: endpoint
16
- }.merge(connection_options)
17
-
18
- Faraday::Connection.new(options) do |conn|
19
- conn.authorization :Bearer, access_token unless access_token.nil?
20
- # https://github.com/lostisland/faraday/issues/417#issuecomment-223413386
21
- conn.options[:timeout] = timeout
22
- conn.options[:open_timeout] = open_timeout
23
- conn.request :json
24
- conn.request :instrumentation, name: 'request.paychex'
25
-
26
- conn.use ::PaychexFaradayMiddleWare::RaisePaychexHttpException
27
- conn.response :json, content_type: /\bjson$/
28
- conn.adapter Faraday.default_adapter
29
- end
30
- end
31
- end
32
- end
1
+ require 'faraday_middleware'
2
+ require 'faraday/raise_paychex_http_exception'
3
+
4
+ module Paychex
5
+ module Connection
6
+ private
7
+
8
+ def connection
9
+ options = {
10
+ headers: {
11
+ 'Accept' => "application/#{format}",
12
+ 'User-Agent' => user_agent
13
+ },
14
+ proxy: proxy,
15
+ url: endpoint
16
+ }.merge(connection_options)
17
+
18
+ Faraday::Connection.new(options) do |conn|
19
+ conn.authorization :Bearer, access_token unless access_token.nil?
20
+ # https://github.com/lostisland/faraday/issues/417#issuecomment-223413386
21
+ conn.options[:timeout] = timeout
22
+ conn.options[:open_timeout] = open_timeout
23
+ conn.request :json
24
+ conn.request :instrumentation, name: 'request.paychex'
25
+
26
+ conn.use ::PaychexFaradayMiddleWare::RaisePaychexHttpException
27
+ conn.response :json, content_type: /\bjson$/
28
+ conn.adapter Faraday.default_adapter
29
+ end
30
+ end
31
+ end
32
+ end
@@ -1,3 +1,3 @@
1
1
  module Paychex
2
- VERSION = '0.3.4'
2
+ VERSION = '0.3.5'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paychex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mayank Dedhia
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-05-10 00:00:00.000000000 Z
11
+ date: 2024-05-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -199,7 +199,7 @@ metadata:
199
199
  homepage_uri: https://github.com/helloworld1812/paychex-ruby-gem
200
200
  source_code_uri: https://github.com/helloworld1812/paychex-ruby-gem
201
201
  changelog_uri: https://github.com/helloworld1812/paychex-ruby-gem/CHANGELOG.md
202
- post_install_message:
202
+ post_install_message:
203
203
  rdoc_options: []
204
204
  require_paths:
205
205
  - lib
@@ -215,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
215
215
  version: '0'
216
216
  requirements: []
217
217
  rubygems_version: 3.0.3.1
218
- signing_key:
218
+ signing_key:
219
219
  specification_version: 4
220
220
  summary: Ruby wrapper for paychex.com APIs.
221
221
  test_files: []