iron_bank 2.2.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/.env.example +0 -2
  3. data/.gitignore +0 -1
  4. data/.reek.yml +5 -15
  5. data/.rspec +1 -0
  6. data/.rubocop.yml +9 -4
  7. data/.ruby-version +1 -0
  8. data/.travis.yml +4 -4
  9. data/Gemfile +1 -1
  10. data/Gemfile.lock +134 -0
  11. data/README.md +34 -14
  12. data/Rakefile +11 -16
  13. data/bin/console +8 -8
  14. data/iron_bank.gemspec +32 -34
  15. data/lib/generators/iron_bank/install/install_generator.rb +4 -4
  16. data/lib/generators/iron_bank/install/templates/iron_bank.rb +6 -6
  17. data/lib/iron_bank/action.rb +1 -1
  18. data/lib/iron_bank/actions/query_more.rb +1 -1
  19. data/lib/iron_bank/associations.rb +2 -2
  20. data/lib/iron_bank/authentication.rb +1 -1
  21. data/lib/iron_bank/authentications/cookie.rb +7 -7
  22. data/lib/iron_bank/authentications/token.rb +9 -9
  23. data/lib/iron_bank/cacheable.rb +1 -0
  24. data/lib/iron_bank/client.rb +6 -10
  25. data/lib/iron_bank/collection.rb +1 -0
  26. data/lib/iron_bank/configuration.rb +8 -19
  27. data/lib/iron_bank/csv.rb +2 -2
  28. data/lib/iron_bank/describe/field.rb +2 -2
  29. data/lib/iron_bank/describe/object.rb +5 -5
  30. data/lib/iron_bank/describe/related.rb +3 -3
  31. data/lib/iron_bank/describe/tenant.rb +2 -2
  32. data/lib/iron_bank/endpoint.rb +3 -3
  33. data/lib/iron_bank/error.rb +17 -17
  34. data/lib/iron_bank/local.rb +15 -7
  35. data/lib/iron_bank/local_records.rb +58 -20
  36. data/lib/iron_bank/logger.rb +3 -3
  37. data/lib/iron_bank/operation.rb +1 -1
  38. data/lib/iron_bank/query_builder.rb +4 -4
  39. data/lib/iron_bank/resource.rb +2 -7
  40. data/lib/iron_bank/resources/account.rb +6 -6
  41. data/lib/iron_bank/resources/export.rb +23 -0
  42. data/lib/iron_bank/resources/product_rate_plan.rb +2 -1
  43. data/lib/iron_bank/resources/product_rate_plan_charge_tier.rb +0 -44
  44. data/lib/iron_bank/resources/rate_plan_charge.rb +1 -1
  45. data/lib/iron_bank/resources/subscription.rb +4 -4
  46. data/lib/iron_bank/resources/usage.rb +1 -1
  47. data/lib/iron_bank/utils.rb +5 -5
  48. data/lib/iron_bank/version.rb +2 -2
  49. data/lib/iron_bank.rb +67 -75
  50. metadata +21 -52
  51. data/lib/iron_bank/instrumentation.rb +0 -14
  52. data/lib/iron_bank/open_tracing.rb +0 -18
  53. data/lib/iron_bank/resources/catalog_tiers/discount_amount.rb +0 -26
  54. data/lib/iron_bank/resources/catalog_tiers/discount_percentage.rb +0 -26
  55. data/lib/iron_bank/resources/catalog_tiers/price.rb +0 -26
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5c9852ebba532db566a9ed0bbf43d99d5b50365f
4
- data.tar.gz: 9990defc4ab42f7d0974a6fd5ce47f0891e1164d
3
+ metadata.gz: dd0a8bbdf58674ed00c1fae75779154686d68169
4
+ data.tar.gz: 3e717805b232af39c08d5a25fced3a37695575e1
5
5
  SHA512:
6
- metadata.gz: 2591ae85f81d91d81d8663995d5db8a0a00a5e2b3b58e4f62d05c0ec5505f62d8ce13d694468f7f5ec708d8387febc09b4cd37a73180a829f35b26affe19add4
7
- data.tar.gz: 15cb858aa462d1904cb20d26493d04ff25a201194d0ec81ea8dba8b4ee0c7b786ae543e313110e2221ad9e02807c3ce74fddfeda47257c49114890c9d5e1193b
6
+ metadata.gz: 0f3095ab197020b4c66cdc90cfdf92778468d94d091f757cd1aa2fc08ca8bfbd1aad0b6c67a5ed9b254d0f4628ba3ad37c27f92368f9452d342dd06631284636
7
+ data.tar.gz: d64a053dbb6d9d1de5fdad2eddfab54a5e37b90ebee73ee06c168465a5396b9f73fd0726be315a5a731cf950f506d82b00d4f8849d40a0d229ad4b36cf59336f
data/.env.example CHANGED
@@ -3,5 +3,3 @@ ZUORA_CLIENT_SECRET=secret
3
3
  ZUORA_AUTH_TYPE=token
4
4
  ZUORA_DOMAIN=rest.apisandbox.zuora.com
5
5
  ZUORA_TENANT_ID=00000
6
- OPEN_TRACING_ENABLED=false
7
- OPEN_TRACING_SERVICE_NAME=ironbank
data/.gitignore CHANGED
@@ -1,6 +1,5 @@
1
1
  /.bundle/
2
2
  /.yardoc
3
- /Gemfile.lock
4
3
  /_yardoc/
5
4
  /coverage/
6
5
  /doc/
data/.reek.yml CHANGED
@@ -1,5 +1,4 @@
1
1
  ---
2
-
3
2
  # Exclude vendor/bundle directory for Travis
4
3
  exclude_paths:
5
4
  - vendor/bundle
@@ -15,12 +14,8 @@ detectors:
15
14
  - IronBank::Configuration#client_secret
16
15
  - IronBank::Configuration#domain
17
16
  - IronBank::Configuration#export_directory
18
- - IronBank::Configuration#instrumenter
19
- - IronBank::Configuration#instrumenter_options
20
17
  - IronBank::Configuration#logger
21
- - IronBank::Configuration#open_tracing_enabled
22
- - IronBank::Configuration#open_tracing_service_name
23
- - IronBank::Configuration#retry_options
18
+ - IronBank::Configuration#middlewares
24
19
  - IronBank::Configuration#schema_directory
25
20
 
26
21
  BooleanParameter:
@@ -43,6 +38,7 @@ detectors:
43
38
  - IronBank::Object#underscore
44
39
  - IronBank::Actions::Subscribe#hash_args
45
40
  - IronBank::Utils#camelize
41
+ - IronBank::Local#underscore_header
46
42
 
47
43
  InstanceVariableAssumption:
48
44
  exclude:
@@ -60,9 +56,11 @@ detectors:
60
56
  exclude:
61
57
  - IronBank::Schema#self.import
62
58
  - IronBank::Local#where
63
- - IronBank::Local#load_records
64
59
  - IronBank::LocalRecords#export
65
60
  - IronBank::Resources::ProductRatePlanChargeTier#self.load_records
61
+ - IronBank::Client#connection
62
+ - IronBank::Authentications::Token#connection
63
+ - IronBank::Authentications::Cookie#connection
66
64
 
67
65
  NilCheck:
68
66
  enabled: false
@@ -89,20 +87,12 @@ detectors:
89
87
  - IronBank::Resources::ProductRatePlanChargeTier#self.load_records
90
88
  - IronBank::Error#self.from_response
91
89
 
92
- UncommunicativeVariableName:
93
- exclude:
94
- - IronBank::Local#csv_options
95
-
96
90
  UtilityFunction:
97
91
  exclude:
98
92
  - IronBank::Cacheable::ClassMethods#cache
99
93
  - IronBank::Object#convert
100
94
  - IronBank::Object#camelize_array
101
95
  - IronBank::Object#underscore_array
102
- - IronBank::OpenTracing#open_tracing_enabled?
103
- - IronBank::OpenTracing#open_tracing_options
104
96
  - IronBank::QueryBuilder#range_query_builder
105
97
  - IronBank::Utils#lower_camelize
106
98
  - IronBank::Utils#upper_camelize
107
- - IronBank::Instrumentation#instrumenter
108
- - IronBank::Instrumentation#instrumenter_options
data/.rspec CHANGED
@@ -1,2 +1,3 @@
1
1
  --format progress
2
2
  --color
3
+ --require spec_helper
data/.rubocop.yml CHANGED
@@ -1,7 +1,9 @@
1
+ require: rubocop-performance
2
+
1
3
  AllCops:
2
4
  DisplayCopNames: true
3
5
  DisplayStyleGuide: true
4
- TargetRubyVersion: 2.3
6
+ TargetRubyVersion: 2.4
5
7
 
6
8
  Layout/DotPosition:
7
9
  EnforcedStyle: trailing
@@ -44,6 +46,10 @@ Metrics/LineLength:
44
46
  Style/ClassAndModuleChildren:
45
47
  EnforcedStyle: nested
46
48
 
49
+ Style/MixinUsage:
50
+ Exclude:
51
+ - lib/iron_bank/resource.rb
52
+
47
53
  Style/OptionalArguments:
48
54
  Exclude:
49
55
  - lib/iron_bank/local.rb
@@ -54,6 +60,5 @@ Style/RescueStandardError:
54
60
  Exclude:
55
61
  - lib/iron_bank/csv.rb
56
62
 
57
- Style/MixinUsage:
58
- Exclude:
59
- - lib/iron_bank/resource.rb
63
+ Style/StringLiterals:
64
+ EnforcedStyle: double_quotes
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.4.6
data/.travis.yml CHANGED
@@ -3,9 +3,9 @@ cache: bundler
3
3
  language: ruby
4
4
 
5
5
  rvm:
6
- - 2.3.8
7
- - 2.4.5
8
- - 2.5.3
6
+ - 2.4.6
7
+ - 2.5.5
8
+ - 2.6.2
9
9
 
10
10
  sudo: false
11
11
 
@@ -14,7 +14,7 @@ branches:
14
14
 
15
15
  before_install:
16
16
  - gem update --system
17
- - gem install bundler
17
+ - gem install bundler --no-document
18
18
 
19
19
  env:
20
20
  global:
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in zuora.gemspec
6
6
  gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,134 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ iron_bank (3.0.0)
5
+ faraday (~> 0)
6
+ faraday_middleware (~> 0)
7
+ nokogiri (~> 1)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ activesupport (5.2.3)
13
+ concurrent-ruby (~> 1.0, >= 1.0.2)
14
+ i18n (>= 0.7, < 2)
15
+ minitest (~> 5.1)
16
+ tzinfo (~> 1.1)
17
+ ast (2.4.0)
18
+ axiom-types (0.1.1)
19
+ descendants_tracker (~> 0.0.4)
20
+ ice_nine (~> 0.11.0)
21
+ thread_safe (~> 0.3, >= 0.3.1)
22
+ bump (0.8.0)
23
+ byebug (11.0.1)
24
+ codeclimate-engine-rb (0.4.1)
25
+ virtus (~> 1.0)
26
+ coderay (1.1.2)
27
+ coercible (1.0.0)
28
+ descendants_tracker (~> 0.0.1)
29
+ concurrent-ruby (1.1.5)
30
+ descendants_tracker (0.0.4)
31
+ thread_safe (~> 0.3, >= 0.3.1)
32
+ diff-lcs (1.3)
33
+ docile (1.3.1)
34
+ dotenv (2.7.2)
35
+ equalizer (0.0.11)
36
+ factory_bot (5.0.2)
37
+ activesupport (>= 4.2.0)
38
+ faraday (0.15.4)
39
+ multipart-post (>= 1.2, < 3)
40
+ faraday_middleware (0.13.1)
41
+ faraday (>= 0.7.4, < 1.0)
42
+ i18n (1.6.0)
43
+ concurrent-ruby (~> 1.0)
44
+ ice_nine (0.11.2)
45
+ jaro_winkler (1.5.2)
46
+ json (2.2.0)
47
+ kwalify (0.7.2)
48
+ method_source (0.9.2)
49
+ mini_portile2 (2.4.0)
50
+ minitest (5.11.3)
51
+ multipart-post (2.0.0)
52
+ nokogiri (1.10.2)
53
+ mini_portile2 (~> 2.4.0)
54
+ parallel (1.17.0)
55
+ parser (2.6.2.1)
56
+ ast (~> 2.4.0)
57
+ pry (0.12.2)
58
+ coderay (~> 1.1.0)
59
+ method_source (~> 0.9.0)
60
+ pry-byebug (3.7.0)
61
+ byebug (~> 11.0)
62
+ pry (~> 0.10)
63
+ psych (3.1.0)
64
+ rainbow (3.0.0)
65
+ rake (12.3.2)
66
+ reek (5.3.2)
67
+ codeclimate-engine-rb (~> 0.4.0)
68
+ kwalify (~> 0.7.0)
69
+ parser (>= 2.5.0.0, < 2.7, != 2.5.1.1)
70
+ psych (~> 3.1.0)
71
+ rainbow (>= 2.0, < 4.0)
72
+ rspec (3.8.0)
73
+ rspec-core (~> 3.8.0)
74
+ rspec-expectations (~> 3.8.0)
75
+ rspec-mocks (~> 3.8.0)
76
+ rspec-core (3.8.0)
77
+ rspec-support (~> 3.8.0)
78
+ rspec-expectations (3.8.2)
79
+ diff-lcs (>= 1.2.0, < 2.0)
80
+ rspec-support (~> 3.8.0)
81
+ rspec-mocks (3.8.0)
82
+ diff-lcs (>= 1.2.0, < 2.0)
83
+ rspec-support (~> 3.8.0)
84
+ rspec-support (3.8.0)
85
+ rubocop (0.67.2)
86
+ jaro_winkler (~> 1.5.1)
87
+ parallel (~> 1.10)
88
+ parser (>= 2.5, != 2.5.1.1)
89
+ psych (>= 3.1.0)
90
+ rainbow (>= 2.2.2, < 4.0)
91
+ ruby-progressbar (~> 1.7)
92
+ unicode-display_width (>= 1.4.0, < 1.6)
93
+ rubocop-performance (1.0.0)
94
+ rubocop (>= 0.58.0)
95
+ ruby-progressbar (1.10.0)
96
+ shoulda-matchers (4.0.1)
97
+ activesupport (>= 4.2.0)
98
+ simplecov (0.16.1)
99
+ docile (~> 1.1)
100
+ json (>= 1.8, < 3)
101
+ simplecov-html (~> 0.10.0)
102
+ simplecov-html (0.10.2)
103
+ thread_safe (0.3.6)
104
+ timecop (0.9.1)
105
+ tzinfo (1.2.5)
106
+ thread_safe (~> 0.1)
107
+ unicode-display_width (1.5.0)
108
+ virtus (1.0.5)
109
+ axiom-types (~> 0.1)
110
+ coercible (~> 1.0)
111
+ descendants_tracker (~> 0.0, >= 0.0.3)
112
+ equalizer (~> 0.0, >= 0.0.9)
113
+
114
+ PLATFORMS
115
+ ruby
116
+
117
+ DEPENDENCIES
118
+ bump (~> 0.5)
119
+ bundler (~> 2.0)
120
+ dotenv (~> 2.2)
121
+ factory_bot (~> 5.0)
122
+ iron_bank!
123
+ pry-byebug (~> 3.4)
124
+ rake (~> 12.0)
125
+ reek (~> 5.0)
126
+ rspec (~> 3.0)
127
+ rubocop (~> 0.67)
128
+ rubocop-performance (~> 1.0)
129
+ shoulda-matchers (~> 4.0)
130
+ simplecov (~> 0.15)
131
+ timecop (~> 0.9.0)
132
+
133
+ BUNDLED WITH
134
+ 2.0.1
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.3.8`.
16
+ This gem is tested against Ruby `>= 2.4`.
17
17
 
18
18
  Please use [GitHub Issues][issues] to report bugs.
19
19
 
@@ -31,7 +31,7 @@ configuration) when using it within [Rails][rails-website].
31
31
 
32
32
  Add the gem to your `Gemfile` with:
33
33
 
34
- ```ruby
34
+ ```rb
35
35
  gem 'iron_bank'
36
36
  ```
37
37
 
@@ -44,9 +44,31 @@ $ rails generate iron_bank:install
44
44
  Use the `client_id` and `client_secret` from your Zuora OAuth client and add
45
45
  them to the generated `config/initializers/iron_bank.rb` file.
46
46
 
47
+ ## Configuration
48
+
49
+ ```rb
50
+ # Configure Ironbank
51
+ IronBank.configure do |config|
52
+ config.client_id = 'client_id'
53
+ config.client_secret = 'client_secret'
54
+ config.auth_type = 'auth_type'
55
+ config.domain = 'zuora-domain' # zuora doamin
56
+ config.export_directory = 'directory-path' # export directory path
57
+ config.schema_directory = 'directory-path' # schema drirectory path
58
+
59
+ # Ironbank uses Faraday to send request to Zuora. Middlewares can be specified
60
+ # by adding the class name and class options to the `middlewares`
61
+ # configuration.
62
+ # Faraday middlewares, we can send in an array with cutomer middleware class
63
+ # and options
64
+ config.middlewares << [DummyMiddlewareClass, {}]
65
+ end
66
+
67
+ ```
68
+
47
69
  ## Usage
48
70
 
49
- ```ruby
71
+ ```rb
50
72
  # make a query to Zuora using ZOQL
51
73
  IronBank::Query.call "select Name from Account where Id='zuora-account-id'"
52
74
 
@@ -73,7 +95,7 @@ it locally so that product catalog and related object queries look for
73
95
 
74
96
  You can export your product catalog locally using the `LocalRecords` class:
75
97
 
76
- ```ruby
98
+ ```rb
77
99
  # Save CSV files in the directory specified by `config.export_directory`
78
100
  IronBank::LocalRecords.export
79
101
  ```
@@ -81,7 +103,7 @@ IronBank::LocalRecords.export
81
103
  Then, making a query/looking for a record will first search through the local
82
104
  records, then default to the API if no records are found.
83
105
 
84
- ```ruby
106
+ ```rb
85
107
  product = IronBank::Product.find 'zuora-product-id'
86
108
  # => #<IronBank::Resources::Product>
87
109
 
@@ -112,7 +134,6 @@ https://github.com/zendesk/iron_bank.
112
134
  the metadata showing `<selectable>true</selectable>`, hence it has been added
113
135
  to the `exclude_fields` method.
114
136
 
115
-
116
137
  ## Copyright and license
117
138
 
118
139
  Copyright 2018 Zendesk, Inc.
@@ -128,12 +149,11 @@ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
128
149
  CONDITIONS OF ANY KIND, either express or implied. See the License for the
129
150
  specific language governing permissions and limitations under the License.
130
151
 
131
-
132
- [issues]: https://github.com/zendesk/iron_bank/issues
133
- [travis-status]: https://travis-ci.com/zendesk/iron_bank.svg?token=Qzkq5papoR7sdedznjeb&branch=master
134
- [travis-build]: https://travis-ci.com/zendesk/iron_bank
135
- [zuora-describe]: https://www.zuora.com/developer/api-reference/#tag/Describe
136
- [zuora-dev]: https://developer.zuora.com
152
+ [issues]: https://github.com/zendesk/iron_bank/issues
153
+ [travis-status]: https://travis-ci.com/zendesk/iron_bank.svg?token=Qzkq5papoR7sdedznjeb&branch=master
154
+ [travis-build]: https://travis-ci.com/zendesk/iron_bank
155
+ [zuora-describe]: https://www.zuora.com/developer/api-reference/#tag/Describe
156
+ [zuora-dev]: https://developer.zuora.com
137
157
  [zuora-doc-oauth]: https://knowledgecenter.zuora.com/CF_Users_and_Administrators/A_Administrator_Settings/Manage_Users#Create_an_OAuth_Client_for_a_User
138
- [zuora-website]: https://www.zuora.com
139
- [rails-website]: https://rubyonrails.org/
158
+ [zuora-website]: https://www.zuora.com
159
+ [rails-website]: https://rubyonrails.org/
data/Rakefile CHANGED
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'reek/rake/task'
4
- require 'rspec/core/rake_task'
5
- require 'rubocop/rake_task'
6
- require 'bump/tasks'
3
+ require "reek/rake/task"
4
+ require "rspec/core/rake_task"
5
+ require "rubocop/rake_task"
6
+ require "bump/tasks"
7
7
 
8
8
  Reek::Rake::Task.new do |reek|
9
9
  reek.fail_on_error = true
@@ -19,22 +19,17 @@ task test: :spec
19
19
 
20
20
  task default: %i[rubocop reek spec]
21
21
 
22
- desc 'Delete the VCR cassettes folder'
23
- task :clean do
24
- sh 'rm -rf spec/vcr'
25
- end
26
-
27
- desc 'Export the Zuora Schema using the Describe API'
22
+ desc "Export the Zuora Schema using the Describe API"
28
23
  task :export_schema do
29
- require 'dotenv/load'
30
- require 'iron_bank'
24
+ require "dotenv/load"
25
+ require "iron_bank"
31
26
 
32
27
  # Set up the client
33
28
  IronBank.client = IronBank::Client.new(
34
- domain: ENV['ZUORA_DOMAIN'],
35
- client_id: ENV['ZUORA_CLIENT_ID'],
36
- client_secret: ENV['ZUORA_CLIENT_SECRET'],
37
- auth_type: ENV['ZUORA_AUTH_TYPE']
29
+ domain: ENV["ZUORA_DOMAIN"],
30
+ client_id: ENV["ZUORA_CLIENT_ID"],
31
+ client_secret: ENV["ZUORA_CLIENT_SECRET"],
32
+ auth_type: ENV["ZUORA_AUTH_TYPE"]
38
33
  )
39
34
 
40
35
  IronBank::Schema.export
data/bin/console CHANGED
@@ -1,16 +1,16 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'dotenv/load'
5
- require 'bundler/setup'
6
- require 'iron_bank'
7
- require 'pry-byebug'
4
+ require "dotenv/load"
5
+ require "bundler/setup"
6
+ require "iron_bank"
7
+ require "pry-byebug"
8
8
 
9
9
  credentials = {
10
- domain: ENV['ZUORA_DOMAIN'],
11
- client_id: ENV['ZUORA_CLIENT_ID'],
12
- client_secret: ENV['ZUORA_CLIENT_SECRET'],
13
- auth_type: ENV['ZUORA_AUTH_TYPE']
10
+ domain: ENV["ZUORA_DOMAIN"],
11
+ client_id: ENV["ZUORA_CLIENT_ID"],
12
+ client_secret: ENV["ZUORA_CLIENT_SECRET"],
13
+ auth_type: ENV["ZUORA_AUTH_TYPE"]
14
14
  }
15
15
 
16
16
  # If credentials are present in environment variables
data/iron_bank.gemspec CHANGED
@@ -1,51 +1,49 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- lib = File.expand_path('lib', __dir__)
3
+ lib = File.expand_path("lib", __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'iron_bank/version'
5
+ require "iron_bank/version"
6
6
 
7
7
  Gem::Specification.new do |spec|
8
- spec.name = 'iron_bank'
8
+ spec.name = "iron_bank"
9
9
  spec.version = IronBank::VERSION
10
- spec.summary = 'An opinionated Ruby interface to the Zuora API.'
11
- spec.homepage = 'https://github.com/zendesk/iron_bank'
12
- spec.license = 'Apache-2.0'
13
- spec.authors = ['Mickael Pham', 'Cheng Cui', 'Ryan Ringler', 'Mustafa Turan']
10
+ spec.summary = "An opinionated Ruby interface to the Zuora API."
11
+ spec.homepage = "https://github.com/zendesk/iron_bank"
12
+ spec.license = "Apache-2.0"
13
+ spec.authors = ["Mickael Pham", "Cheng Cui", "Ryan Ringler", "Mustafa Turan"]
14
14
 
15
15
  spec.email = [
16
- 'mickael@zendesk.com',
17
- 'ccui@zendesk.com',
18
- 'rringler@zendesk.com',
19
- 'mturan@zendesk.com'
16
+ "mickael@zendesk.com",
17
+ "ccui@zendesk.com",
18
+ "rringler@zendesk.com",
19
+ "mturan@zendesk.com"
20
20
  ]
21
21
 
22
- spec.required_ruby_version = '>= 2.3'
22
+ spec.required_ruby_version = ">= 2.4"
23
23
 
24
24
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
25
25
  f.match(%r{^(test|spec|features)/})
26
26
  end
27
27
 
28
- spec.bindir = 'exe'
28
+ spec.bindir = "exe"
29
29
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
30
- spec.require_paths = ['lib']
31
-
32
- spec.add_development_dependency 'bump', '~> 0.5'
33
- spec.add_development_dependency 'bundler', '~> 2.0'
34
- spec.add_development_dependency 'dotenv', '~> 2.2'
35
- spec.add_development_dependency 'factory_bot', '~> 4.10'
36
- spec.add_development_dependency 'pry-byebug', '~> 3.4'
37
- spec.add_development_dependency 'rake', '~> 12.0'
38
- spec.add_development_dependency 'reek', '~> 5.0'
39
- spec.add_development_dependency 'rspec', '~> 3.0'
40
- spec.add_development_dependency 'rubocop', '~> 0.52'
41
- spec.add_development_dependency 'shoulda-matchers', '~> 3.1'
42
- spec.add_development_dependency 'simplecov', '~> 0.15'
43
- spec.add_development_dependency 'timecop', '~> 0.9.0'
44
- spec.add_development_dependency 'vcr', '~> 4.0'
45
- spec.add_development_dependency 'webmock', '~> 3.0'
46
-
47
- spec.add_dependency 'ddtrace', '~> 0'
48
- spec.add_dependency 'faraday', '~> 0'
49
- spec.add_dependency 'faraday_middleware', '~> 0'
50
- spec.add_dependency 'nokogiri', '~> 1'
30
+ spec.require_paths = ["lib"]
31
+
32
+ spec.add_development_dependency "bump", "~> 0.5"
33
+ spec.add_development_dependency "bundler", "~> 2.0"
34
+ spec.add_development_dependency "dotenv", "~> 2.2"
35
+ spec.add_development_dependency "factory_bot", "~> 5.0"
36
+ spec.add_development_dependency "pry-byebug", "~> 3.4"
37
+ spec.add_development_dependency "rake", "~> 12.0"
38
+ spec.add_development_dependency "reek", "~> 5.0"
39
+ spec.add_development_dependency "rspec", "~> 3.0"
40
+ spec.add_development_dependency "rubocop", "~> 0.67"
41
+ spec.add_development_dependency "rubocop-performance", "~> 1.0"
42
+ spec.add_development_dependency "shoulda-matchers", "~> 4.0"
43
+ spec.add_development_dependency "simplecov", "~> 0.15"
44
+ spec.add_development_dependency "timecop", "~> 0.9.0"
45
+
46
+ spec.add_runtime_dependency "faraday", "~> 0"
47
+ spec.add_runtime_dependency "faraday_middleware", "~> 0"
48
+ spec.add_runtime_dependency "nokogiri", "~> 1"
51
49
  end
@@ -1,19 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'rails/generators/base'
3
+ require "rails/generators/base"
4
4
 
5
5
  module IronBank
6
6
  module Generators
7
7
  # Allow us to run `rails generate iron_bank:install`
8
8
  class InstallGenerator < Rails::Generators::Base
9
- source_root File.expand_path('templates', __dir__)
9
+ source_root File.expand_path("templates", __dir__)
10
10
 
11
11
  def create_iron_bank_initializer
12
- copy_file 'iron_bank.rb', 'config/initializers/iron_bank.rb'
12
+ copy_file "iron_bank.rb", "config/initializers/iron_bank.rb"
13
13
  end
14
14
 
15
15
  def display_readme_in_terminal
16
- readme 'README'
16
+ readme "README"
17
17
  end
18
18
  end
19
19
  end
@@ -2,19 +2,19 @@
2
2
 
3
3
  IronBank.configure do |config|
4
4
  # Zuora OAuth client ID
5
- config.client_id = '<my-client-id-from-zuora>'
5
+ config.client_id = "<my-client-id-from-zuora>"
6
6
 
7
7
  # Zuora OAuth client secret
8
- config.client_secret = '<my-secret-from-zuora>'
8
+ config.client_secret = "<my-secret-from-zuora>"
9
9
 
10
10
  # Zuora API domain (apisandbox, production, etc.)
11
- config.domain = 'rest.apisandbox.zuora.com'
11
+ config.domain = "rest.apisandbox.zuora.com"
12
12
 
13
13
  # Directory where the metadata XML files (Zuora schema) will be stored
14
- config.schema_directory = 'config/zuora/schema'
14
+ config.schema_directory = "config/zuora/schema"
15
15
 
16
16
  # Directory where the local export CSV files will be stored
17
- config.export_directory = 'config/zuora/local_records'
17
+ config.export_directory = "config/zuora/local_records"
18
18
 
19
19
  # Zuora authentication type:
20
20
  # - `token` uses OAuth and is the *recommended* approach
@@ -22,7 +22,7 @@ IronBank.configure do |config|
22
22
  # support OAuth authentication, e.g., services environment. If
23
23
  # using `cookie` authentication, then use an API user username as
24
24
  # the `client_id` and the API user password as `client_secret`
25
- config.auth_type = 'token'
25
+ config.auth_type = "token"
26
26
 
27
27
  # Set the gem to use the Rails logger
28
28
  config.logger = Rails.logger
@@ -31,7 +31,7 @@ module IronBank
31
31
  end
32
32
 
33
33
  def name
34
- self.class.name.split('::').last
34
+ self.class.name.split("::").last
35
35
  end
36
36
 
37
37
  def success?
@@ -14,7 +14,7 @@ module IronBank
14
14
 
15
15
  # NOTE: Zuora API endpoint is case-sensitive.
16
16
  def endpoint
17
- 'v1/action/queryMore'
17
+ "v1/action/queryMore"
18
18
  end
19
19
  end
20
20
  end
@@ -12,7 +12,7 @@ module IronBank
12
12
  :resource_name,
13
13
  IronBank::Utils.camelize(name)
14
14
  )
15
- foreign_key = options.fetch(:foreign_key, name.to_s + '_id')
15
+ foreign_key = options.fetch(:foreign_key, name.to_s + "_id")
16
16
 
17
17
  define_method(name) do
18
18
  return unless (foreign_key_value = public_send(foreign_key))
@@ -37,7 +37,7 @@ module IronBank
37
37
 
38
38
  foreign_key = options.fetch(
39
39
  :foreign_key,
40
- IronBank::Utils.underscore(object_name) + '_id'
40
+ IronBank::Utils.underscore(object_name) + "_id"
41
41
  )
42
42
 
43
43
  define_method(name) do
@@ -27,7 +27,7 @@ module IronBank
27
27
 
28
28
  def adapter
29
29
  @adapter ||=
30
- if auth_type == 'cookie'
30
+ if auth_type == "cookie"
31
31
  IronBank::Authentications::Cookie
32
32
  else
33
33
  IronBank::Authentications::Token