ledger_sync 2.0.0.pre.1 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/gem-workflow.yml +10 -6
- data/.travis.yml +1 -0
- data/Gemfile.lock +113 -86
- data/README.md +1 -0
- data/ledger_sync.gemspec +6 -4
- data/lib/ledger_sync/error/ledger_errors.rb +3 -1
- data/lib/ledger_sync/ledgers/client.rb +4 -4
- data/lib/ledger_sync/resource_attribute/mixin.rb +1 -1
- data/lib/ledger_sync/result.rb +17 -11
- data/lib/ledger_sync/test/support.rb +9 -2
- data/lib/ledger_sync/test/support/factory_bot.rb +1 -1
- data/lib/ledger_sync/type/reference_many.rb +2 -1
- data/lib/ledger_sync/util/dotenv_updator.rb +19 -15
- data/lib/ledger_sync/util/validator.rb +2 -2
- data/lib/ledger_sync/version.rb +1 -1
- metadata +43 -14
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1cf6f5673db192ad47561bec18aea0d49c520865c3dcf5e4bd7c671930ab629d
|
|
4
|
+
data.tar.gz: 194207990f3cd94f7511f6a52e021f20b0fd39983d0680b33458d2582e6973a2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 958087d98e123fedff5a73eb89ba42d3eed8934643cdcc4880b7ef60bca7b87adcaeecb256f884eeff6e2689d6e3bb7389d1d17ebca6af2d745706eaae46d798
|
|
7
|
+
data.tar.gz: 939329c7c8518d52ae1423c76a61545489ed8ca8a2c31eb338853bf45d093be82c185f3b8317b05e10bb6643f598504162ecedf50cb8a58bd73c14c53b46a318
|
|
@@ -8,7 +8,7 @@ jobs:
|
|
|
8
8
|
rubocop:
|
|
9
9
|
strategy:
|
|
10
10
|
matrix:
|
|
11
|
-
ruby-version: [2.6.3, 2.6.6, 2.7.1]
|
|
11
|
+
ruby-version: [2.5.8, 2.6.3, 2.6.6, 2.7.1, 3.0.0]
|
|
12
12
|
runs-on: [ubuntu-latest]
|
|
13
13
|
steps:
|
|
14
14
|
- uses: actions/checkout@v2
|
|
@@ -24,7 +24,7 @@ jobs:
|
|
|
24
24
|
rspec:
|
|
25
25
|
strategy:
|
|
26
26
|
matrix:
|
|
27
|
-
ruby-version: [2.6.3, 2.6.6, 2.7.1]
|
|
27
|
+
ruby-version: [2.5.8, 2.6.3, 2.6.6, 2.7.1, 3.0.0]
|
|
28
28
|
runs-on: [ubuntu-latest]
|
|
29
29
|
steps:
|
|
30
30
|
- uses: actions/checkout@v2
|
|
@@ -37,12 +37,16 @@ jobs:
|
|
|
37
37
|
ruby-version: ${{ matrix.ruby-version }}
|
|
38
38
|
bundler-cache: true
|
|
39
39
|
- name: rspec and report to coveralls
|
|
40
|
-
env:
|
|
41
|
-
COVERALLS_REPO_TOKEN: ${{ github.event_name == 'push' && secrets.COVERALLS_REPO_TOKEN }}
|
|
42
40
|
run: bundle exec rspec --order rand
|
|
41
|
+
- name: Coveralls
|
|
42
|
+
uses: coverallsapp/github-action@master
|
|
43
|
+
with:
|
|
44
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
45
|
+
parallel: true
|
|
46
|
+
flag-name: run-${{ matrix.ruby-version }}
|
|
43
47
|
publish:
|
|
44
48
|
runs-on: ubuntu-latest
|
|
45
|
-
needs: [
|
|
49
|
+
needs: ["rubocop", "rspec"]
|
|
46
50
|
if: github.event_name == 'release' && github.event.action == 'created'
|
|
47
51
|
steps:
|
|
48
52
|
- name: Checkout
|
|
@@ -64,4 +68,4 @@ jobs:
|
|
|
64
68
|
gem build *.gemspec
|
|
65
69
|
gem push *.gem
|
|
66
70
|
env:
|
|
67
|
-
GEM_HOST_API_KEY: "${{ secrets.RUBY_GEM_KEY }}"
|
|
71
|
+
GEM_HOST_API_KEY: "${{ secrets.RUBY_GEM_KEY }}"
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ledger_sync (2.
|
|
4
|
+
ledger_sync (2.2.0)
|
|
5
5
|
activemodel
|
|
6
6
|
colorize
|
|
7
7
|
dry-schema (~> 1.5.4)
|
|
@@ -20,34 +20,35 @@ PATH
|
|
|
20
20
|
GEM
|
|
21
21
|
remote: https://rubygems.org/
|
|
22
22
|
specs:
|
|
23
|
-
activemodel (6.
|
|
24
|
-
activesupport (= 6.
|
|
25
|
-
activesupport (6.
|
|
23
|
+
activemodel (6.1.4)
|
|
24
|
+
activesupport (= 6.1.4)
|
|
25
|
+
activesupport (6.1.4)
|
|
26
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
27
|
-
i18n (>=
|
|
28
|
-
minitest (
|
|
29
|
-
tzinfo (~>
|
|
30
|
-
zeitwerk (~> 2.
|
|
31
|
-
addressable (2.
|
|
27
|
+
i18n (>= 1.6, < 2)
|
|
28
|
+
minitest (>= 5.1)
|
|
29
|
+
tzinfo (~> 2.0)
|
|
30
|
+
zeitwerk (~> 2.3)
|
|
31
|
+
addressable (2.8.0)
|
|
32
32
|
public_suffix (>= 2.0.2, < 5.0)
|
|
33
|
-
ast (2.4.
|
|
34
|
-
awesome_print (1.
|
|
33
|
+
ast (2.4.2)
|
|
34
|
+
awesome_print (1.9.2)
|
|
35
35
|
bump (0.9.0)
|
|
36
36
|
byebug (11.1.3)
|
|
37
|
-
childprocess (4.
|
|
38
|
-
climate_control (0.
|
|
37
|
+
childprocess (4.1.0)
|
|
38
|
+
climate_control (1.0.1)
|
|
39
39
|
colorator (1.1.0)
|
|
40
40
|
colorize (0.8.1)
|
|
41
|
-
concurrent-ruby (1.1.
|
|
42
|
-
coveralls (0.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
crack (0.4.
|
|
41
|
+
concurrent-ruby (1.1.9)
|
|
42
|
+
coveralls (0.7.2)
|
|
43
|
+
multi_json (~> 1.3)
|
|
44
|
+
rest-client (= 1.6.7)
|
|
45
|
+
simplecov (>= 0.7)
|
|
46
|
+
term-ansicolor (= 1.2.2)
|
|
47
|
+
thor (= 0.18.1)
|
|
48
|
+
crack (0.4.5)
|
|
49
|
+
rexml
|
|
49
50
|
diff-lcs (1.4.4)
|
|
50
|
-
docile (1.
|
|
51
|
+
docile (1.4.0)
|
|
51
52
|
dotenv (2.7.6)
|
|
52
53
|
dry-configurable (0.12.1)
|
|
53
54
|
concurrent-ruby (~> 1.0)
|
|
@@ -55,12 +56,12 @@ GEM
|
|
|
55
56
|
dry-container (0.7.2)
|
|
56
57
|
concurrent-ruby (~> 1.0)
|
|
57
58
|
dry-configurable (~> 0.1, >= 0.1.3)
|
|
58
|
-
dry-core (0.
|
|
59
|
+
dry-core (0.6.0)
|
|
59
60
|
concurrent-ruby (~> 1.0)
|
|
60
61
|
dry-equalizer (0.3.0)
|
|
61
62
|
dry-inflector (0.2.0)
|
|
62
63
|
dry-initializer (3.0.4)
|
|
63
|
-
dry-logic (1.
|
|
64
|
+
dry-logic (1.2.0)
|
|
64
65
|
concurrent-ruby (~> 1.0)
|
|
65
66
|
dry-core (~> 0.5, >= 0.5)
|
|
66
67
|
dry-schema (1.5.6)
|
|
@@ -90,63 +91,87 @@ GEM
|
|
|
90
91
|
eventmachine (1.2.7)
|
|
91
92
|
factory_bot (6.1.0)
|
|
92
93
|
activesupport (>= 5.0.0)
|
|
93
|
-
faraday (1.
|
|
94
|
+
faraday (1.7.0)
|
|
95
|
+
faraday-em_http (~> 1.0)
|
|
96
|
+
faraday-em_synchrony (~> 1.0)
|
|
97
|
+
faraday-excon (~> 1.1)
|
|
98
|
+
faraday-httpclient (~> 1.0.1)
|
|
94
99
|
faraday-net_http (~> 1.0)
|
|
100
|
+
faraday-net_http_persistent (~> 1.1)
|
|
101
|
+
faraday-patron (~> 1.0)
|
|
102
|
+
faraday-rack (~> 1.0)
|
|
95
103
|
multipart-post (>= 1.2, < 3)
|
|
96
|
-
ruby2_keywords
|
|
104
|
+
ruby2_keywords (>= 0.0.4)
|
|
97
105
|
faraday-detailed_logger (2.3.0)
|
|
98
106
|
faraday (>= 0.8, < 2)
|
|
107
|
+
faraday-em_http (1.0.0)
|
|
108
|
+
faraday-em_synchrony (1.0.0)
|
|
109
|
+
faraday-excon (1.1.0)
|
|
110
|
+
faraday-httpclient (1.0.1)
|
|
99
111
|
faraday-net_http (1.0.1)
|
|
100
|
-
|
|
112
|
+
faraday-net_http_persistent (1.2.0)
|
|
113
|
+
faraday-patron (1.0.0)
|
|
114
|
+
faraday-rack (1.0.0)
|
|
115
|
+
faraday_middleware (1.1.0)
|
|
101
116
|
faraday (~> 1.0)
|
|
102
|
-
ffi (1.
|
|
117
|
+
ffi (1.15.3)
|
|
103
118
|
fingerprintable (1.2.1)
|
|
104
119
|
colorize
|
|
105
120
|
forwardable-extended (2.6.0)
|
|
106
121
|
hashdiff (1.0.1)
|
|
107
122
|
http_parser.rb (0.6.0)
|
|
108
|
-
i18n (
|
|
123
|
+
i18n (1.8.10)
|
|
109
124
|
concurrent-ruby (~> 1.0)
|
|
110
125
|
iniparse (1.5.0)
|
|
111
|
-
jekyll (
|
|
126
|
+
jekyll (4.2.0)
|
|
112
127
|
addressable (~> 2.4)
|
|
113
128
|
colorator (~> 1.0)
|
|
114
129
|
em-websocket (~> 0.5)
|
|
115
|
-
i18n (~> 0
|
|
116
|
-
jekyll-sass-converter (~>
|
|
130
|
+
i18n (~> 1.0)
|
|
131
|
+
jekyll-sass-converter (~> 2.0)
|
|
117
132
|
jekyll-watch (~> 2.0)
|
|
118
|
-
kramdown (~>
|
|
133
|
+
kramdown (~> 2.3)
|
|
134
|
+
kramdown-parser-gfm (~> 1.0)
|
|
119
135
|
liquid (~> 4.0)
|
|
120
|
-
mercenary (~> 0.
|
|
136
|
+
mercenary (~> 0.4.0)
|
|
121
137
|
pathutil (~> 0.9)
|
|
122
|
-
rouge (
|
|
138
|
+
rouge (~> 3.0)
|
|
123
139
|
safe_yaml (~> 1.0)
|
|
140
|
+
terminal-table (~> 2.0)
|
|
124
141
|
jekyll-menus (0.6.1)
|
|
125
142
|
jekyll (>= 3.6, < 5.0)
|
|
126
143
|
jekyll-paginate (1.1.0)
|
|
127
|
-
jekyll-paginate-v2 (
|
|
128
|
-
jekyll (
|
|
129
|
-
jekyll-sass-converter (1.
|
|
130
|
-
|
|
144
|
+
jekyll-paginate-v2 (3.0.0)
|
|
145
|
+
jekyll (>= 3.0, < 5.0)
|
|
146
|
+
jekyll-sass-converter (2.1.0)
|
|
147
|
+
sassc (> 2.0.1, < 3.0)
|
|
131
148
|
jekyll-watch (2.2.1)
|
|
132
149
|
listen (~> 3.0)
|
|
133
|
-
|
|
134
|
-
|
|
150
|
+
kramdown (2.3.1)
|
|
151
|
+
rexml
|
|
152
|
+
kramdown-parser-gfm (1.1.0)
|
|
153
|
+
kramdown (~> 2.0)
|
|
135
154
|
liquid (4.0.3)
|
|
136
|
-
listen (3.
|
|
155
|
+
listen (3.6.0)
|
|
137
156
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
138
157
|
rb-inotify (~> 0.9, >= 0.9.10)
|
|
139
|
-
mercenary (0.
|
|
140
|
-
|
|
158
|
+
mercenary (0.4.0)
|
|
159
|
+
mime-types (3.3.1)
|
|
160
|
+
mime-types-data (~> 3.2015)
|
|
161
|
+
mime-types-data (3.2021.0704)
|
|
162
|
+
mini_portile2 (2.6.1)
|
|
163
|
+
minitest (5.14.4)
|
|
164
|
+
multi_json (1.15.0)
|
|
141
165
|
multipart-post (2.1.1)
|
|
142
|
-
nokogiri (1.
|
|
166
|
+
nokogiri (1.12.3)
|
|
167
|
+
mini_portile2 (~> 2.6.1)
|
|
143
168
|
racc (~> 1.4)
|
|
144
169
|
openssl (2.2.0)
|
|
145
170
|
overcommit (0.57.0)
|
|
146
171
|
childprocess (>= 0.6.3, < 5)
|
|
147
172
|
iniparse (~> 1.4)
|
|
148
|
-
parallel (1.20.
|
|
149
|
-
parser (
|
|
173
|
+
parallel (1.20.1)
|
|
174
|
+
parser (3.0.2.0)
|
|
150
175
|
ast (~> 2.4.1)
|
|
151
176
|
pathutil (0.16.2)
|
|
152
177
|
forwardable-extended (~> 2.6)
|
|
@@ -156,27 +181,29 @@ GEM
|
|
|
156
181
|
racc (1.5.2)
|
|
157
182
|
rack (2.2.3)
|
|
158
183
|
rainbow (3.0.0)
|
|
159
|
-
rake (13.0.
|
|
160
|
-
rb-fsevent (0.
|
|
184
|
+
rake (13.0.6)
|
|
185
|
+
rb-fsevent (0.11.0)
|
|
161
186
|
rb-inotify (0.10.1)
|
|
162
187
|
ffi (~> 1.0)
|
|
163
|
-
regexp_parser (1.
|
|
188
|
+
regexp_parser (2.1.1)
|
|
164
189
|
resonad (1.4.0)
|
|
165
|
-
|
|
166
|
-
|
|
190
|
+
rest-client (1.6.7)
|
|
191
|
+
mime-types (>= 1.16)
|
|
192
|
+
rexml (3.2.5)
|
|
193
|
+
rouge (3.26.0)
|
|
167
194
|
rspec (3.10.0)
|
|
168
195
|
rspec-core (~> 3.10.0)
|
|
169
196
|
rspec-expectations (~> 3.10.0)
|
|
170
197
|
rspec-mocks (~> 3.10.0)
|
|
171
|
-
rspec-core (3.10.
|
|
198
|
+
rspec-core (3.10.1)
|
|
172
199
|
rspec-support (~> 3.10.0)
|
|
173
|
-
rspec-expectations (3.10.
|
|
200
|
+
rspec-expectations (3.10.1)
|
|
174
201
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
175
202
|
rspec-support (~> 3.10.0)
|
|
176
|
-
rspec-mocks (3.10.
|
|
203
|
+
rspec-mocks (3.10.2)
|
|
177
204
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
178
205
|
rspec-support (~> 3.10.0)
|
|
179
|
-
rspec-support (3.10.
|
|
206
|
+
rspec-support (3.10.2)
|
|
180
207
|
rubocop (1.0.0)
|
|
181
208
|
parallel (~> 1.10)
|
|
182
209
|
parser (>= 2.7.1.5)
|
|
@@ -186,38 +213,36 @@ GEM
|
|
|
186
213
|
rubocop-ast (>= 0.6.0)
|
|
187
214
|
ruby-progressbar (~> 1.7)
|
|
188
215
|
unicode-display_width (>= 1.4.0, < 2.0)
|
|
189
|
-
rubocop-ast (1.
|
|
190
|
-
parser (>=
|
|
191
|
-
ruby-progressbar (1.
|
|
192
|
-
ruby2_keywords (0.0.
|
|
216
|
+
rubocop-ast (1.10.0)
|
|
217
|
+
parser (>= 3.0.1.1)
|
|
218
|
+
ruby-progressbar (1.11.0)
|
|
219
|
+
ruby2_keywords (0.0.5)
|
|
193
220
|
safe_yaml (1.0.5)
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
rb-fsevent (~> 0.9, >= 0.9.4)
|
|
198
|
-
rb-inotify (~> 0.9, >= 0.9.7)
|
|
199
|
-
simplecov (0.16.1)
|
|
221
|
+
sassc (2.4.0)
|
|
222
|
+
ffi (~> 1.9)
|
|
223
|
+
simplecov (0.21.2)
|
|
200
224
|
docile (~> 1.1)
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
simplecov-html (0.
|
|
225
|
+
simplecov-html (~> 0.11)
|
|
226
|
+
simplecov_json_formatter (~> 0.1)
|
|
227
|
+
simplecov-html (0.12.3)
|
|
228
|
+
simplecov-lcov (0.8.0)
|
|
229
|
+
simplecov_json_formatter (0.1.3)
|
|
204
230
|
simply_serializable (1.5.1)
|
|
205
231
|
fingerprintable (>= 1.2.1)
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
tins (
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
thread_safe (~> 0.1)
|
|
232
|
+
term-ansicolor (1.2.2)
|
|
233
|
+
tins (~> 0.8)
|
|
234
|
+
terminal-table (2.0.0)
|
|
235
|
+
unicode-display_width (~> 1.1, >= 1.1.1)
|
|
236
|
+
thor (0.18.1)
|
|
237
|
+
tins (0.13.2)
|
|
238
|
+
tzinfo (2.0.4)
|
|
239
|
+
concurrent-ruby (~> 1.0)
|
|
215
240
|
unicode-display_width (1.7.0)
|
|
216
|
-
webmock (3.
|
|
217
|
-
addressable (>= 2.
|
|
241
|
+
webmock (3.14.0)
|
|
242
|
+
addressable (>= 2.8.0)
|
|
218
243
|
crack (>= 0.3.2)
|
|
219
244
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
220
|
-
zeitwerk (2.4.
|
|
245
|
+
zeitwerk (2.4.2)
|
|
221
246
|
|
|
222
247
|
PLATFORMS
|
|
223
248
|
ruby
|
|
@@ -228,19 +253,21 @@ DEPENDENCIES
|
|
|
228
253
|
bundler (~> 2.1)
|
|
229
254
|
byebug
|
|
230
255
|
climate_control
|
|
231
|
-
coveralls
|
|
256
|
+
coveralls
|
|
232
257
|
dotenv
|
|
233
258
|
factory_bot (~> 6.1.0)
|
|
234
|
-
jekyll (~>
|
|
235
|
-
jekyll-menus (~> 0.6.
|
|
259
|
+
jekyll (~> 4.2.0)
|
|
260
|
+
jekyll-menus (~> 0.6.1)
|
|
236
261
|
jekyll-paginate (~> 1.1)
|
|
237
|
-
jekyll-paginate-v2 (~>
|
|
262
|
+
jekyll-paginate-v2 (~> 3.0)
|
|
238
263
|
ledger_sync!
|
|
239
264
|
overcommit (~> 0.57.0)
|
|
240
265
|
rake (~> 13.0)
|
|
241
266
|
rspec (~> 3.2)
|
|
242
267
|
rubocop (= 1.0.0)
|
|
268
|
+
simplecov
|
|
269
|
+
simplecov-lcov
|
|
243
270
|
webmock
|
|
244
271
|
|
|
245
272
|
BUNDLED WITH
|
|
246
|
-
2.
|
|
273
|
+
2.2.3
|
data/README.md
CHANGED
data/ledger_sync.gemspec
CHANGED
|
@@ -35,17 +35,19 @@ Gem::Specification.new do |spec|
|
|
|
35
35
|
spec.add_development_dependency('bundler', '~> 2.1')
|
|
36
36
|
spec.add_development_dependency('byebug', '>= 0')
|
|
37
37
|
spec.add_development_dependency('climate_control')
|
|
38
|
-
spec.add_development_dependency('coveralls'
|
|
38
|
+
spec.add_development_dependency('coveralls')
|
|
39
39
|
spec.add_development_dependency('dotenv')
|
|
40
40
|
spec.add_development_dependency('factory_bot', '~> 6.1.0')
|
|
41
|
-
spec.add_development_dependency('jekyll', '~>
|
|
42
|
-
spec.add_development_dependency('jekyll-menus', '~> 0.6.
|
|
41
|
+
spec.add_development_dependency('jekyll', '~> 4.2.0')
|
|
42
|
+
spec.add_development_dependency('jekyll-menus', '~> 0.6.1')
|
|
43
43
|
spec.add_development_dependency('jekyll-paginate', '~> 1.1')
|
|
44
|
-
spec.add_development_dependency('jekyll-paginate-v2', '~>
|
|
44
|
+
spec.add_development_dependency('jekyll-paginate-v2', '~> 3.0')
|
|
45
45
|
spec.add_development_dependency('overcommit', '~> 0.57.0')
|
|
46
46
|
spec.add_development_dependency('rake', '~> 13.0')
|
|
47
47
|
spec.add_development_dependency('rspec', '~> 3.2')
|
|
48
48
|
spec.add_development_dependency('rubocop', '1.0.0')
|
|
49
|
+
spec.add_development_dependency('simplecov')
|
|
50
|
+
spec.add_development_dependency('simplecov-lcov')
|
|
49
51
|
spec.add_development_dependency('webmock', '>= 0')
|
|
50
52
|
spec.add_runtime_dependency('activemodel', '>= 0')
|
|
51
53
|
spec.add_runtime_dependency('colorize', '>= 0')
|
|
@@ -56,8 +56,8 @@ module LedgerSync
|
|
|
56
56
|
)
|
|
57
57
|
end
|
|
58
58
|
|
|
59
|
-
def searcher_class_for(*args)
|
|
60
|
-
self.class.searcher_class_for(*args)
|
|
59
|
+
def searcher_class_for(*args, **keywords)
|
|
60
|
+
self.class.searcher_class_for(*args, **keywords)
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
def url_for(*_args)
|
|
@@ -93,8 +93,8 @@ module LedgerSync
|
|
|
93
93
|
{}
|
|
94
94
|
end
|
|
95
95
|
|
|
96
|
-
def operation_class_for(*args)
|
|
97
|
-
Client.operation_class_for(*args)
|
|
96
|
+
def operation_class_for(*args, **keywords)
|
|
97
|
+
Client.operation_class_for(*args, **keywords)
|
|
98
98
|
end
|
|
99
99
|
|
|
100
100
|
def resource_from_ledger_type(type:, converter: nil)
|
data/lib/ledger_sync/result.rb
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
module LedgerSync
|
|
4
4
|
module ResultBase
|
|
5
5
|
module HelperMethods
|
|
6
|
-
def Success(value = nil, *args) # rubocop:disable Naming/MethodName
|
|
7
|
-
self::Success.new(value, *args)
|
|
6
|
+
def Success(value = nil, *args, **keywords) # rubocop:disable Naming/MethodName
|
|
7
|
+
self::Success.new(value, *args, **keywords)
|
|
8
8
|
end
|
|
9
9
|
|
|
10
|
-
def Failure(error = nil, *args) # rubocop:disable Naming/MethodName
|
|
11
|
-
self::Failure.new(error, *args)
|
|
10
|
+
def Failure(error = nil, *args, **keywords) # rubocop:disable Naming/MethodName
|
|
11
|
+
self::Failure.new(error, *args, **keywords)
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|
|
@@ -24,6 +24,12 @@ module LedgerSync
|
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
class Result
|
|
27
|
+
module ResultTypeBase
|
|
28
|
+
def initialize(*args, **keywords) # rubocop:disable Lint/UnusedMethodArgument
|
|
29
|
+
super(*args)
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
27
33
|
include ResultBase
|
|
28
34
|
end
|
|
29
35
|
|
|
@@ -37,10 +43,10 @@ module LedgerSync
|
|
|
37
43
|
end
|
|
38
44
|
end
|
|
39
45
|
|
|
40
|
-
def initialize(*args,
|
|
41
|
-
@operation = operation
|
|
42
|
-
@resource = resource
|
|
43
|
-
@response = response
|
|
46
|
+
def initialize(*args, **keywords)
|
|
47
|
+
@operation = keywords.fetch(:operation)
|
|
48
|
+
@resource = keywords.fetch(:resource)
|
|
49
|
+
@response = keywords.fetch(:response)
|
|
44
50
|
super(*args)
|
|
45
51
|
end
|
|
46
52
|
end
|
|
@@ -63,10 +69,10 @@ module LedgerSync
|
|
|
63
69
|
end
|
|
64
70
|
end
|
|
65
71
|
|
|
66
|
-
def initialize(*args, searcher:, **keywords)
|
|
72
|
+
def initialize(*args, searcher:, **keywords) # rubocop:disable Lint/UnusedMethodArgument
|
|
67
73
|
@resources = searcher.resources
|
|
68
74
|
@searcher = searcher
|
|
69
|
-
super(*args
|
|
75
|
+
super(*args)
|
|
70
76
|
end
|
|
71
77
|
|
|
72
78
|
def next_searcher
|
|
@@ -99,7 +105,7 @@ module LedgerSync
|
|
|
99
105
|
end
|
|
100
106
|
end
|
|
101
107
|
|
|
102
|
-
def initialize(validator:
|
|
108
|
+
def initialize(validator, **keywords) # rubocop:disable Lint/UnusedMethodArgument
|
|
103
109
|
raise 'The argument must be a validator' unless validator.is_a?(Util::Validator)
|
|
104
110
|
|
|
105
111
|
@validator = validator
|
|
@@ -39,17 +39,24 @@ module LedgerSync
|
|
|
39
39
|
|
|
40
40
|
require 'webmock/rspec'
|
|
41
41
|
require 'simplecov'
|
|
42
|
+
require 'simplecov-lcov'
|
|
42
43
|
require 'coveralls'
|
|
44
|
+
|
|
45
|
+
SimpleCov::Formatter::LcovFormatter.config do |c|
|
|
46
|
+
c.report_with_single_file = true
|
|
47
|
+
c.single_report_path = 'coverage/lcov.info'
|
|
48
|
+
end
|
|
43
49
|
Coveralls.wear!('rails')
|
|
44
50
|
|
|
45
51
|
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new(
|
|
46
52
|
[
|
|
47
53
|
Coveralls::SimpleCov::Formatter,
|
|
48
|
-
SimpleCov::Formatter::HTMLFormatter
|
|
54
|
+
SimpleCov::Formatter::HTMLFormatter,
|
|
55
|
+
SimpleCov::Formatter::LcovFormatter
|
|
49
56
|
]
|
|
50
57
|
)
|
|
51
58
|
|
|
52
|
-
SimpleCov.start do
|
|
59
|
+
SimpleCov.start('rails') do
|
|
53
60
|
add_filter 'lib/ledger_sync/util/debug.rb'
|
|
54
61
|
end
|
|
55
62
|
|
|
@@ -32,7 +32,8 @@ module LedgerSync
|
|
|
32
32
|
:reference_many
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
def valid?(
|
|
35
|
+
def valid?(args = {})
|
|
36
|
+
value = args.fetch(:value)
|
|
36
37
|
return false unless value.is_a?(Array)
|
|
37
38
|
return true if (resource_classes & value.map(&:class)).any?
|
|
38
39
|
return true if value.is_a?(Array) && value.empty?
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require 'dotenv'
|
|
4
|
+
|
|
3
5
|
module LedgerSync
|
|
4
6
|
module Util
|
|
5
7
|
class DotenvUpdator
|
|
@@ -9,27 +11,29 @@ module LedgerSync
|
|
|
9
11
|
@file_path = args.fetch(:file_path, File.join(Dir.pwd, '.env.local'))
|
|
10
12
|
end
|
|
11
13
|
|
|
12
|
-
def update(args = {})
|
|
14
|
+
def update(args = {}) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
|
13
15
|
client = args.fetch(:client)
|
|
14
16
|
prefix = args.fetch(:prefix, "#{client.class.config.root_key.upcase}_")
|
|
15
17
|
|
|
16
18
|
to_save = client.ledger_attributes_to_save.dup.stringify_keys
|
|
17
19
|
|
|
18
20
|
Tempfile.open(".#{File.basename(file_path)}", File.dirname(file_path)) do |tempfile|
|
|
19
|
-
File.
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
if File.file?(file_path)
|
|
22
|
+
File.open(file_path).each do |line|
|
|
23
|
+
env_key = line.split('=').first
|
|
24
|
+
client_method = env_key.split(prefix).last.downcase
|
|
25
|
+
|
|
26
|
+
if line =~ /\A#{prefix}/ && to_save.key?(client_method)
|
|
27
|
+
env_value = ENV[env_key]
|
|
28
|
+
new_value = to_save.delete(client_method)
|
|
29
|
+
tempfile.puts "#{env_key}=#{new_value}"
|
|
30
|
+
next if env_value == new_value.to_s
|
|
31
|
+
|
|
32
|
+
ENV[env_key] = new_value.to_s
|
|
33
|
+
tempfile.puts "# #{env_key}=#{env_value} # Updated on #{Time.now}"
|
|
34
|
+
else
|
|
35
|
+
tempfile.puts line
|
|
36
|
+
end
|
|
33
37
|
end
|
|
34
38
|
end
|
|
35
39
|
|
|
@@ -40,11 +40,11 @@ module LedgerSync
|
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
def failure
|
|
43
|
-
ValidationResult.Failure(
|
|
43
|
+
ValidationResult.Failure(self)
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
def success
|
|
47
|
-
ValidationResult.Success(
|
|
47
|
+
ValidationResult.Success(self)
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
end
|
data/lib/ledger_sync/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ledger_sync
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: 2.2.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryan Jackson
|
|
@@ -84,16 +84,16 @@ dependencies:
|
|
|
84
84
|
name: coveralls
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
|
-
- - "
|
|
87
|
+
- - ">="
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: 0
|
|
89
|
+
version: '0'
|
|
90
90
|
type: :development
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
|
-
- - "
|
|
94
|
+
- - ">="
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: 0
|
|
96
|
+
version: '0'
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
98
|
name: dotenv
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -128,28 +128,28 @@ dependencies:
|
|
|
128
128
|
requirements:
|
|
129
129
|
- - "~>"
|
|
130
130
|
- !ruby/object:Gem::Version
|
|
131
|
-
version:
|
|
131
|
+
version: 4.2.0
|
|
132
132
|
type: :development
|
|
133
133
|
prerelease: false
|
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
|
136
136
|
- - "~>"
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
|
-
version:
|
|
138
|
+
version: 4.2.0
|
|
139
139
|
- !ruby/object:Gem::Dependency
|
|
140
140
|
name: jekyll-menus
|
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
|
142
142
|
requirements:
|
|
143
143
|
- - "~>"
|
|
144
144
|
- !ruby/object:Gem::Version
|
|
145
|
-
version: 0.6.
|
|
145
|
+
version: 0.6.1
|
|
146
146
|
type: :development
|
|
147
147
|
prerelease: false
|
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
149
|
requirements:
|
|
150
150
|
- - "~>"
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
|
-
version: 0.6.
|
|
152
|
+
version: 0.6.1
|
|
153
153
|
- !ruby/object:Gem::Dependency
|
|
154
154
|
name: jekyll-paginate
|
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -170,14 +170,14 @@ dependencies:
|
|
|
170
170
|
requirements:
|
|
171
171
|
- - "~>"
|
|
172
172
|
- !ruby/object:Gem::Version
|
|
173
|
-
version: '
|
|
173
|
+
version: '3.0'
|
|
174
174
|
type: :development
|
|
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: '3.0'
|
|
181
181
|
- !ruby/object:Gem::Dependency
|
|
182
182
|
name: overcommit
|
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -234,6 +234,34 @@ dependencies:
|
|
|
234
234
|
- - '='
|
|
235
235
|
- !ruby/object:Gem::Version
|
|
236
236
|
version: 1.0.0
|
|
237
|
+
- !ruby/object:Gem::Dependency
|
|
238
|
+
name: simplecov
|
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
|
240
|
+
requirements:
|
|
241
|
+
- - ">="
|
|
242
|
+
- !ruby/object:Gem::Version
|
|
243
|
+
version: '0'
|
|
244
|
+
type: :development
|
|
245
|
+
prerelease: false
|
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
247
|
+
requirements:
|
|
248
|
+
- - ">="
|
|
249
|
+
- !ruby/object:Gem::Version
|
|
250
|
+
version: '0'
|
|
251
|
+
- !ruby/object:Gem::Dependency
|
|
252
|
+
name: simplecov-lcov
|
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
|
254
|
+
requirements:
|
|
255
|
+
- - ">="
|
|
256
|
+
- !ruby/object:Gem::Version
|
|
257
|
+
version: '0'
|
|
258
|
+
type: :development
|
|
259
|
+
prerelease: false
|
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
261
|
+
requirements:
|
|
262
|
+
- - ">="
|
|
263
|
+
- !ruby/object:Gem::Version
|
|
264
|
+
version: '0'
|
|
237
265
|
- !ruby/object:Gem::Dependency
|
|
238
266
|
name: webmock
|
|
239
267
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -816,11 +844,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
816
844
|
version: 2.5.8
|
|
817
845
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
818
846
|
requirements:
|
|
819
|
-
- - "
|
|
847
|
+
- - ">="
|
|
820
848
|
- !ruby/object:Gem::Version
|
|
821
|
-
version:
|
|
849
|
+
version: '0'
|
|
822
850
|
requirements: []
|
|
823
|
-
|
|
851
|
+
rubyforge_project:
|
|
852
|
+
rubygems_version: 2.7.6.2
|
|
824
853
|
signing_key:
|
|
825
854
|
specification_version: 4
|
|
826
855
|
summary: Sync common objects to accounting software.
|