ledger_sync 1.8.0 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/gem-workflow.yml +71 -0
- data/.rubocop.yml +1 -0
- data/Gemfile.lock +79 -62
- data/README.md +1 -0
- data/ledger_sync.gemspec +3 -1
- data/lib/ledger_sync/ledgers/operation.rb +1 -1
- data/lib/ledger_sync/test/support.rb +9 -2
- data/lib/ledger_sync/test/support/qa/shared_examples.rb +13 -3
- data/lib/ledger_sync/test/support/test_ledger/customer/deserializer.rb +2 -0
- data/lib/ledger_sync/util/dotenv_updator.rb +19 -15
- data/lib/ledger_sync/version.rb +6 -4
- metadata +38 -10
- data/.coveralls.yml +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4a9f9dfb5b4043145f586c9a4521a8a7c20f3459caff689bcdc405cd5c0eed2
|
4
|
+
data.tar.gz: 30545ebfe3959dcbf369eeda8b27a4968f94a9526a04334be5897281266f7698
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f67f5788295ffbcfe881c30704e4ce6cf8d06e1b556af9743c88ba363557ba46655f71045a0dc3ace0704ebba61fa2828b4e685fa2cf9b13526261fbc620fc7
|
7
|
+
data.tar.gz: ae69cc1e202fcf25c44703601933de21561393204af5ae153896456b6d4b3d09489dd3cf812d780c5bb322def8f3e64c3ba21b183ba382f333ad7e23580c06b4
|
@@ -0,0 +1,71 @@
|
|
1
|
+
name: Test and Deploy
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
pull_request:
|
5
|
+
release:
|
6
|
+
types: [created]
|
7
|
+
jobs:
|
8
|
+
rubocop:
|
9
|
+
strategy:
|
10
|
+
matrix:
|
11
|
+
ruby-version: [2.6.3, 2.6.6, 2.7.1]
|
12
|
+
runs-on: [ubuntu-latest]
|
13
|
+
steps:
|
14
|
+
- uses: actions/checkout@v2
|
15
|
+
with:
|
16
|
+
persist-credentials: false
|
17
|
+
fetch-depth: 0
|
18
|
+
- name: Ruby Setup and Bundle
|
19
|
+
uses: ruby/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: ${{ matrix.ruby-version }}
|
22
|
+
bundler-cache: true
|
23
|
+
- run: bundle exec rubocop
|
24
|
+
rspec:
|
25
|
+
strategy:
|
26
|
+
matrix:
|
27
|
+
ruby-version: [2.6.3, 2.6.6, 2.7.1]
|
28
|
+
runs-on: [ubuntu-latest]
|
29
|
+
steps:
|
30
|
+
- uses: actions/checkout@v2
|
31
|
+
with:
|
32
|
+
persist-credentials: false
|
33
|
+
fetch-depth: 0
|
34
|
+
- name: Ruby Setup and Bundle
|
35
|
+
uses: ruby/setup-ruby@v1
|
36
|
+
with:
|
37
|
+
ruby-version: ${{ matrix.ruby-version }}
|
38
|
+
bundler-cache: true
|
39
|
+
- name: rspec and report to coveralls
|
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 }}
|
47
|
+
publish:
|
48
|
+
runs-on: ubuntu-latest
|
49
|
+
needs: ['rubocop', 'rspec']
|
50
|
+
if: github.event_name == 'release' && github.event.action == 'created'
|
51
|
+
steps:
|
52
|
+
- name: Checkout
|
53
|
+
uses: actions/checkout@v2
|
54
|
+
with:
|
55
|
+
persist-credentials: false
|
56
|
+
fetch-depth: 0
|
57
|
+
- name: Ruby Setup and Bundle
|
58
|
+
uses: ruby/setup-ruby@v1
|
59
|
+
with:
|
60
|
+
ruby-version: 2.7.1
|
61
|
+
bundler-cache: true
|
62
|
+
- name: Publish to RubyGems
|
63
|
+
run: |
|
64
|
+
mkdir -p $HOME/.gem
|
65
|
+
touch $HOME/.gem/credentials
|
66
|
+
chmod 0600 $HOME/.gem/credentials
|
67
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
68
|
+
gem build *.gemspec
|
69
|
+
gem push *.gem
|
70
|
+
env:
|
71
|
+
GEM_HOST_API_KEY: "${{ secrets.RUBY_GEM_KEY }}"
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ledger_sync (
|
4
|
+
ledger_sync (2.0.2)
|
5
5
|
activemodel
|
6
6
|
colorize
|
7
7
|
dry-schema (~> 1.5.4)
|
@@ -20,9 +20,9 @@ PATH
|
|
20
20
|
GEM
|
21
21
|
remote: https://rubygems.org/
|
22
22
|
specs:
|
23
|
-
activemodel (6.0.3.
|
24
|
-
activesupport (= 6.0.3.
|
25
|
-
activesupport (6.0.3.
|
23
|
+
activemodel (6.0.3.6)
|
24
|
+
activesupport (= 6.0.3.6)
|
25
|
+
activesupport (6.0.3.6)
|
26
26
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
27
27
|
i18n (>= 0.7, < 2)
|
28
28
|
minitest (~> 5.1)
|
@@ -30,41 +30,40 @@ GEM
|
|
30
30
|
zeitwerk (~> 2.2, >= 2.2.2)
|
31
31
|
addressable (2.7.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
37
|
childprocess (4.0.0)
|
38
|
-
climate_control (0.
|
38
|
+
climate_control (1.0.0)
|
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.8)
|
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.3.
|
51
|
+
docile (1.3.5)
|
51
52
|
dotenv (2.7.6)
|
52
|
-
dry-configurable (0.
|
53
|
+
dry-configurable (0.12.1)
|
53
54
|
concurrent-ruby (~> 1.0)
|
54
|
-
dry-core (~> 0.
|
55
|
-
dry-equalizer (~> 0.2)
|
55
|
+
dry-core (~> 0.5, >= 0.5.0)
|
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.0
|
64
|
+
dry-logic (1.2.0)
|
65
65
|
concurrent-ruby (~> 1.0)
|
66
|
-
dry-core (~> 0.
|
67
|
-
dry-equalizer (~> 0.2)
|
66
|
+
dry-core (~> 0.5, >= 0.5)
|
68
67
|
dry-schema (1.5.6)
|
69
68
|
concurrent-ruby (~> 1.0)
|
70
69
|
dry-configurable (~> 0.8, >= 0.8.3)
|
@@ -73,11 +72,10 @@ GEM
|
|
73
72
|
dry-initializer (~> 3.0)
|
74
73
|
dry-logic (~> 1.0)
|
75
74
|
dry-types (~> 1.4)
|
76
|
-
dry-types (1.
|
75
|
+
dry-types (1.5.1)
|
77
76
|
concurrent-ruby (~> 1.0)
|
78
77
|
dry-container (~> 0.3)
|
79
|
-
dry-core (~> 0.
|
80
|
-
dry-equalizer (~> 0.3)
|
78
|
+
dry-core (~> 0.5, >= 0.5)
|
81
79
|
dry-inflector (~> 0.1, >= 0.1.2)
|
82
80
|
dry-logic (~> 1.0, >= 1.0.2)
|
83
81
|
dry-validation (1.5.6)
|
@@ -93,14 +91,24 @@ GEM
|
|
93
91
|
eventmachine (1.2.7)
|
94
92
|
factory_bot (6.1.0)
|
95
93
|
activesupport (>= 5.0.0)
|
96
|
-
faraday (1.
|
94
|
+
faraday (1.4.2)
|
95
|
+
faraday-em_http (~> 1.0)
|
96
|
+
faraday-em_synchrony (~> 1.0)
|
97
|
+
faraday-excon (~> 1.1)
|
98
|
+
faraday-net_http (~> 1.0)
|
99
|
+
faraday-net_http_persistent (~> 1.1)
|
97
100
|
multipart-post (>= 1.2, < 3)
|
98
|
-
ruby2_keywords
|
101
|
+
ruby2_keywords (>= 0.0.4)
|
99
102
|
faraday-detailed_logger (2.3.0)
|
100
103
|
faraday (>= 0.8, < 2)
|
104
|
+
faraday-em_http (1.0.0)
|
105
|
+
faraday-em_synchrony (1.0.0)
|
106
|
+
faraday-excon (1.1.0)
|
107
|
+
faraday-net_http (1.0.1)
|
108
|
+
faraday-net_http_persistent (1.1.0)
|
101
109
|
faraday_middleware (1.0.0)
|
102
110
|
faraday (~> 1.0)
|
103
|
-
ffi (1.
|
111
|
+
ffi (1.15.0)
|
104
112
|
fingerprintable (1.2.1)
|
105
113
|
colorize
|
106
114
|
forwardable-extended (2.6.0)
|
@@ -131,53 +139,60 @@ GEM
|
|
131
139
|
sass (~> 3.4)
|
132
140
|
jekyll-watch (2.2.1)
|
133
141
|
listen (~> 3.0)
|
134
|
-
json (2.3.1)
|
135
142
|
kramdown (1.17.0)
|
136
143
|
liquid (4.0.3)
|
137
|
-
listen (3.
|
144
|
+
listen (3.5.1)
|
138
145
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
139
146
|
rb-inotify (~> 0.9, >= 0.9.10)
|
140
147
|
mercenary (0.3.6)
|
141
|
-
|
142
|
-
|
148
|
+
mime-types (3.3.1)
|
149
|
+
mime-types-data (~> 3.2015)
|
150
|
+
mime-types-data (3.2021.0225)
|
151
|
+
mini_portile2 (2.5.3)
|
152
|
+
minitest (5.14.4)
|
153
|
+
multi_json (1.15.0)
|
143
154
|
multipart-post (2.1.1)
|
144
|
-
nokogiri (1.
|
145
|
-
mini_portile2 (~> 2.
|
155
|
+
nokogiri (1.11.7)
|
156
|
+
mini_portile2 (~> 2.5.0)
|
157
|
+
racc (~> 1.4)
|
146
158
|
openssl (2.2.0)
|
147
159
|
overcommit (0.57.0)
|
148
160
|
childprocess (>= 0.6.3, < 5)
|
149
161
|
iniparse (~> 1.4)
|
150
|
-
parallel (1.20.
|
151
|
-
parser (
|
162
|
+
parallel (1.20.1)
|
163
|
+
parser (3.0.1.0)
|
152
164
|
ast (~> 2.4.1)
|
153
165
|
pathutil (0.16.2)
|
154
166
|
forwardable-extended (~> 2.6)
|
155
167
|
pd_ruby (0.2.3)
|
156
168
|
colorize
|
157
169
|
public_suffix (4.0.6)
|
170
|
+
racc (1.5.2)
|
158
171
|
rack (2.2.3)
|
159
172
|
rainbow (3.0.0)
|
160
|
-
rake (13.0.
|
173
|
+
rake (13.0.3)
|
161
174
|
rb-fsevent (0.10.4)
|
162
175
|
rb-inotify (0.10.1)
|
163
176
|
ffi (~> 1.0)
|
164
|
-
regexp_parser (1.
|
177
|
+
regexp_parser (2.1.1)
|
165
178
|
resonad (1.4.0)
|
166
|
-
|
167
|
-
|
179
|
+
rest-client (1.6.7)
|
180
|
+
mime-types (>= 1.16)
|
181
|
+
rexml (3.2.5)
|
182
|
+
rouge (3.26.0)
|
168
183
|
rspec (3.10.0)
|
169
184
|
rspec-core (~> 3.10.0)
|
170
185
|
rspec-expectations (~> 3.10.0)
|
171
186
|
rspec-mocks (~> 3.10.0)
|
172
|
-
rspec-core (3.10.
|
187
|
+
rspec-core (3.10.1)
|
173
188
|
rspec-support (~> 3.10.0)
|
174
|
-
rspec-expectations (3.10.
|
189
|
+
rspec-expectations (3.10.1)
|
175
190
|
diff-lcs (>= 1.2.0, < 2.0)
|
176
191
|
rspec-support (~> 3.10.0)
|
177
|
-
rspec-mocks (3.10.
|
192
|
+
rspec-mocks (3.10.2)
|
178
193
|
diff-lcs (>= 1.2.0, < 2.0)
|
179
194
|
rspec-support (~> 3.10.0)
|
180
|
-
rspec-support (3.10.
|
195
|
+
rspec-support (3.10.2)
|
181
196
|
rubocop (1.0.0)
|
182
197
|
parallel (~> 1.10)
|
183
198
|
parser (>= 2.7.1.5)
|
@@ -187,38 +202,38 @@ GEM
|
|
187
202
|
rubocop-ast (>= 0.6.0)
|
188
203
|
ruby-progressbar (~> 1.7)
|
189
204
|
unicode-display_width (>= 1.4.0, < 2.0)
|
190
|
-
rubocop-ast (1.
|
205
|
+
rubocop-ast (1.4.1)
|
191
206
|
parser (>= 2.7.1.5)
|
192
|
-
ruby-progressbar (1.
|
193
|
-
ruby2_keywords (0.0.
|
207
|
+
ruby-progressbar (1.11.0)
|
208
|
+
ruby2_keywords (0.0.4)
|
194
209
|
safe_yaml (1.0.5)
|
195
210
|
sass (3.7.4)
|
196
211
|
sass-listen (~> 4.0.0)
|
197
212
|
sass-listen (4.0.0)
|
198
213
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
199
214
|
rb-inotify (~> 0.9, >= 0.9.7)
|
200
|
-
simplecov (0.
|
215
|
+
simplecov (0.21.2)
|
201
216
|
docile (~> 1.1)
|
202
|
-
|
203
|
-
|
204
|
-
simplecov-html (0.
|
217
|
+
simplecov-html (~> 0.11)
|
218
|
+
simplecov_json_formatter (~> 0.1)
|
219
|
+
simplecov-html (0.12.3)
|
220
|
+
simplecov-lcov (0.8.0)
|
221
|
+
simplecov_json_formatter (0.1.2)
|
205
222
|
simply_serializable (1.5.1)
|
206
223
|
fingerprintable (>= 1.2.1)
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
thor (1.0.1)
|
224
|
+
term-ansicolor (1.2.2)
|
225
|
+
tins (~> 0.8)
|
226
|
+
thor (0.18.1)
|
211
227
|
thread_safe (0.3.6)
|
212
|
-
tins (
|
213
|
-
|
214
|
-
tzinfo (1.2.8)
|
228
|
+
tins (0.13.2)
|
229
|
+
tzinfo (1.2.9)
|
215
230
|
thread_safe (~> 0.1)
|
216
231
|
unicode-display_width (1.7.0)
|
217
|
-
webmock (3.
|
232
|
+
webmock (3.12.2)
|
218
233
|
addressable (>= 2.3.6)
|
219
234
|
crack (>= 0.3.2)
|
220
235
|
hashdiff (>= 0.4.0, < 2.0.0)
|
221
|
-
zeitwerk (2.4.
|
236
|
+
zeitwerk (2.4.2)
|
222
237
|
|
223
238
|
PLATFORMS
|
224
239
|
ruby
|
@@ -229,7 +244,7 @@ DEPENDENCIES
|
|
229
244
|
bundler (~> 2.1)
|
230
245
|
byebug
|
231
246
|
climate_control
|
232
|
-
coveralls
|
247
|
+
coveralls
|
233
248
|
dotenv
|
234
249
|
factory_bot (~> 6.1.0)
|
235
250
|
jekyll (~> 3.8.4)
|
@@ -241,6 +256,8 @@ DEPENDENCIES
|
|
241
256
|
rake (~> 13.0)
|
242
257
|
rspec (~> 3.2)
|
243
258
|
rubocop (= 1.0.0)
|
259
|
+
simplecov
|
260
|
+
simplecov-lcov
|
244
261
|
webmock
|
245
262
|
|
246
263
|
BUNDLED WITH
|
data/README.md
CHANGED
data/ledger_sync.gemspec
CHANGED
@@ -35,7 +35,7 @@ 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
41
|
spec.add_development_dependency('jekyll', '~> 3.8.4')
|
@@ -46,6 +46,8 @@ Gem::Specification.new do |spec|
|
|
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')
|
@@ -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
|
|
@@ -7,7 +7,10 @@ RSpec.shared_examples 'a create' do |delete: true|
|
|
7
7
|
resource: resource
|
8
8
|
)
|
9
9
|
|
10
|
-
|
10
|
+
if result.failure?
|
11
|
+
pd result.response.response.body
|
12
|
+
byebug if ENV['DEBUG'] # rubocop:disable Lint/Debugger
|
13
|
+
end
|
11
14
|
|
12
15
|
expect(result).to be_success
|
13
16
|
|
@@ -52,7 +55,11 @@ RSpec.shared_examples 'a find' do |delete: true|
|
|
52
55
|
resource: resource
|
53
56
|
)
|
54
57
|
|
55
|
-
|
58
|
+
if result.failure?
|
59
|
+
pd result.response.response.body
|
60
|
+
byebug if ENV['DEBUG'] # rubocop:disable Lint/Debugger
|
61
|
+
end
|
62
|
+
|
56
63
|
result.raise_if_error
|
57
64
|
expect(result).to be_success
|
58
65
|
resource = result.resource
|
@@ -146,7 +153,10 @@ RSpec.shared_examples 'a searcher' do
|
|
146
153
|
it do
|
147
154
|
result = client.searcher_for(resource_type: resource.class.resource_module_str).search
|
148
155
|
|
149
|
-
|
156
|
+
if result.failure?
|
157
|
+
pd result.response.response.body
|
158
|
+
byebug if ENV['DEBUG'] # rubocop:disable Lint/Debugger
|
159
|
+
end
|
150
160
|
|
151
161
|
expect(result).to be_success
|
152
162
|
end
|
@@ -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
|
|
data/lib/ledger_sync/version.rb
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
# :nocov:
|
3
4
|
module LedgerSync
|
4
|
-
VERSION = '
|
5
|
+
VERSION = '2.0.2'
|
5
6
|
|
6
7
|
def self.version
|
7
|
-
if
|
8
|
-
VERSION
|
8
|
+
if ENV['PRE_RELEASE']
|
9
|
+
"#{VERSION}.pre.#{ENV['GITHUB_RUN_NUMBER']}"
|
9
10
|
else
|
10
|
-
|
11
|
+
VERSION
|
11
12
|
end
|
12
13
|
end
|
13
14
|
end
|
15
|
+
# :nocov:
|
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:
|
4
|
+
version: 2.0.2
|
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
|
@@ -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
|
@@ -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
|
@@ -452,10 +480,10 @@ executables: []
|
|
452
480
|
extensions: []
|
453
481
|
extra_rdoc_files: []
|
454
482
|
files:
|
455
|
-
- ".coveralls.yml"
|
456
483
|
- ".env.template"
|
457
484
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
458
485
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
486
|
+
- ".github/workflows/gem-workflow.yml"
|
459
487
|
- ".gitignore"
|
460
488
|
- ".overcommit.yml"
|
461
489
|
- ".rubocop.yml"
|
@@ -805,7 +833,7 @@ homepage: https://github.com/LedgerSync/ledger_sync
|
|
805
833
|
licenses:
|
806
834
|
- MIT
|
807
835
|
metadata: {}
|
808
|
-
post_install_message:
|
836
|
+
post_install_message:
|
809
837
|
rdoc_options: []
|
810
838
|
require_paths:
|
811
839
|
- lib
|
@@ -820,8 +848,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
820
848
|
- !ruby/object:Gem::Version
|
821
849
|
version: '0'
|
822
850
|
requirements: []
|
823
|
-
rubygems_version: 3.
|
824
|
-
signing_key:
|
851
|
+
rubygems_version: 3.1.6
|
852
|
+
signing_key:
|
825
853
|
specification_version: 4
|
826
854
|
summary: Sync common objects to accounting software.
|
827
855
|
test_files: []
|
data/.coveralls.yml
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
service_name: travis-ci
|