gecko-ruby 0.9.1 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/config/rubocop_linter_action.yml +7 -0
- data/.github/workflows/testing.yml +26 -0
- data/.rubocop.yml +23 -16
- data/CHANGELOG.md +18 -0
- data/Gemfile +2 -0
- data/README.md +1 -1
- data/Rakefile +3 -1
- data/gecko-ruby.gemspec +11 -10
- data/generate.thor +4 -1
- data/lib/gecko-ruby.rb +2 -0
- data/lib/gecko.rb +3 -0
- data/lib/gecko/client.rb +17 -14
- data/lib/gecko/ext/liquid_compat.rb +10 -10
- data/lib/gecko/ext/log_subscriber.rb +6 -6
- data/lib/gecko/helpers/association_helper.rb +14 -12
- data/lib/gecko/helpers/inspection_helper.rb +4 -2
- data/lib/gecko/helpers/record_helper.rb +2 -0
- data/lib/gecko/helpers/serialization_helper.rb +5 -1
- data/lib/gecko/helpers/validation_helper.rb +3 -1
- data/lib/gecko/record/account.rb +4 -1
- data/lib/gecko/record/address.rb +2 -0
- data/lib/gecko/record/base.rb +5 -3
- data/lib/gecko/record/base_adapter.rb +33 -22
- data/lib/gecko/record/company.rb +3 -0
- data/lib/gecko/record/contact.rb +2 -0
- data/lib/gecko/record/currency.rb +2 -0
- data/lib/gecko/record/exceptions.rb +2 -0
- data/lib/gecko/record/fulfillment.rb +2 -0
- data/lib/gecko/record/fulfillment_line_item.rb +2 -1
- data/lib/gecko/record/image.rb +13 -8
- data/lib/gecko/record/invoice.rb +7 -3
- data/lib/gecko/record/invoice_line_item.rb +2 -1
- data/lib/gecko/record/location.rb +2 -0
- data/lib/gecko/record/note.rb +2 -0
- data/lib/gecko/record/order.rb +2 -0
- data/lib/gecko/record/order_line_item.rb +3 -0
- data/lib/gecko/record/payment_method.rb +15 -0
- data/lib/gecko/record/payment_term.rb +2 -1
- data/lib/gecko/record/product.rb +4 -0
- data/lib/gecko/record/purchase_order.rb +2 -1
- data/lib/gecko/record/purchase_order_line_item.rb +2 -1
- data/lib/gecko/record/tax_type.rb +2 -1
- data/lib/gecko/record/user.rb +3 -1
- data/lib/gecko/record/variant.rb +9 -7
- data/lib/gecko/record/webhook.rb +3 -1
- data/lib/gecko/version.rb +3 -1
- data/test/client_test.rb +4 -2
- data/test/fixtures/vcr_cassettes/images.yml +1 -1
- data/test/fixtures/vcr_cassettes/payment_methods.yml +69 -0
- data/test/fixtures/vcr_cassettes/payment_methods_count.yml +66 -0
- data/test/gecko_test.rb +2 -0
- data/test/helpers/association_helper_test.rb +7 -5
- data/test/helpers/inspection_helper_test.rb +6 -4
- data/test/helpers/serialization_helper_test.rb +16 -14
- data/test/helpers/validation_helper_test.rb +3 -1
- data/test/record/account_adapter_test.rb +2 -0
- data/test/record/address_adapter_test.rb +2 -0
- data/test/record/address_test.rb +2 -0
- data/test/record/company_adapter_test.rb +2 -0
- data/test/record/company_test.rb +2 -0
- data/test/record/contact_adapter_test.rb +2 -0
- data/test/record/contact_test.rb +3 -1
- data/test/record/currency_adapter_test.rb +2 -0
- data/test/record/currency_test.rb +2 -0
- data/test/record/fulfillment_adapter_test.rb +2 -0
- data/test/record/fulfillment_line_item_adapter_test.rb +2 -0
- data/test/record/fulfillment_line_item_test.rb +2 -0
- data/test/record/fulfillment_test.rb +4 -2
- data/test/record/image_adapter_test.rb +2 -0
- data/test/record/image_test.rb +18 -0
- data/test/record/invoice_adapter_test.rb +2 -0
- data/test/record/invoice_line_item_adapter_test.rb +2 -0
- data/test/record/invoice_line_item_test.rb +2 -0
- data/test/record/invoice_test.rb +2 -0
- data/test/record/location_adapter_test.rb +2 -0
- data/test/record/location_test.rb +2 -0
- data/test/record/note_test.rb +2 -0
- data/test/record/order_adapter_test.rb +2 -0
- data/test/record/order_line_item_adapter_test.rb +2 -0
- data/test/record/order_line_item_test.rb +2 -0
- data/test/record/order_test.rb +2 -0
- data/test/record/payment_method_adapter_test.rb +16 -0
- data/test/record/payment_method_test.rb +20 -0
- data/test/record/payment_term_adapter_test.rb +2 -0
- data/test/record/payment_term_test.rb +2 -0
- data/test/record/product_adapter_test.rb +2 -0
- data/test/record/product_test.rb +2 -0
- data/test/record/purchase_order_adapter_test.rb +2 -0
- data/test/record/purchase_order_line_item_adapter_test.rb +2 -0
- data/test/record/purchase_order_line_item_test.rb +2 -0
- data/test/record/purchase_order_test.rb +2 -0
- data/test/record/tax_type_adapter_test.rb +2 -0
- data/test/record/tax_type_test.rb +2 -0
- data/test/record/user_adapter_test.rb +2 -0
- data/test/record/user_test.rb +2 -0
- data/test/record/variant_adapter_test.rb +2 -0
- data/test/record/variant_test.rb +6 -4
- data/test/record/webhook_test.rb +2 -0
- data/test/support/let.rb +2 -0
- data/test/support/shared_adapter_examples.rb +35 -31
- data/test/support/shared_record_examples.rb +3 -1
- data/test/support/shared_sideloaded_data_parsing_examples.rb +2 -1
- data/test/support/testing_adapter.rb +2 -0
- data/test/support/vcr_support.rb +2 -0
- data/test/test_helper.rb +12 -0
- metadata +33 -23
- data/.travis.yml +0 -8
@@ -1,7 +1,8 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module SharedSideloadedDataParsingExamples
|
2
4
|
def test_adapter_sideloaded_data_parsing
|
3
5
|
VCR.use_cassette(plural_name + '_sideloaded') do
|
4
|
-
|
5
6
|
collection = adapter.where(limit: 5, _include: children.join(","))
|
6
7
|
|
7
8
|
children.each do |child|
|
data/test/support/vcr_support.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'gecko'
|
2
4
|
require 'minitest/autorun'
|
3
5
|
require 'minitest/pride'
|
@@ -13,9 +15,19 @@ require 'support/shared_sideloaded_data_parsing_examples'
|
|
13
15
|
require 'support/testing_adapter'
|
14
16
|
require 'support/vcr_support'
|
15
17
|
|
18
|
+
ENV_SECRETS = %w[
|
19
|
+
OAUTH_ID
|
20
|
+
OAUTH_SECRET
|
21
|
+
ACCESS_TOKEN
|
22
|
+
REFRESH_TOKEN
|
23
|
+
].freeze
|
24
|
+
|
16
25
|
VCR.configure do |c|
|
17
26
|
c.cassette_library_dir = 'test/fixtures/vcr_cassettes'
|
18
27
|
c.hook_into :webmock
|
28
|
+
ENV_SECRETS.each do |variable|
|
29
|
+
c.filter_sensitive_data("<__#{variable}__>") { ENV[variable] }
|
30
|
+
end
|
19
31
|
end
|
20
32
|
|
21
33
|
class Minitest::Test
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gecko-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bradley Priest
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: dotenv
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -53,7 +53,7 @@ dependencies:
|
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: mocha
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - ">="
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: pry
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
84
|
+
name: rake
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
@@ -95,7 +95,7 @@ dependencies:
|
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
98
|
+
name: thor
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
@@ -109,7 +109,7 @@ dependencies:
|
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
112
|
+
name: timecop
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
@@ -123,7 +123,7 @@ dependencies:
|
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: vcr
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
129
|
- - ">="
|
@@ -137,7 +137,7 @@ dependencies:
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
140
|
+
name: webmock
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
142
142
|
requirements:
|
143
143
|
- - ">="
|
@@ -151,35 +151,35 @@ dependencies:
|
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '0'
|
153
153
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
154
|
+
name: activesupport
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
|
-
version:
|
159
|
+
version: '0'
|
160
160
|
type: :runtime
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - "
|
164
|
+
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
|
-
version:
|
166
|
+
version: '0'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
|
-
name:
|
168
|
+
name: oauth2
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - "
|
171
|
+
- - ">"
|
172
172
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
173
|
+
version: 1.1.0
|
174
174
|
type: :runtime
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- - "
|
178
|
+
- - ">"
|
179
179
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
180
|
+
version: 1.1.0
|
181
181
|
- !ruby/object:Gem::Dependency
|
182
|
-
name:
|
182
|
+
name: virtus
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
184
184
|
requirements:
|
185
185
|
- - ">="
|
@@ -199,10 +199,11 @@ executables: []
|
|
199
199
|
extensions: []
|
200
200
|
extra_rdoc_files: []
|
201
201
|
files:
|
202
|
+
- ".github/config/rubocop_linter_action.yml"
|
203
|
+
- ".github/workflows/testing.yml"
|
202
204
|
- ".gitignore"
|
203
205
|
- ".hound.yml"
|
204
206
|
- ".rubocop.yml"
|
205
|
-
- ".travis.yml"
|
206
207
|
- CHANGELOG.md
|
207
208
|
- CONTRIBUTING.md
|
208
209
|
- Gemfile
|
@@ -238,6 +239,7 @@ files:
|
|
238
239
|
- lib/gecko/record/note.rb
|
239
240
|
- lib/gecko/record/order.rb
|
240
241
|
- lib/gecko/record/order_line_item.rb
|
242
|
+
- lib/gecko/record/payment_method.rb
|
241
243
|
- lib/gecko/record/payment_term.rb
|
242
244
|
- lib/gecko/record/product.rb
|
243
245
|
- lib/gecko/record/purchase_order.rb
|
@@ -274,6 +276,8 @@ files:
|
|
274
276
|
- test/fixtures/vcr_cassettes/order_line_items_specific_count.yml
|
275
277
|
- test/fixtures/vcr_cassettes/orders.yml
|
276
278
|
- test/fixtures/vcr_cassettes/orders_count.yml
|
279
|
+
- test/fixtures/vcr_cassettes/payment_methods.yml
|
280
|
+
- test/fixtures/vcr_cassettes/payment_methods_count.yml
|
277
281
|
- test/fixtures/vcr_cassettes/payment_terms.yml
|
278
282
|
- test/fixtures/vcr_cassettes/payment_terms_count.yml
|
279
283
|
- test/fixtures/vcr_cassettes/products.yml
|
@@ -324,6 +328,8 @@ files:
|
|
324
328
|
- test/record/order_line_item_adapter_test.rb
|
325
329
|
- test/record/order_line_item_test.rb
|
326
330
|
- test/record/order_test.rb
|
331
|
+
- test/record/payment_method_adapter_test.rb
|
332
|
+
- test/record/payment_method_test.rb
|
327
333
|
- test/record/payment_term_adapter_test.rb
|
328
334
|
- test/record/payment_term_test.rb
|
329
335
|
- test/record/product_adapter_test.rb
|
@@ -365,7 +371,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
365
371
|
- !ruby/object:Gem::Version
|
366
372
|
version: '0'
|
367
373
|
requirements: []
|
368
|
-
rubygems_version: 3.
|
374
|
+
rubygems_version: 3.1.2
|
369
375
|
signing_key:
|
370
376
|
specification_version: 4
|
371
377
|
summary: A Ruby interface to the TradeGecko API.
|
@@ -397,6 +403,8 @@ test_files:
|
|
397
403
|
- test/fixtures/vcr_cassettes/order_line_items_specific_count.yml
|
398
404
|
- test/fixtures/vcr_cassettes/orders.yml
|
399
405
|
- test/fixtures/vcr_cassettes/orders_count.yml
|
406
|
+
- test/fixtures/vcr_cassettes/payment_methods.yml
|
407
|
+
- test/fixtures/vcr_cassettes/payment_methods_count.yml
|
400
408
|
- test/fixtures/vcr_cassettes/payment_terms.yml
|
401
409
|
- test/fixtures/vcr_cassettes/payment_terms_count.yml
|
402
410
|
- test/fixtures/vcr_cassettes/products.yml
|
@@ -447,6 +455,8 @@ test_files:
|
|
447
455
|
- test/record/order_line_item_adapter_test.rb
|
448
456
|
- test/record/order_line_item_test.rb
|
449
457
|
- test/record/order_test.rb
|
458
|
+
- test/record/payment_method_adapter_test.rb
|
459
|
+
- test/record/payment_method_test.rb
|
450
460
|
- test/record/payment_term_adapter_test.rb
|
451
461
|
- test/record/payment_term_test.rb
|
452
462
|
- test/record/product_adapter_test.rb
|