ledger_sync 2.0.1 → 2.2.3
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 +4 -4
- data/.travis.yml +1 -0
- data/Gemfile.lock +70 -59
- data/documentation/generate.rb +1 -1
- data/documentation/helper_methods.rb +3 -3
- data/ledger_sync.gemspec +4 -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/type/reference_many.rb +2 -1
- data/lib/ledger_sync/util/dotenv_updator.rb +2 -0
- data/lib/ledger_sync/util/validator.rb +2 -2
- data/lib/ledger_sync/version.rb +1 -1
- data/lib/ledger_sync.rb +1 -2
- metadata +26 -26
- 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: c3e5eefec60af52de9f23706b6a511747c873f808da70e862e693d100e7f045f
|
|
4
|
+
data.tar.gz: d1f3bba5e9d219eea0ce9eebd507c142075b2dc4cede68467b82a1100ec5d19f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ae4c8d24be174de81b4f659cfbd3333d83d6aa52c363a3f86ef1ffe40b33521798505b6d3476f85d1a997ca1dac0d5f289399a690b6d2f4423accc9a02c4e9ac
|
|
7
|
+
data.tar.gz: 4c85caf3b41ed0ba10db77405147104033e30d215070f9c5da0aadeface3bf58518ef2b52ec3a465d0286b4bf0b1f41727590eeffb2348bcd084ce654ff1ef81
|
|
@@ -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
|
|
@@ -46,7 +46,7 @@ jobs:
|
|
|
46
46
|
flag-name: run-${{ matrix.ruby-version }}
|
|
47
47
|
publish:
|
|
48
48
|
runs-on: ubuntu-latest
|
|
49
|
-
needs: [
|
|
49
|
+
needs: ["rubocop", "rspec"]
|
|
50
50
|
if: github.event_name == 'release' && github.event.action == 'created'
|
|
51
51
|
steps:
|
|
52
52
|
- name: Checkout
|
|
@@ -68,4 +68,4 @@ jobs:
|
|
|
68
68
|
gem build *.gemspec
|
|
69
69
|
gem push *.gem
|
|
70
70
|
env:
|
|
71
|
-
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,9 +1,8 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
ledger_sync (2.
|
|
4
|
+
ledger_sync (2.2.3)
|
|
5
5
|
activemodel
|
|
6
|
-
colorize
|
|
7
6
|
dry-schema (~> 1.5.4)
|
|
8
7
|
dry-validation (~> 1.5.6)
|
|
9
8
|
faraday
|
|
@@ -14,31 +13,32 @@ PATH
|
|
|
14
13
|
openssl (~> 2.2.0)
|
|
15
14
|
pd_ruby
|
|
16
15
|
rack (~> 2.2.3)
|
|
16
|
+
rainbow (~> 3.0)
|
|
17
17
|
resonad
|
|
18
18
|
simply_serializable (>= 1.5.1)
|
|
19
19
|
|
|
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
33
|
ast (2.4.2)
|
|
34
34
|
awesome_print (1.9.2)
|
|
35
35
|
bump (0.9.0)
|
|
36
36
|
byebug (11.1.3)
|
|
37
|
-
childprocess (4.
|
|
38
|
-
climate_control (1.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.
|
|
41
|
+
concurrent-ruby (1.1.9)
|
|
42
42
|
coveralls (0.7.2)
|
|
43
43
|
multi_json (~> 1.3)
|
|
44
44
|
rest-client (= 1.6.7)
|
|
@@ -48,7 +48,7 @@ GEM
|
|
|
48
48
|
crack (0.4.5)
|
|
49
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)
|
|
@@ -91,12 +91,15 @@ GEM
|
|
|
91
91
|
eventmachine (1.2.7)
|
|
92
92
|
factory_bot (6.1.0)
|
|
93
93
|
activesupport (>= 5.0.0)
|
|
94
|
-
faraday (1.
|
|
94
|
+
faraday (1.8.0)
|
|
95
95
|
faraday-em_http (~> 1.0)
|
|
96
96
|
faraday-em_synchrony (~> 1.0)
|
|
97
97
|
faraday-excon (~> 1.1)
|
|
98
|
+
faraday-httpclient (~> 1.0.1)
|
|
98
99
|
faraday-net_http (~> 1.0)
|
|
99
100
|
faraday-net_http_persistent (~> 1.1)
|
|
101
|
+
faraday-patron (~> 1.0)
|
|
102
|
+
faraday-rack (~> 1.0)
|
|
100
103
|
multipart-post (>= 1.2, < 3)
|
|
101
104
|
ruby2_keywords (>= 0.0.4)
|
|
102
105
|
faraday-detailed_logger (2.3.0)
|
|
@@ -104,74 +107,84 @@ GEM
|
|
|
104
107
|
faraday-em_http (1.0.0)
|
|
105
108
|
faraday-em_synchrony (1.0.0)
|
|
106
109
|
faraday-excon (1.1.0)
|
|
110
|
+
faraday-httpclient (1.0.1)
|
|
107
111
|
faraday-net_http (1.0.1)
|
|
108
|
-
faraday-net_http_persistent (1.
|
|
109
|
-
|
|
112
|
+
faraday-net_http_persistent (1.2.0)
|
|
113
|
+
faraday-patron (1.0.0)
|
|
114
|
+
faraday-rack (1.0.0)
|
|
115
|
+
faraday_middleware (1.2.0)
|
|
110
116
|
faraday (~> 1.0)
|
|
111
|
-
ffi (1.15.
|
|
117
|
+
ffi (1.15.3)
|
|
112
118
|
fingerprintable (1.2.1)
|
|
113
119
|
colorize
|
|
114
120
|
forwardable-extended (2.6.0)
|
|
115
121
|
hashdiff (1.0.1)
|
|
116
122
|
http_parser.rb (0.6.0)
|
|
117
|
-
i18n (
|
|
123
|
+
i18n (1.8.10)
|
|
118
124
|
concurrent-ruby (~> 1.0)
|
|
119
125
|
iniparse (1.5.0)
|
|
120
|
-
|
|
126
|
+
ipaddr (1.2.2)
|
|
127
|
+
jekyll (4.2.0)
|
|
121
128
|
addressable (~> 2.4)
|
|
122
129
|
colorator (~> 1.0)
|
|
123
130
|
em-websocket (~> 0.5)
|
|
124
|
-
i18n (~> 0
|
|
125
|
-
jekyll-sass-converter (~>
|
|
131
|
+
i18n (~> 1.0)
|
|
132
|
+
jekyll-sass-converter (~> 2.0)
|
|
126
133
|
jekyll-watch (~> 2.0)
|
|
127
|
-
kramdown (~>
|
|
134
|
+
kramdown (~> 2.3)
|
|
135
|
+
kramdown-parser-gfm (~> 1.0)
|
|
128
136
|
liquid (~> 4.0)
|
|
129
|
-
mercenary (~> 0.
|
|
137
|
+
mercenary (~> 0.4.0)
|
|
130
138
|
pathutil (~> 0.9)
|
|
131
|
-
rouge (
|
|
139
|
+
rouge (~> 3.0)
|
|
132
140
|
safe_yaml (~> 1.0)
|
|
141
|
+
terminal-table (~> 2.0)
|
|
133
142
|
jekyll-menus (0.6.1)
|
|
134
143
|
jekyll (>= 3.6, < 5.0)
|
|
135
144
|
jekyll-paginate (1.1.0)
|
|
136
|
-
jekyll-paginate-v2 (
|
|
137
|
-
jekyll (
|
|
138
|
-
jekyll-sass-converter (1.
|
|
139
|
-
|
|
145
|
+
jekyll-paginate-v2 (3.0.0)
|
|
146
|
+
jekyll (>= 3.0, < 5.0)
|
|
147
|
+
jekyll-sass-converter (2.1.0)
|
|
148
|
+
sassc (> 2.0.1, < 3.0)
|
|
140
149
|
jekyll-watch (2.2.1)
|
|
141
150
|
listen (~> 3.0)
|
|
142
|
-
kramdown (
|
|
151
|
+
kramdown (2.3.1)
|
|
152
|
+
rexml
|
|
153
|
+
kramdown-parser-gfm (1.1.0)
|
|
154
|
+
kramdown (~> 2.0)
|
|
143
155
|
liquid (4.0.3)
|
|
144
|
-
listen (3.
|
|
156
|
+
listen (3.6.0)
|
|
145
157
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
|
146
158
|
rb-inotify (~> 0.9, >= 0.9.10)
|
|
147
|
-
mercenary (0.
|
|
159
|
+
mercenary (0.4.0)
|
|
148
160
|
mime-types (3.3.1)
|
|
149
161
|
mime-types-data (~> 3.2015)
|
|
150
|
-
mime-types-data (3.2021.
|
|
151
|
-
mini_portile2 (2.
|
|
162
|
+
mime-types-data (3.2021.0704)
|
|
163
|
+
mini_portile2 (2.6.1)
|
|
152
164
|
minitest (5.14.4)
|
|
153
165
|
multi_json (1.15.0)
|
|
154
166
|
multipart-post (2.1.1)
|
|
155
|
-
nokogiri (1.
|
|
156
|
-
mini_portile2 (~> 2.
|
|
167
|
+
nokogiri (1.12.5)
|
|
168
|
+
mini_portile2 (~> 2.6.1)
|
|
157
169
|
racc (~> 1.4)
|
|
158
|
-
openssl (2.2.
|
|
170
|
+
openssl (2.2.1)
|
|
171
|
+
ipaddr
|
|
159
172
|
overcommit (0.57.0)
|
|
160
173
|
childprocess (>= 0.6.3, < 5)
|
|
161
174
|
iniparse (~> 1.4)
|
|
162
175
|
parallel (1.20.1)
|
|
163
|
-
parser (3.0.
|
|
176
|
+
parser (3.0.2.0)
|
|
164
177
|
ast (~> 2.4.1)
|
|
165
178
|
pathutil (0.16.2)
|
|
166
179
|
forwardable-extended (~> 2.6)
|
|
167
180
|
pd_ruby (0.2.3)
|
|
168
181
|
colorize
|
|
169
182
|
public_suffix (4.0.6)
|
|
170
|
-
racc (1.
|
|
183
|
+
racc (1.6.0)
|
|
171
184
|
rack (2.2.3)
|
|
172
185
|
rainbow (3.0.0)
|
|
173
|
-
rake (13.0.
|
|
174
|
-
rb-fsevent (0.
|
|
186
|
+
rake (13.0.6)
|
|
187
|
+
rb-fsevent (0.11.0)
|
|
175
188
|
rb-inotify (0.10.1)
|
|
176
189
|
ffi (~> 1.0)
|
|
177
190
|
regexp_parser (2.1.1)
|
|
@@ -202,35 +215,33 @@ GEM
|
|
|
202
215
|
rubocop-ast (>= 0.6.0)
|
|
203
216
|
ruby-progressbar (~> 1.7)
|
|
204
217
|
unicode-display_width (>= 1.4.0, < 2.0)
|
|
205
|
-
rubocop-ast (1.
|
|
206
|
-
parser (>=
|
|
218
|
+
rubocop-ast (1.10.0)
|
|
219
|
+
parser (>= 3.0.1.1)
|
|
207
220
|
ruby-progressbar (1.11.0)
|
|
208
|
-
ruby2_keywords (0.0.
|
|
221
|
+
ruby2_keywords (0.0.5)
|
|
209
222
|
safe_yaml (1.0.5)
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
sass-listen (4.0.0)
|
|
213
|
-
rb-fsevent (~> 0.9, >= 0.9.4)
|
|
214
|
-
rb-inotify (~> 0.9, >= 0.9.7)
|
|
223
|
+
sassc (2.4.0)
|
|
224
|
+
ffi (~> 1.9)
|
|
215
225
|
simplecov (0.21.2)
|
|
216
226
|
docile (~> 1.1)
|
|
217
227
|
simplecov-html (~> 0.11)
|
|
218
228
|
simplecov_json_formatter (~> 0.1)
|
|
219
229
|
simplecov-html (0.12.3)
|
|
220
230
|
simplecov-lcov (0.8.0)
|
|
221
|
-
simplecov_json_formatter (0.1.
|
|
231
|
+
simplecov_json_formatter (0.1.3)
|
|
222
232
|
simply_serializable (1.5.1)
|
|
223
233
|
fingerprintable (>= 1.2.1)
|
|
224
234
|
term-ansicolor (1.2.2)
|
|
225
235
|
tins (~> 0.8)
|
|
236
|
+
terminal-table (2.0.0)
|
|
237
|
+
unicode-display_width (~> 1.1, >= 1.1.1)
|
|
226
238
|
thor (0.18.1)
|
|
227
|
-
thread_safe (0.3.6)
|
|
228
239
|
tins (0.13.2)
|
|
229
|
-
tzinfo (
|
|
230
|
-
|
|
240
|
+
tzinfo (2.0.4)
|
|
241
|
+
concurrent-ruby (~> 1.0)
|
|
231
242
|
unicode-display_width (1.7.0)
|
|
232
|
-
webmock (3.
|
|
233
|
-
addressable (>= 2.
|
|
243
|
+
webmock (3.14.0)
|
|
244
|
+
addressable (>= 2.8.0)
|
|
234
245
|
crack (>= 0.3.2)
|
|
235
246
|
hashdiff (>= 0.4.0, < 2.0.0)
|
|
236
247
|
zeitwerk (2.4.2)
|
|
@@ -247,10 +258,10 @@ DEPENDENCIES
|
|
|
247
258
|
coveralls
|
|
248
259
|
dotenv
|
|
249
260
|
factory_bot (~> 6.1.0)
|
|
250
|
-
jekyll (~>
|
|
251
|
-
jekyll-menus (~> 0.6.
|
|
261
|
+
jekyll (~> 4.2.0)
|
|
262
|
+
jekyll-menus (~> 0.6.1)
|
|
252
263
|
jekyll-paginate (~> 1.1)
|
|
253
|
-
jekyll-paginate-v2 (~>
|
|
264
|
+
jekyll-paginate-v2 (~> 3.0)
|
|
254
265
|
ledger_sync!
|
|
255
266
|
overcommit (~> 0.57.0)
|
|
256
267
|
rake (~> 13.0)
|
|
@@ -261,4 +272,4 @@ DEPENDENCIES
|
|
|
261
272
|
webmock
|
|
262
273
|
|
|
263
274
|
BUNDLED WITH
|
|
264
|
-
2.
|
|
275
|
+
2.2.3
|
data/documentation/generate.rb
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
def green(str)
|
|
4
|
-
puts str.
|
|
4
|
+
puts Rainbow(str).green
|
|
5
5
|
end
|
|
6
6
|
|
|
7
7
|
def yellow(str)
|
|
8
|
-
puts str.
|
|
8
|
+
puts Rainbow(str).yellow
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def red(str)
|
|
12
|
-
puts str.
|
|
12
|
+
puts Rainbow(str).red
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def nl
|
data/ledger_sync.gemspec
CHANGED
|
@@ -38,10 +38,10 @@ Gem::Specification.new do |spec|
|
|
|
38
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')
|
|
@@ -50,7 +50,6 @@ Gem::Specification.new do |spec|
|
|
|
50
50
|
spec.add_development_dependency('simplecov-lcov')
|
|
51
51
|
spec.add_development_dependency('webmock', '>= 0')
|
|
52
52
|
spec.add_runtime_dependency('activemodel', '>= 0')
|
|
53
|
-
spec.add_runtime_dependency('colorize', '>= 0')
|
|
54
53
|
spec.add_runtime_dependency('dry-schema', '~> 1.5.4')
|
|
55
54
|
spec.add_runtime_dependency('dry-validation', '~> 1.5.6')
|
|
56
55
|
spec.add_runtime_dependency('faraday', '>= 0')
|
|
@@ -61,6 +60,7 @@ Gem::Specification.new do |spec|
|
|
|
61
60
|
spec.add_runtime_dependency('openssl', '~> 2.2.0')
|
|
62
61
|
spec.add_runtime_dependency('pd_ruby', '>= 0')
|
|
63
62
|
spec.add_runtime_dependency('rack', '~> 2.2.3')
|
|
63
|
+
spec.add_runtime_dependency('rainbow', '~> 3.0')
|
|
64
64
|
spec.add_runtime_dependency('resonad', '>= 0')
|
|
65
65
|
spec.add_runtime_dependency('simply_serializable', '>= 1.5.1')
|
|
66
66
|
end
|
|
@@ -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
|
|
@@ -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?
|
|
@@ -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
|
@@ -6,7 +6,7 @@ require 'dry-validation'
|
|
|
6
6
|
require 'logger'
|
|
7
7
|
require 'resonad'
|
|
8
8
|
require 'uri'
|
|
9
|
-
require '
|
|
9
|
+
require 'rainbow'
|
|
10
10
|
require 'fingerprintable'
|
|
11
11
|
require 'simply_serializable'
|
|
12
12
|
require 'active_model'
|
|
@@ -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,11 +1,11 @@
|
|
|
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.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryan Jackson
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
11
|
date: 2019-05-21 00:00:00.000000000 Z
|
|
@@ -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
|
|
@@ -290,20 +290,6 @@ dependencies:
|
|
|
290
290
|
- - ">="
|
|
291
291
|
- !ruby/object:Gem::Version
|
|
292
292
|
version: '0'
|
|
293
|
-
- !ruby/object:Gem::Dependency
|
|
294
|
-
name: colorize
|
|
295
|
-
requirement: !ruby/object:Gem::Requirement
|
|
296
|
-
requirements:
|
|
297
|
-
- - ">="
|
|
298
|
-
- !ruby/object:Gem::Version
|
|
299
|
-
version: '0'
|
|
300
|
-
type: :runtime
|
|
301
|
-
prerelease: false
|
|
302
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
303
|
-
requirements:
|
|
304
|
-
- - ">="
|
|
305
|
-
- !ruby/object:Gem::Version
|
|
306
|
-
version: '0'
|
|
307
293
|
- !ruby/object:Gem::Dependency
|
|
308
294
|
name: dry-schema
|
|
309
295
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -444,6 +430,20 @@ dependencies:
|
|
|
444
430
|
- - "~>"
|
|
445
431
|
- !ruby/object:Gem::Version
|
|
446
432
|
version: 2.2.3
|
|
433
|
+
- !ruby/object:Gem::Dependency
|
|
434
|
+
name: rainbow
|
|
435
|
+
requirement: !ruby/object:Gem::Requirement
|
|
436
|
+
requirements:
|
|
437
|
+
- - "~>"
|
|
438
|
+
- !ruby/object:Gem::Version
|
|
439
|
+
version: '3.0'
|
|
440
|
+
type: :runtime
|
|
441
|
+
prerelease: false
|
|
442
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
443
|
+
requirements:
|
|
444
|
+
- - "~>"
|
|
445
|
+
- !ruby/object:Gem::Version
|
|
446
|
+
version: '3.0'
|
|
447
447
|
- !ruby/object:Gem::Dependency
|
|
448
448
|
name: resonad
|
|
449
449
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -731,7 +731,6 @@ files:
|
|
|
731
731
|
- lib/ledger_sync/ledgers/searcher.rb
|
|
732
732
|
- lib/ledger_sync/operation.rb
|
|
733
733
|
- lib/ledger_sync/resource.rb
|
|
734
|
-
- lib/ledger_sync/resource_adaptor.rb
|
|
735
734
|
- lib/ledger_sync/resource_attribute.rb
|
|
736
735
|
- lib/ledger_sync/resource_attribute/dirty_mixin.rb
|
|
737
736
|
- lib/ledger_sync/resource_attribute/mixin.rb
|
|
@@ -833,7 +832,7 @@ homepage: https://github.com/LedgerSync/ledger_sync
|
|
|
833
832
|
licenses:
|
|
834
833
|
- MIT
|
|
835
834
|
metadata: {}
|
|
836
|
-
post_install_message:
|
|
835
|
+
post_install_message:
|
|
837
836
|
rdoc_options: []
|
|
838
837
|
require_paths:
|
|
839
838
|
- lib
|
|
@@ -848,8 +847,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
848
847
|
- !ruby/object:Gem::Version
|
|
849
848
|
version: '0'
|
|
850
849
|
requirements: []
|
|
851
|
-
|
|
852
|
-
|
|
850
|
+
rubyforge_project:
|
|
851
|
+
rubygems_version: 2.7.6.2
|
|
852
|
+
signing_key:
|
|
853
853
|
specification_version: 4
|
|
854
854
|
summary: Sync common objects to accounting software.
|
|
855
855
|
test_files: []
|
|
@@ -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
|