ledger_sync 2.0.0 → 2.2.1
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 +112 -97
- 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/factory_bot.rb +1 -1
- data/lib/ledger_sync/test/support.rb +9 -2
- 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
- data/lib/ledger_sync.rb +0 -1
- metadata +41 -13
- data/lib/ledger_sync/resource_adaptor.rb +0 -54
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a7de3484980734cc3f099096951921344745f9ac6eafc88bbd78abee3cc856d5
|
|
4
|
+
data.tar.gz: f8329b16c34636cfeb90d62236b28eb24b91c345a7b02c30f924c3112f53e592
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: eaef9bf31c9ee60dc14b9e47c23777c6892ed4e56aff2f67de1db02735fd1de2827e6a70450d3d9db238100e7a263e9522fd24e7052227f1bf08c9593ef78c7c
|
|
7
|
+
data.tar.gz: 3f93cf52c534beeca47896862157ce1f0add8ff2e398da5a48a881655a530ab1a94b24ec8536b9debe9c1991dd13c22ec066c1ffe51bc1378dd81228f6bc6198
|
|
@@ -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.1)
|
|
5
5
|
activemodel
|
|
6
6
|
colorize
|
|
7
7
|
dry-schema (~> 1.5.4)
|
|
@@ -20,35 +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
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
simplecov (
|
|
46
|
-
term-ansicolor (
|
|
47
|
-
thor (
|
|
48
|
-
|
|
49
|
-
|
|
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
|
|
50
50
|
diff-lcs (1.4.4)
|
|
51
|
-
docile (1.
|
|
51
|
+
docile (1.4.0)
|
|
52
52
|
dotenv (2.7.6)
|
|
53
53
|
dry-configurable (0.12.1)
|
|
54
54
|
concurrent-ruby (~> 1.0)
|
|
@@ -56,12 +56,12 @@ GEM
|
|
|
56
56
|
dry-container (0.7.2)
|
|
57
57
|
concurrent-ruby (~> 1.0)
|
|
58
58
|
dry-configurable (~> 0.1, >= 0.1.3)
|
|
59
|
-
dry-core (0.
|
|
59
|
+
dry-core (0.6.0)
|
|
60
60
|
concurrent-ruby (~> 1.0)
|
|
61
61
|
dry-equalizer (0.3.0)
|
|
62
62
|
dry-inflector (0.2.0)
|
|
63
63
|
dry-initializer (3.0.4)
|
|
64
|
-
dry-logic (1.
|
|
64
|
+
dry-logic (1.2.0)
|
|
65
65
|
concurrent-ruby (~> 1.0)
|
|
66
66
|
dry-core (~> 0.5, >= 0.5)
|
|
67
67
|
dry-schema (1.5.6)
|
|
@@ -89,76 +89,89 @@ GEM
|
|
|
89
89
|
eventmachine (>= 0.12.9)
|
|
90
90
|
http_parser.rb (~> 0.6.0)
|
|
91
91
|
eventmachine (1.2.7)
|
|
92
|
-
excon (0.80.1)
|
|
93
92
|
factory_bot (6.1.0)
|
|
94
93
|
activesupport (>= 5.0.0)
|
|
95
|
-
faraday (1.
|
|
96
|
-
faraday-
|
|
94
|
+
faraday (1.8.0)
|
|
95
|
+
faraday-em_http (~> 1.0)
|
|
96
|
+
faraday-em_synchrony (~> 1.0)
|
|
97
|
+
faraday-excon (~> 1.1)
|
|
98
|
+
faraday-httpclient (~> 1.0.1)
|
|
97
99
|
faraday-net_http (~> 1.0)
|
|
98
|
-
faraday-net_http_persistent (~> 1.
|
|
100
|
+
faraday-net_http_persistent (~> 1.1)
|
|
101
|
+
faraday-patron (~> 1.0)
|
|
102
|
+
faraday-rack (~> 1.0)
|
|
99
103
|
multipart-post (>= 1.2, < 3)
|
|
100
104
|
ruby2_keywords (>= 0.0.4)
|
|
101
105
|
faraday-detailed_logger (2.3.0)
|
|
102
106
|
faraday (>= 0.8, < 2)
|
|
103
|
-
faraday-
|
|
104
|
-
|
|
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)
|
|
105
111
|
faraday-net_http (1.0.1)
|
|
106
|
-
faraday-net_http_persistent (1.0
|
|
107
|
-
|
|
108
|
-
|
|
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)
|
|
109
116
|
faraday (~> 1.0)
|
|
110
|
-
ffi (1.
|
|
117
|
+
ffi (1.15.3)
|
|
111
118
|
fingerprintable (1.2.1)
|
|
112
119
|
colorize
|
|
113
120
|
forwardable-extended (2.6.0)
|
|
114
121
|
hashdiff (1.0.1)
|
|
115
122
|
http_parser.rb (0.6.0)
|
|
116
|
-
i18n (
|
|
123
|
+
i18n (1.8.10)
|
|
117
124
|
concurrent-ruby (~> 1.0)
|
|
118
125
|
iniparse (1.5.0)
|
|
119
|
-
jekyll (
|
|
126
|
+
jekyll (4.2.0)
|
|
120
127
|
addressable (~> 2.4)
|
|
121
128
|
colorator (~> 1.0)
|
|
122
129
|
em-websocket (~> 0.5)
|
|
123
|
-
i18n (~> 0
|
|
124
|
-
jekyll-sass-converter (~>
|
|
130
|
+
i18n (~> 1.0)
|
|
131
|
+
jekyll-sass-converter (~> 2.0)
|
|
125
132
|
jekyll-watch (~> 2.0)
|
|
126
|
-
kramdown (~>
|
|
133
|
+
kramdown (~> 2.3)
|
|
134
|
+
kramdown-parser-gfm (~> 1.0)
|
|
127
135
|
liquid (~> 4.0)
|
|
128
|
-
mercenary (~> 0.
|
|
136
|
+
mercenary (~> 0.4.0)
|
|
129
137
|
pathutil (~> 0.9)
|
|
130
|
-
rouge (
|
|
138
|
+
rouge (~> 3.0)
|
|
131
139
|
safe_yaml (~> 1.0)
|
|
140
|
+
terminal-table (~> 2.0)
|
|
132
141
|
jekyll-menus (0.6.1)
|
|
133
142
|
jekyll (>= 3.6, < 5.0)
|
|
134
143
|
jekyll-paginate (1.1.0)
|
|
135
|
-
jekyll-paginate-v2 (
|
|
136
|
-
jekyll (
|
|
137
|
-
jekyll-sass-converter (1.
|
|
138
|
-
|
|
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)
|
|
139
148
|
jekyll-watch (2.2.1)
|
|
140
149
|
listen (~> 3.0)
|
|
141
|
-
|
|
142
|
-
|
|
150
|
+
kramdown (2.3.1)
|
|
151
|
+
rexml
|
|
152
|
+
kramdown-parser-gfm (1.1.0)
|
|
153
|
+
kramdown (~> 2.0)
|
|
143
154
|
liquid (4.0.3)
|
|
144
|
-
listen (3.
|
|
155
|
+
listen (3.6.0)
|
|
145
156
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
146
157
|
rb-inotify (~> 0.9, >= 0.9.10)
|
|
147
|
-
mercenary (0.
|
|
148
|
-
|
|
149
|
-
|
|
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)
|
|
150
165
|
multipart-post (2.1.1)
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
nokogiri (1.11.3)
|
|
154
|
-
mini_portile2 (~> 2.5.0)
|
|
166
|
+
nokogiri (1.12.5)
|
|
167
|
+
mini_portile2 (~> 2.6.1)
|
|
155
168
|
racc (~> 1.4)
|
|
156
169
|
openssl (2.2.0)
|
|
157
170
|
overcommit (0.57.0)
|
|
158
171
|
childprocess (>= 0.6.3, < 5)
|
|
159
172
|
iniparse (~> 1.4)
|
|
160
|
-
parallel (1.20.
|
|
161
|
-
parser (
|
|
173
|
+
parallel (1.20.1)
|
|
174
|
+
parser (3.0.2.0)
|
|
162
175
|
ast (~> 2.4.1)
|
|
163
176
|
pathutil (0.16.2)
|
|
164
177
|
forwardable-extended (~> 2.6)
|
|
@@ -168,27 +181,29 @@ GEM
|
|
|
168
181
|
racc (1.5.2)
|
|
169
182
|
rack (2.2.3)
|
|
170
183
|
rainbow (3.0.0)
|
|
171
|
-
rake (13.0.
|
|
172
|
-
rb-fsevent (0.
|
|
184
|
+
rake (13.0.6)
|
|
185
|
+
rb-fsevent (0.11.0)
|
|
173
186
|
rb-inotify (0.10.1)
|
|
174
187
|
ffi (~> 1.0)
|
|
175
|
-
regexp_parser (1.
|
|
188
|
+
regexp_parser (2.1.1)
|
|
176
189
|
resonad (1.4.0)
|
|
177
|
-
|
|
178
|
-
|
|
190
|
+
rest-client (1.6.7)
|
|
191
|
+
mime-types (>= 1.16)
|
|
192
|
+
rexml (3.2.5)
|
|
193
|
+
rouge (3.26.0)
|
|
179
194
|
rspec (3.10.0)
|
|
180
195
|
rspec-core (~> 3.10.0)
|
|
181
196
|
rspec-expectations (~> 3.10.0)
|
|
182
197
|
rspec-mocks (~> 3.10.0)
|
|
183
|
-
rspec-core (3.10.
|
|
198
|
+
rspec-core (3.10.1)
|
|
184
199
|
rspec-support (~> 3.10.0)
|
|
185
|
-
rspec-expectations (3.10.
|
|
200
|
+
rspec-expectations (3.10.1)
|
|
186
201
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
187
202
|
rspec-support (~> 3.10.0)
|
|
188
|
-
rspec-mocks (3.10.
|
|
203
|
+
rspec-mocks (3.10.2)
|
|
189
204
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
190
205
|
rspec-support (~> 3.10.0)
|
|
191
|
-
rspec-support (3.10.
|
|
206
|
+
rspec-support (3.10.2)
|
|
192
207
|
rubocop (1.0.0)
|
|
193
208
|
parallel (~> 1.10)
|
|
194
209
|
parser (>= 2.7.1.5)
|
|
@@ -198,38 +213,36 @@ GEM
|
|
|
198
213
|
rubocop-ast (>= 0.6.0)
|
|
199
214
|
ruby-progressbar (~> 1.7)
|
|
200
215
|
unicode-display_width (>= 1.4.0, < 2.0)
|
|
201
|
-
rubocop-ast (1.
|
|
202
|
-
parser (>=
|
|
203
|
-
ruby-progressbar (1.
|
|
204
|
-
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)
|
|
205
220
|
safe_yaml (1.0.5)
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
rb-fsevent (~> 0.9, >= 0.9.4)
|
|
210
|
-
rb-inotify (~> 0.9, >= 0.9.7)
|
|
211
|
-
simplecov (0.16.1)
|
|
221
|
+
sassc (2.4.0)
|
|
222
|
+
ffi (~> 1.9)
|
|
223
|
+
simplecov (0.21.2)
|
|
212
224
|
docile (~> 1.1)
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
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)
|
|
216
230
|
simply_serializable (1.5.1)
|
|
217
231
|
fingerprintable (>= 1.2.1)
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
tins (
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
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)
|
|
227
240
|
unicode-display_width (1.7.0)
|
|
228
|
-
webmock (3.
|
|
229
|
-
addressable (>= 2.
|
|
241
|
+
webmock (3.14.0)
|
|
242
|
+
addressable (>= 2.8.0)
|
|
230
243
|
crack (>= 0.3.2)
|
|
231
244
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
232
|
-
zeitwerk (2.4.
|
|
245
|
+
zeitwerk (2.4.2)
|
|
233
246
|
|
|
234
247
|
PLATFORMS
|
|
235
248
|
ruby
|
|
@@ -240,19 +253,21 @@ DEPENDENCIES
|
|
|
240
253
|
bundler (~> 2.1)
|
|
241
254
|
byebug
|
|
242
255
|
climate_control
|
|
243
|
-
coveralls
|
|
256
|
+
coveralls
|
|
244
257
|
dotenv
|
|
245
258
|
factory_bot (~> 6.1.0)
|
|
246
|
-
jekyll (~>
|
|
247
|
-
jekyll-menus (~> 0.6.
|
|
259
|
+
jekyll (~> 4.2.0)
|
|
260
|
+
jekyll-menus (~> 0.6.1)
|
|
248
261
|
jekyll-paginate (~> 1.1)
|
|
249
|
-
jekyll-paginate-v2 (~>
|
|
262
|
+
jekyll-paginate-v2 (~> 3.0)
|
|
250
263
|
ledger_sync!
|
|
251
264
|
overcommit (~> 0.57.0)
|
|
252
265
|
rake (~> 13.0)
|
|
253
266
|
rspec (~> 3.2)
|
|
254
267
|
rubocop (= 1.0.0)
|
|
268
|
+
simplecov
|
|
269
|
+
simplecov-lcov
|
|
255
270
|
webmock
|
|
256
271
|
|
|
257
272
|
BUNDLED WITH
|
|
258
|
-
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
data/lib/ledger_sync.rb
CHANGED
|
@@ -47,7 +47,6 @@ require 'ledger_sync/util/mixins/resource_registerable_mixin'
|
|
|
47
47
|
require 'ledger_sync/util/mixins/dupable_mixin'
|
|
48
48
|
require 'ledger_sync/result'
|
|
49
49
|
require 'ledger_sync/operation'
|
|
50
|
-
require 'ledger_sync/resource_adaptor'
|
|
51
50
|
|
|
52
51
|
Gem.find_files('ledger_sync/type/**/*.rb').each { |path| require path }
|
|
53
52
|
Gem.find_files('ledger_sync/serialization/type/**/*.rb').each { |path| require path }
|
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.1
|
|
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
|
|
@@ -703,7 +731,6 @@ files:
|
|
|
703
731
|
- lib/ledger_sync/ledgers/searcher.rb
|
|
704
732
|
- lib/ledger_sync/operation.rb
|
|
705
733
|
- lib/ledger_sync/resource.rb
|
|
706
|
-
- lib/ledger_sync/resource_adaptor.rb
|
|
707
734
|
- lib/ledger_sync/resource_attribute.rb
|
|
708
735
|
- lib/ledger_sync/resource_attribute/dirty_mixin.rb
|
|
709
736
|
- lib/ledger_sync/resource_attribute/mixin.rb
|
|
@@ -820,7 +847,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
820
847
|
- !ruby/object:Gem::Version
|
|
821
848
|
version: '0'
|
|
822
849
|
requirements: []
|
|
823
|
-
|
|
850
|
+
rubyforge_project:
|
|
851
|
+
rubygems_version: 2.7.6.2
|
|
824
852
|
signing_key:
|
|
825
853
|
specification_version: 4
|
|
826
854
|
summary: Sync common objects to accounting software.
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module LedgerSync
|
|
4
|
-
class ResourceAdaptor
|
|
5
|
-
module Mixin
|
|
6
|
-
module ClassMethods
|
|
7
|
-
def attribute(record_attribute, args = {})
|
|
8
|
-
resource_attribute = args.fetch(:resource_attribute, record_attribute)
|
|
9
|
-
|
|
10
|
-
attributes[record_attribute.to_sym] = {
|
|
11
|
-
record_attribute: record_attribute,
|
|
12
|
-
resource_attribute: resource_attribute
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
define_method(resource_attribute) do
|
|
16
|
-
resource.send(record_attribute)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
define_method("#{resource_attribute}=") do |*setter_args|
|
|
20
|
-
resource.send("#{record_attribute}=", *setter_args)
|
|
21
|
-
end
|
|
22
|
-
end
|
|
23
|
-
|
|
24
|
-
def attributes
|
|
25
|
-
@attributes ||= {}
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
module InstanceMethods
|
|
30
|
-
def initialize(args = {})
|
|
31
|
-
@resource = args.fetch(:resource).dup
|
|
32
|
-
end
|
|
33
|
-
end
|
|
34
|
-
|
|
35
|
-
def self.included(base)
|
|
36
|
-
base.extend(ClassMethods)
|
|
37
|
-
base.attr_reader(:resource)
|
|
38
|
-
base.attribute(:ledger_id)
|
|
39
|
-
base.attribute(:external_id)
|
|
40
|
-
base.include(InstanceMethods)
|
|
41
|
-
end
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
def initialize(*)
|
|
45
|
-
raise NotImplementedError
|
|
46
|
-
end
|
|
47
|
-
|
|
48
|
-
def self.inherited(base)
|
|
49
|
-
base.include(Mixin)
|
|
50
|
-
|
|
51
|
-
super
|
|
52
|
-
end
|
|
53
|
-
end
|
|
54
|
-
end
|