iron_bank 5.2.6 → 5.4.0

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: fb169ea35186a7d6482c311a01110bfbe6c1ac2197e316d35cf5820f25a0ecdc
4
- data.tar.gz: f3c8c2b9a6499d17b85a9f8e3de4f9209c025417901a37990e98e969a34d79a8
3
+ metadata.gz: 853859a45aaabdcfc831dca27a70882b28aa19f68b214a666cb0830ce4fa702f
4
+ data.tar.gz: 3c755dd00fad7455b402dd04ae7f649f554fce6127608e11f28c2e16f31c85d9
5
5
  SHA512:
6
- metadata.gz: 87e2b2a5898135c34bcb153033fd19832977f25c231fa7ad28e49ca646a339ba8fcafefcb23fc647ec404314524ccb46257deb98f3b1f646925a4de9a8a51960
7
- data.tar.gz: db5459c331160c2e260ee35443a5e7ebdbb86f4a217160f5a55a583b5d32c1ba83701085f2c1cd1e02e2d043ba31fa292ff34b48bc93ca7417d0bf761e0cdee3
6
+ metadata.gz: 50f8865e78282701c705fd9e5b1b0f9978f152d54b7594784806153d9ffc3654d57871f6a9c4dbe1917611853915e27ff16e9b893e2bc2d848a27f963596aa32
7
+ data.tar.gz: 41e18fea0a4047734d49c8a495dfb28c2c13b7a40ef4a4737f6ccf909e4894bca44048124793cb9924ed375000e12245be67eefe559967f943b1391f7f2024f3
@@ -1,50 +1,57 @@
1
1
  name: CI
2
2
 
3
3
  on:
4
- push:
5
- branches:
6
- - main
7
4
  pull_request:
5
+ push:
8
6
  branches:
9
7
  - main
10
8
 
11
9
  jobs:
12
- test:
13
- name: Ruby
14
-
10
+ specs:
11
+ name: Ruby ${{ matrix.ruby-version }}
12
+ runs-on: ubuntu-latest
15
13
  strategy:
16
14
  matrix:
17
- ruby:
18
- - 2.5
19
- - 2.6
20
- - 2.7
21
- - 3.0
22
-
23
- runs-on: ubuntu-latest
24
-
15
+ ruby-version:
16
+ - '2.7'
17
+ - '3.0'
18
+ - '3.1'
19
+ - '3.2'
25
20
  steps:
26
- - uses: zendesk/checkout@v2
27
-
21
+ - uses: zendesk/checkout@v3
28
22
  - uses: zendesk/setup-ruby@v1
29
23
  with:
30
- ruby-version: ${{ matrix.ruby }}
31
-
32
- - uses: zendesk/cache@v2
33
- with:
34
- path: vendor/bundle
35
- key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ hashFiles('**/Gemfile.lock') }}
36
- restore-keys: |
37
- ${{ runner.os }}-gems-
38
-
39
- - name: Install Dependencies
40
- run: |
41
- bundle config deployment true
42
- bundle config path vendor/bundle
43
- bundle install --jobs 4
44
-
45
- - name: Run Tests
46
- run: bundle exec rake
24
+ ruby-version: ${{ matrix.ruby-version }}
25
+ bundler-cache: true
26
+ - name: Run Specs
27
+ run: bundle exec rake spec
47
28
  env:
48
29
  ZUORA_CLIENT_ID: something
49
30
  ZUORA_CLIENT_SECRET: secret
50
31
  ZUORA_DOMAIN: rest.apisandbox.zuora.com
32
+
33
+ specs_successful:
34
+ name: Specs passing?
35
+ needs: specs
36
+ if: always()
37
+ runs-on: ubuntu-latest
38
+ steps:
39
+ - run: |
40
+ if ${{ needs.specs.result == 'success' }}
41
+ then
42
+ echo "All specs pass"
43
+ else
44
+ echo "Some specs failed"
45
+ false
46
+ fi
47
+
48
+ lint:
49
+ runs-on: ubuntu-latest
50
+ steps:
51
+ - uses: zendesk/checkout@v3
52
+ - name: Set up Ruby
53
+ uses: zendesk/setup-ruby@v1
54
+ with:
55
+ ruby-version: "3.0"
56
+ bundler-cache: true
57
+ - run: bundle exec rake rubocop
@@ -0,0 +1,12 @@
1
+ name: Ruby Gem Publish
2
+
3
+ on:
4
+ push:
5
+ tags: v*
6
+
7
+ jobs:
8
+ call-workflow:
9
+ uses: zendesk/gw/.github/workflows/ruby-gem-publication.yml@main
10
+ secrets:
11
+ RUBY_GEMS_API_KEY: ${{ secrets.RUBY_GEMS_API_KEY }}
12
+ RUBY_GEMS_TOTP_DEVICE: ${{ secrets.RUBY_GEMS_TOTP_DEVICE }}
data/.reek.yml CHANGED
@@ -19,6 +19,7 @@ detectors:
19
19
  - IronBank::Configuration#middlewares
20
20
  - IronBank::Configuration#schema_directory
21
21
  - IronBank::Configuration#users_file
22
+ - IronBank::Configuration#api_minor_version
22
23
 
23
24
  BooleanParameter:
24
25
  exclude:
data/.rubocop.yml CHANGED
@@ -5,6 +5,7 @@ AllCops:
5
5
  DisplayStyleGuide: true
6
6
  NewCops: enable
7
7
  SuggestExtensions: false
8
+ TargetRubyVersion: 2.7
8
9
 
9
10
  Layout/DotPosition:
10
11
  EnforcedStyle: trailing
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.5.8
1
+ 2.7.7
data/Gemfile CHANGED
@@ -11,10 +11,10 @@ gem "dotenv", "~> 2.2"
11
11
  gem "factory_bot", "~> 6.0"
12
12
  gem "pry-byebug", "~> 3.4"
13
13
  gem "rake", "~> 13.0"
14
- gem "reek", "~> 6.0"
15
- gem "rspec", "~> 3.0"
16
- gem "rubocop", "~> 1.0"
17
- gem "rubocop-performance", "~> 1.0"
18
- gem "shoulda-matchers", "~> 4.0"
19
- gem "simplecov", "~> 0.15"
14
+ gem "reek", "~> 6"
15
+ gem "rspec", "~> 3"
16
+ gem "rubocop", "~> 1"
17
+ gem "rubocop-performance", "~> 1"
18
+ gem "shoulda-matchers", "~> 4"
19
+ gem "simplecov", "~> 0.21"
20
20
  gem "timecop", "~> 0.9"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- iron_bank (5.2.6)
4
+ iron_bank (5.4.0)
5
5
  faraday (~> 1)
6
6
  faraday_middleware (~> 1)
7
7
  nokogiri (~> 1)
@@ -9,115 +9,117 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activesupport (6.1.1)
12
+ activesupport (7.0.4.3)
13
13
  concurrent-ruby (~> 1.0, >= 1.0.2)
14
14
  i18n (>= 1.6, < 2)
15
15
  minitest (>= 5.1)
16
16
  tzinfo (~> 2.0)
17
- zeitwerk (~> 2.3)
18
- ast (2.4.1)
17
+ ast (2.4.2)
19
18
  bump (0.10.0)
20
19
  byebug (11.1.3)
21
20
  coderay (1.1.3)
22
- concurrent-ruby (1.1.7)
23
- diff-lcs (1.4.4)
24
- docile (1.3.4)
25
- dotenv (2.7.6)
26
- factory_bot (6.1.0)
21
+ concurrent-ruby (1.2.2)
22
+ diff-lcs (1.5.0)
23
+ docile (1.4.0)
24
+ dotenv (2.8.1)
25
+ factory_bot (6.2.1)
27
26
  activesupport (>= 5.0.0)
28
- faraday (1.8.0)
27
+ faraday (1.10.3)
29
28
  faraday-em_http (~> 1.0)
30
29
  faraday-em_synchrony (~> 1.0)
31
30
  faraday-excon (~> 1.1)
32
- faraday-httpclient (~> 1.0.1)
31
+ faraday-httpclient (~> 1.0)
32
+ faraday-multipart (~> 1.0)
33
33
  faraday-net_http (~> 1.0)
34
- faraday-net_http_persistent (~> 1.1)
34
+ faraday-net_http_persistent (~> 1.0)
35
35
  faraday-patron (~> 1.0)
36
36
  faraday-rack (~> 1.0)
37
- multipart-post (>= 1.2, < 3)
37
+ faraday-retry (~> 1.0)
38
38
  ruby2_keywords (>= 0.0.4)
39
39
  faraday-em_http (1.0.0)
40
40
  faraday-em_synchrony (1.0.0)
41
41
  faraday-excon (1.1.0)
42
42
  faraday-httpclient (1.0.1)
43
+ faraday-multipart (1.0.4)
44
+ multipart-post (~> 2)
43
45
  faraday-net_http (1.0.1)
44
46
  faraday-net_http_persistent (1.2.0)
45
47
  faraday-patron (1.0.0)
46
48
  faraday-rack (1.0.0)
47
- faraday_middleware (1.1.0)
49
+ faraday-retry (1.0.3)
50
+ faraday_middleware (1.2.0)
48
51
  faraday (~> 1.0)
49
- i18n (1.8.7)
52
+ i18n (1.13.0)
50
53
  concurrent-ruby (~> 1.0)
54
+ json (2.6.3)
51
55
  kwalify (0.7.2)
52
56
  method_source (1.0.0)
53
- mini_portile2 (2.6.1)
54
- minitest (5.14.3)
55
- multipart-post (2.1.1)
56
- nokogiri (1.12.5)
57
- mini_portile2 (~> 2.6.1)
57
+ mini_portile2 (2.8.2)
58
+ minitest (5.18.0)
59
+ multipart-post (2.3.0)
60
+ nokogiri (1.14.3)
61
+ mini_portile2 (~> 2.8.0)
58
62
  racc (~> 1.4)
59
- parallel (1.20.1)
60
- parser (3.0.0.0)
63
+ parallel (1.23.0)
64
+ parser (3.2.2.1)
61
65
  ast (~> 2.4.1)
62
- pry (0.13.1)
66
+ pry (0.14.2)
63
67
  coderay (~> 1.1)
64
68
  method_source (~> 1.0)
65
- pry-byebug (3.9.0)
69
+ pry-byebug (3.10.1)
66
70
  byebug (~> 11.0)
67
- pry (~> 0.13.0)
68
- psych (3.3.0)
69
- racc (1.5.2)
70
- rainbow (3.0.0)
71
- rake (13.0.3)
72
- reek (6.0.3)
71
+ pry (>= 0.13, < 0.15)
72
+ racc (1.6.2)
73
+ rainbow (3.1.1)
74
+ rake (13.0.6)
75
+ reek (6.1.4)
73
76
  kwalify (~> 0.7.0)
74
- parser (~> 3.0.0)
75
- psych (~> 3.1)
77
+ parser (~> 3.2.0)
76
78
  rainbow (>= 2.0, < 4.0)
77
- regexp_parser (2.0.3)
78
- rexml (3.2.4)
79
- rspec (3.10.0)
80
- rspec-core (~> 3.10.0)
81
- rspec-expectations (~> 3.10.0)
82
- rspec-mocks (~> 3.10.0)
83
- rspec-core (3.10.1)
84
- rspec-support (~> 3.10.0)
85
- rspec-expectations (3.10.1)
79
+ regexp_parser (2.8.0)
80
+ rexml (3.2.5)
81
+ rspec (3.12.0)
82
+ rspec-core (~> 3.12.0)
83
+ rspec-expectations (~> 3.12.0)
84
+ rspec-mocks (~> 3.12.0)
85
+ rspec-core (3.12.2)
86
+ rspec-support (~> 3.12.0)
87
+ rspec-expectations (3.12.3)
86
88
  diff-lcs (>= 1.2.0, < 2.0)
87
- rspec-support (~> 3.10.0)
88
- rspec-mocks (3.10.1)
89
+ rspec-support (~> 3.12.0)
90
+ rspec-mocks (3.12.5)
89
91
  diff-lcs (>= 1.2.0, < 2.0)
90
- rspec-support (~> 3.10.0)
91
- rspec-support (3.10.1)
92
- rubocop (1.8.1)
92
+ rspec-support (~> 3.12.0)
93
+ rspec-support (3.12.0)
94
+ rubocop (1.50.2)
95
+ json (~> 2.3)
93
96
  parallel (~> 1.10)
94
- parser (>= 3.0.0.0)
97
+ parser (>= 3.2.0.0)
95
98
  rainbow (>= 2.2.2, < 4.0)
96
99
  regexp_parser (>= 1.8, < 3.0)
97
- rexml
98
- rubocop-ast (>= 1.2.0, < 2.0)
100
+ rexml (>= 3.2.5, < 4.0)
101
+ rubocop-ast (>= 1.28.0, < 2.0)
99
102
  ruby-progressbar (~> 1.7)
100
- unicode-display_width (>= 1.4.0, < 3.0)
101
- rubocop-ast (1.4.0)
102
- parser (>= 2.7.1.5)
103
- rubocop-performance (1.9.2)
104
- rubocop (>= 0.90.0, < 2.0)
103
+ unicode-display_width (>= 2.4.0, < 3.0)
104
+ rubocop-ast (1.28.1)
105
+ parser (>= 3.2.1.0)
106
+ rubocop-performance (1.17.1)
107
+ rubocop (>= 1.7.0, < 2.0)
105
108
  rubocop-ast (>= 0.4.0)
106
- ruby-progressbar (1.11.0)
109
+ ruby-progressbar (1.13.0)
107
110
  ruby2_keywords (0.0.5)
108
- shoulda-matchers (4.5.0)
111
+ shoulda-matchers (4.5.1)
109
112
  activesupport (>= 4.2.0)
110
- simplecov (0.21.2)
113
+ simplecov (0.22.0)
111
114
  docile (~> 1.1)
112
115
  simplecov-html (~> 0.11)
113
116
  simplecov_json_formatter (~> 0.1)
114
117
  simplecov-html (0.12.3)
115
- simplecov_json_formatter (0.1.2)
116
- timecop (0.9.2)
117
- tzinfo (2.0.4)
118
+ simplecov_json_formatter (0.1.4)
119
+ timecop (0.9.6)
120
+ tzinfo (2.0.6)
118
121
  concurrent-ruby (~> 1.0)
119
- unicode-display_width (2.0.0)
120
- zeitwerk (2.4.2)
122
+ unicode-display_width (2.4.2)
121
123
 
122
124
  PLATFORMS
123
125
  ruby
@@ -130,13 +132,13 @@ DEPENDENCIES
130
132
  iron_bank!
131
133
  pry-byebug (~> 3.4)
132
134
  rake (~> 13.0)
133
- reek (~> 6.0)
134
- rspec (~> 3.0)
135
- rubocop (~> 1.0)
136
- rubocop-performance (~> 1.0)
137
- shoulda-matchers (~> 4.0)
138
- simplecov (~> 0.15)
135
+ reek (~> 6)
136
+ rspec (~> 3)
137
+ rubocop (~> 1)
138
+ rubocop-performance (~> 1)
139
+ shoulda-matchers (~> 4)
140
+ simplecov (~> 0.21)
139
141
  timecop (~> 0.9)
140
142
 
141
143
  BUNDLED WITH
142
- 2.2.26
144
+ 2.3.16
data/README.md CHANGED
@@ -13,7 +13,7 @@ This gem provides opinionated resources to interact with the Zuora API through
13
13
  their REST interface. It defines **associations** between them, as well as a
14
14
  simple **declaration API** (`with_one`, `with_many`) to extend them.
15
15
 
16
- This gem is tested against Ruby `>= 2.5`.
16
+ This gem is tested against Ruby `>= 2.6`.
17
17
 
18
18
  Please use [GitHub Issues][issues] to report bugs.
19
19
 
data/Rakefile CHANGED
@@ -33,7 +33,7 @@ task :excluded_fields, [:filename] do |_t, args|
33
33
  destination = args[:filename] || IronBank.configuration.excluded_fields_file
34
34
  fields = IronBank::Schema.excluded_fields.sort.to_h
35
35
 
36
- File.open(destination, "w") { |file| file.write(Psych.dump(fields)) }
36
+ File.write(destination, Psych.dump(fields))
37
37
  end
38
38
 
39
39
  # Helper function to set up an `IronBank::Client` instance
@@ -42,10 +42,10 @@ def setup_iron_bank
42
42
  require "iron_bank"
43
43
 
44
44
  IronBank.configure do |config|
45
- config.client_id = ENV["ZUORA_CLIENT_ID"]
46
- config.client_secret = ENV["ZUORA_CLIENT_SECRET"]
45
+ config.client_id = ENV.fetch("ZUORA_CLIENT_ID", nil)
46
+ config.client_secret = ENV.fetch("ZUORA_CLIENT_SECRET", nil)
47
47
  config.auth_type = ENV.fetch("ZUORA_AUTH_TYPE", "token")
48
- config.domain = ENV["ZUORA_DOMAIN"]
49
- config.excluded_fields_file = ENV["ZUORA_EXCLUDED_FIELDS_FILE"]
48
+ config.domain = ENV.fetch("ZUORA_DOMAIN", nil)
49
+ config.excluded_fields_file = ENV.fetch("ZUORA_EXCLUDED_FIELDS_FILE", nil)
50
50
  end
51
51
  end
data/bin/console CHANGED
@@ -7,12 +7,12 @@ require "iron_bank"
7
7
  require "pry-byebug"
8
8
 
9
9
  IronBank.configure do |config|
10
- config.client_id = ENV["ZUORA_CLIENT_ID"]
11
- config.client_secret = ENV["ZUORA_CLIENT_SECRET"]
10
+ config.client_id = ENV.fetch("ZUORA_CLIENT_ID", nil)
11
+ config.client_secret = ENV.fetch("ZUORA_CLIENT_SECRET", nil)
12
12
  config.auth_type = ENV.fetch("ZUORA_AUTH_TYPE", "token")
13
- config.domain = ENV["ZUORA_DOMAIN"]
14
- config.excluded_fields_file = ENV["ZUORA_EXCLUDED_FIELDS_FILE"]
15
- config.users_file = ENV["ZUORA_USERS_FILE"]
13
+ config.domain = ENV.fetch("ZUORA_DOMAIN", nil)
14
+ config.excluded_fields_file = ENV.fetch("ZUORA_EXCLUDED_FIELDS_FILE", nil)
15
+ config.users_file = ENV.fetch("ZUORA_USERS_FILE", nil)
16
16
  end
17
17
 
18
18
  Pry.start
data/iron_bank.gemspec CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
19
19
  "mturan@zendesk.com"
20
20
  ]
21
21
 
22
- spec.required_ruby_version = ">= 2.5"
22
+ spec.required_ruby_version = ">= 2.7"
23
23
 
24
24
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
25
25
  f.match(%r{^(test|spec|features)/})
@@ -32,4 +32,5 @@ Gem::Specification.new do |spec|
32
32
  spec.add_dependency "faraday", "~> 1"
33
33
  spec.add_dependency "faraday_middleware", "~> 1"
34
34
  spec.add_dependency "nokogiri", "~> 1"
35
+ spec.metadata["rubygems_mfa_required"] = "true"
35
36
  end
@@ -39,13 +39,11 @@ module IronBank
39
39
  end
40
40
 
41
41
  def response_object
42
- @response_object ||= begin
43
- if body.is_a?(Array)
44
- ::IronBank::Object.new(body.first).deep_underscore
45
- else
46
- {}
47
- end
48
- end
42
+ @response_object ||= if body.is_a?(Array)
43
+ ::IronBank::Object.new(body.first).deep_underscore
44
+ else
45
+ {}
46
+ end
49
47
  end
50
48
 
51
49
  def errors
@@ -9,7 +9,7 @@ module IronBank
9
9
  private
10
10
 
11
11
  def params
12
- { 'queryLocator': args }
12
+ { queryLocator: args }
13
13
  end
14
14
 
15
15
  # NOTE: Zuora API endpoint is case-sensitive.
@@ -99,7 +99,11 @@ module IronBank
99
99
  end
100
100
 
101
101
  def headers
102
- { "Content-Type" => "application/json" }.merge(auth.header)
102
+ config = IronBank.configuration
103
+ auth.header.reverse_merge(
104
+ "Content-Type" => "application/json",
105
+ "zuora-version" => config.api_minor_version
106
+ )
103
107
  end
104
108
 
105
109
  def reset_connection
@@ -12,7 +12,8 @@ module IronBank
12
12
  :empty?,
13
13
  :length,
14
14
  :map,
15
- :size
15
+ :size,
16
+ :to_ary
16
17
 
17
18
  def initialize(klass, conditions, records)
18
19
  @klass = klass
@@ -37,12 +37,16 @@ module IronBank
37
37
  # File path for Zuora users export
38
38
  attr_accessor :users_file
39
39
 
40
+ # Specify a minor version
41
+ attr_accessor :api_minor_version
42
+
40
43
  def initialize
41
- @schema_directory = "./config/schema"
42
- @export_directory = "./config/export"
43
- @logger = IronBank::Logger.new
44
- @auth_type = "token"
45
- @middlewares = []
44
+ @schema_directory = "./config/schema"
45
+ @export_directory = "./config/export"
46
+ @logger = IronBank::Logger.new
47
+ @auth_type = "token"
48
+ @middlewares = []
49
+ @api_minor_version = "211.0"
46
50
  end
47
51
 
48
52
  def schema_directory=(value)
@@ -94,10 +98,8 @@ module IronBank
94
98
  return {}
95
99
  end
96
100
 
97
- @excluded_fields ||= begin
98
- Psych.load_file(excluded_fields_file).tap do |fields|
99
- raise "Excluded fields must be a hash" unless fields.is_a?(Hash)
100
- end
101
+ @excluded_fields ||= Psych.load_file(excluded_fields_file).tap do |fields|
102
+ raise "Excluded fields must be a hash" unless fields.is_a?(Hash)
101
103
  end
102
104
  end
103
105
  end
@@ -6,20 +6,18 @@ module IronBank
6
6
  # Returns the appropriate IronBank::Error subclass based on status and
7
7
  # response message
8
8
  def self.from_response(response)
9
- klass = begin
10
- case response.status
11
- when 200 then from_body(response)
12
- when 400 then IronBank::BadRequestError
13
- when 401 then IronBank::UnauthorizedError
14
- when 404 then IronBank::NotFoundError
15
- when 422 then IronBank::UnprocessableEntityError
16
- when 429 then IronBank::TooManyRequestsError
17
- when 500 then IronBank::InternalServerError
18
- when 400..499 then IronBank::ClientError
19
- when 500..599 then IronBank::ServerError
20
- else IronBank::Error
21
- end
22
- end
9
+ klass = case response.status
10
+ when 200 then from_body(response)
11
+ when 400 then IronBank::BadRequestError
12
+ when 401 then IronBank::UnauthorizedError
13
+ when 404 then IronBank::NotFoundError
14
+ when 422 then IronBank::UnprocessableEntityError
15
+ when 429 then IronBank::TooManyRequestsError
16
+ when 500 then IronBank::InternalServerError
17
+ when 400..499 then IronBank::ClientError
18
+ when 500..599 then IronBank::ServerError
19
+ else IronBank::Error
20
+ end
23
21
 
24
22
  klass&.new(response)
25
23
  end
@@ -18,7 +18,7 @@ module IronBank
18
18
  end
19
19
 
20
20
  def self.export
21
- FileUtils.mkdir_p(directory) unless Dir.exist?(directory)
21
+ FileUtils.mkdir_p(directory)
22
22
  RESOURCE_QUERY_FIELDS.each_key { |resource| new(resource).save_file }
23
23
  end
24
24
 
@@ -28,9 +28,11 @@ module IronBank
28
28
  sleep backoff_time
29
29
  end
30
30
 
31
+ # rubocop:disable Style/FileWrite
31
32
  File.open(file_path, "w") do |file|
32
33
  file.write(export.content.force_encoding("UTF-8"))
33
34
  end
35
+ # rubocop:enable Style/FileWrite
34
36
  end
35
37
 
36
38
  private
@@ -64,7 +64,7 @@ module IronBank
64
64
 
65
65
  def ensure_range_single_condition
66
66
  return if conditions.count <= 1
67
- return unless conditions.values.any? { |value| value.is_a?(Array) }
67
+ return unless conditions.values.any?(Array)
68
68
 
69
69
  raise "Filter ranges must be used in isolation."
70
70
  end
@@ -12,7 +12,7 @@ module IronBank
12
12
  end
13
13
 
14
14
  def self.export
15
- FileUtils.mkdir_p(directory) unless Dir.exist?(directory)
15
+ FileUtils.mkdir_p(directory)
16
16
  new(IronBank.client).export
17
17
  reset
18
18
  import
@@ -39,11 +39,9 @@ module IronBank
39
39
  end
40
40
 
41
41
  def self.excluded_fields
42
- @excluded_fields ||= begin
43
- IronBank::Resources.constants.each.with_object({}) do |resource, fields|
44
- fields[resource.to_s] =
45
- IronBank::Describe::ExcludedFields.call(object_name: resource)
46
- end
42
+ @excluded_fields ||= IronBank::Resources.constants.each.with_object({}) do |resource, fields|
43
+ fields[resource.to_s] =
44
+ IronBank::Describe::ExcludedFields.call(object_name: resource)
47
45
  end
48
46
  end
49
47
 
@@ -16,14 +16,12 @@ module IronBank
16
16
  def store
17
17
  return {} unless users_file
18
18
 
19
- @store ||= begin
20
- if File.exist?(users_file)
21
- load_records
22
- else
23
- IronBank.logger.warn "File does not exist: #{users_file}"
24
- {}
25
- end
26
- end
19
+ @store ||= if File.exist?(users_file)
20
+ load_records
21
+ else
22
+ IronBank.logger.warn "File does not exist: #{users_file}"
23
+ {}
24
+ end
27
25
  end
28
26
 
29
27
  def load_records
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module IronBank
4
- VERSION = "5.2.6"
4
+ VERSION = "5.4.0"
5
5
  API_VERSION = "v1"
6
6
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron_bank
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.6
4
+ version: 5.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mickael Pham
8
8
  - Cheng Cui
9
9
  - Ryan Ringler
10
10
  - Mustafa Turan
11
- autorequire:
11
+ autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2021-10-12 00:00:00.000000000 Z
14
+ date: 2023-05-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday
@@ -55,7 +55,7 @@ dependencies:
55
55
  - - "~>"
56
56
  - !ruby/object:Gem::Version
57
57
  version: '1'
58
- description:
58
+ description:
59
59
  email:
60
60
  - mickael@zendesk.com
61
61
  - ccui@zendesk.com
@@ -69,6 +69,7 @@ files:
69
69
  - ".github/CODEOWNERS"
70
70
  - ".github/PULL_REQUEST_TEMPLATE.md"
71
71
  - ".github/workflows/ci.yml"
72
+ - ".github/workflows/ruby-gem-publication.yml"
72
73
  - ".gitignore"
73
74
  - ".reek.yml"
74
75
  - ".rspec"
@@ -154,8 +155,9 @@ files:
154
155
  homepage: https://github.com/zendesk/iron_bank
155
156
  licenses:
156
157
  - Apache-2.0
157
- metadata: {}
158
- post_install_message:
158
+ metadata:
159
+ rubygems_mfa_required: 'true'
160
+ post_install_message:
159
161
  rdoc_options: []
160
162
  require_paths:
161
163
  - lib
@@ -163,16 +165,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
163
165
  requirements:
164
166
  - - ">="
165
167
  - !ruby/object:Gem::Version
166
- version: '2.5'
168
+ version: '2.7'
167
169
  required_rubygems_version: !ruby/object:Gem::Requirement
168
170
  requirements:
169
171
  - - ">="
170
172
  - !ruby/object:Gem::Version
171
173
  version: '0'
172
174
  requirements: []
173
- rubyforge_project:
174
- rubygems_version: 2.7.6.2
175
- signing_key:
175
+ rubygems_version: 3.0.3.1
176
+ signing_key:
176
177
  specification_version: 4
177
178
  summary: An opinionated Ruby interface to the Zuora API.
178
179
  test_files: []