ledger_sync 2.0.0 → 2.0.1
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 +6 -2
- data/Gemfile.lock +67 -61
- data/README.md +1 -0
- data/ledger_sync.gemspec +3 -1
- data/lib/ledger_sync/test/support.rb +9 -2
- data/lib/ledger_sync/util/dotenv_updator.rb +17 -15
- data/lib/ledger_sync/version.rb +1 -1
- metadata +37 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a508dbdc56b416d158b3e0e16ab48f41c412d31aa2c4f13117576ec9765fbacd
|
4
|
+
data.tar.gz: fe55e1cfbc4b805e0baa0687154631e732ec6cc1017c0a72c277a45d2cde7fe0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7703a335bdeaae9f984a60461af9709832a454132af5b15a7732ecadf61a3e38a8d890cbcd145628d429acee71adc2c43a5c4a384cdbb19a385470e9a542d36f
|
7
|
+
data.tar.gz: 7f03b88e16c79ebc1fd2abb6b88e7e63c0af3563d31b6503c2cac1cdc189acdfc99de67641294678488ca5f0787d155d9156804b2587d72aec9c156ec2fcc4c1
|
@@ -37,9 +37,13 @@ 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
49
|
needs: ['rubocop', 'rspec']
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ledger_sync (2.0.
|
4
|
+
ledger_sync (2.0.1)
|
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,25 +30,25 @@ 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
|
-
|
43
|
-
|
44
|
-
|
45
|
-
simplecov (
|
46
|
-
term-ansicolor (
|
47
|
-
thor (
|
48
|
-
|
49
|
-
|
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
|
50
50
|
diff-lcs (1.4.4)
|
51
|
-
docile (1.3.
|
51
|
+
docile (1.3.5)
|
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,25 +89,26 @@ 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.4.
|
96
|
-
faraday-
|
94
|
+
faraday (1.4.2)
|
95
|
+
faraday-em_http (~> 1.0)
|
96
|
+
faraday-em_synchrony (~> 1.0)
|
97
|
+
faraday-excon (~> 1.1)
|
97
98
|
faraday-net_http (~> 1.0)
|
98
|
-
faraday-net_http_persistent (~> 1.
|
99
|
+
faraday-net_http_persistent (~> 1.1)
|
99
100
|
multipart-post (>= 1.2, < 3)
|
100
101
|
ruby2_keywords (>= 0.0.4)
|
101
102
|
faraday-detailed_logger (2.3.0)
|
102
103
|
faraday (>= 0.8, < 2)
|
103
|
-
faraday-
|
104
|
-
|
104
|
+
faraday-em_http (1.0.0)
|
105
|
+
faraday-em_synchrony (1.0.0)
|
106
|
+
faraday-excon (1.1.0)
|
105
107
|
faraday-net_http (1.0.1)
|
106
|
-
faraday-net_http_persistent (1.0
|
107
|
-
net-http-persistent (>= 3.1)
|
108
|
+
faraday-net_http_persistent (1.1.0)
|
108
109
|
faraday_middleware (1.0.0)
|
109
110
|
faraday (~> 1.0)
|
110
|
-
ffi (1.
|
111
|
+
ffi (1.15.0)
|
111
112
|
fingerprintable (1.2.1)
|
112
113
|
colorize
|
113
114
|
forwardable-extended (2.6.0)
|
@@ -138,27 +139,28 @@ GEM
|
|
138
139
|
sass (~> 3.4)
|
139
140
|
jekyll-watch (2.2.1)
|
140
141
|
listen (~> 3.0)
|
141
|
-
json (2.3.1)
|
142
142
|
kramdown (1.17.0)
|
143
143
|
liquid (4.0.3)
|
144
|
-
listen (3.
|
144
|
+
listen (3.5.1)
|
145
145
|
rb-fsevent (~> 0.10, >= 0.10.3)
|
146
146
|
rb-inotify (~> 0.9, >= 0.9.10)
|
147
147
|
mercenary (0.3.6)
|
148
|
-
|
149
|
-
|
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)
|
150
154
|
multipart-post (2.1.1)
|
151
|
-
|
152
|
-
connection_pool (~> 2.2)
|
153
|
-
nokogiri (1.11.3)
|
155
|
+
nokogiri (1.11.7)
|
154
156
|
mini_portile2 (~> 2.5.0)
|
155
157
|
racc (~> 1.4)
|
156
158
|
openssl (2.2.0)
|
157
159
|
overcommit (0.57.0)
|
158
160
|
childprocess (>= 0.6.3, < 5)
|
159
161
|
iniparse (~> 1.4)
|
160
|
-
parallel (1.20.
|
161
|
-
parser (
|
162
|
+
parallel (1.20.1)
|
163
|
+
parser (3.0.1.0)
|
162
164
|
ast (~> 2.4.1)
|
163
165
|
pathutil (0.16.2)
|
164
166
|
forwardable-extended (~> 2.6)
|
@@ -168,27 +170,29 @@ GEM
|
|
168
170
|
racc (1.5.2)
|
169
171
|
rack (2.2.3)
|
170
172
|
rainbow (3.0.0)
|
171
|
-
rake (13.0.
|
173
|
+
rake (13.0.3)
|
172
174
|
rb-fsevent (0.10.4)
|
173
175
|
rb-inotify (0.10.1)
|
174
176
|
ffi (~> 1.0)
|
175
|
-
regexp_parser (1.
|
177
|
+
regexp_parser (2.1.1)
|
176
178
|
resonad (1.4.0)
|
177
|
-
|
178
|
-
|
179
|
+
rest-client (1.6.7)
|
180
|
+
mime-types (>= 1.16)
|
181
|
+
rexml (3.2.5)
|
182
|
+
rouge (3.26.0)
|
179
183
|
rspec (3.10.0)
|
180
184
|
rspec-core (~> 3.10.0)
|
181
185
|
rspec-expectations (~> 3.10.0)
|
182
186
|
rspec-mocks (~> 3.10.0)
|
183
|
-
rspec-core (3.10.
|
187
|
+
rspec-core (3.10.1)
|
184
188
|
rspec-support (~> 3.10.0)
|
185
|
-
rspec-expectations (3.10.
|
189
|
+
rspec-expectations (3.10.1)
|
186
190
|
diff-lcs (>= 1.2.0, < 2.0)
|
187
191
|
rspec-support (~> 3.10.0)
|
188
|
-
rspec-mocks (3.10.
|
192
|
+
rspec-mocks (3.10.2)
|
189
193
|
diff-lcs (>= 1.2.0, < 2.0)
|
190
194
|
rspec-support (~> 3.10.0)
|
191
|
-
rspec-support (3.10.
|
195
|
+
rspec-support (3.10.2)
|
192
196
|
rubocop (1.0.0)
|
193
197
|
parallel (~> 1.10)
|
194
198
|
parser (>= 2.7.1.5)
|
@@ -198,9 +202,9 @@ GEM
|
|
198
202
|
rubocop-ast (>= 0.6.0)
|
199
203
|
ruby-progressbar (~> 1.7)
|
200
204
|
unicode-display_width (>= 1.4.0, < 2.0)
|
201
|
-
rubocop-ast (1.
|
205
|
+
rubocop-ast (1.4.1)
|
202
206
|
parser (>= 2.7.1.5)
|
203
|
-
ruby-progressbar (1.
|
207
|
+
ruby-progressbar (1.11.0)
|
204
208
|
ruby2_keywords (0.0.4)
|
205
209
|
safe_yaml (1.0.5)
|
206
210
|
sass (3.7.4)
|
@@ -208,28 +212,28 @@ GEM
|
|
208
212
|
sass-listen (4.0.0)
|
209
213
|
rb-fsevent (~> 0.9, >= 0.9.4)
|
210
214
|
rb-inotify (~> 0.9, >= 0.9.7)
|
211
|
-
simplecov (0.
|
215
|
+
simplecov (0.21.2)
|
212
216
|
docile (~> 1.1)
|
213
|
-
|
214
|
-
|
215
|
-
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)
|
216
222
|
simply_serializable (1.5.1)
|
217
223
|
fingerprintable (>= 1.2.1)
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
thor (1.0.1)
|
224
|
+
term-ansicolor (1.2.2)
|
225
|
+
tins (~> 0.8)
|
226
|
+
thor (0.18.1)
|
222
227
|
thread_safe (0.3.6)
|
223
|
-
tins (
|
224
|
-
|
225
|
-
tzinfo (1.2.8)
|
228
|
+
tins (0.13.2)
|
229
|
+
tzinfo (1.2.9)
|
226
230
|
thread_safe (~> 0.1)
|
227
231
|
unicode-display_width (1.7.0)
|
228
|
-
webmock (3.
|
232
|
+
webmock (3.12.2)
|
229
233
|
addressable (>= 2.3.6)
|
230
234
|
crack (>= 0.3.2)
|
231
235
|
hashdiff (>= 0.4.0, < 2.0.0)
|
232
|
-
zeitwerk (2.4.
|
236
|
+
zeitwerk (2.4.2)
|
233
237
|
|
234
238
|
PLATFORMS
|
235
239
|
ruby
|
@@ -240,7 +244,7 @@ DEPENDENCIES
|
|
240
244
|
bundler (~> 2.1)
|
241
245
|
byebug
|
242
246
|
climate_control
|
243
|
-
coveralls
|
247
|
+
coveralls
|
244
248
|
dotenv
|
245
249
|
factory_bot (~> 6.1.0)
|
246
250
|
jekyll (~> 3.8.4)
|
@@ -252,6 +256,8 @@ DEPENDENCIES
|
|
252
256
|
rake (~> 13.0)
|
253
257
|
rspec (~> 3.2)
|
254
258
|
rubocop (= 1.0.0)
|
259
|
+
simplecov
|
260
|
+
simplecov-lcov
|
255
261
|
webmock
|
256
262
|
|
257
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
|
|
@@ -9,27 +9,29 @@ module LedgerSync
|
|
9
9
|
@file_path = args.fetch(:file_path, File.join(Dir.pwd, '.env.local'))
|
10
10
|
end
|
11
11
|
|
12
|
-
def update(args = {})
|
12
|
+
def update(args = {}) # rubocop:disable Metrics/CyclomaticComplexity,Metrics/PerceivedComplexity
|
13
13
|
client = args.fetch(:client)
|
14
14
|
prefix = args.fetch(:prefix, "#{client.class.config.root_key.upcase}_")
|
15
15
|
|
16
16
|
to_save = client.ledger_attributes_to_save.dup.stringify_keys
|
17
17
|
|
18
18
|
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
|
-
|
19
|
+
if File.file?(file_path)
|
20
|
+
File.open(file_path).each do |line|
|
21
|
+
env_key = line.split('=').first
|
22
|
+
client_method = env_key.split(prefix).last.downcase
|
23
|
+
|
24
|
+
if line =~ /\A#{prefix}/ && to_save.key?(client_method)
|
25
|
+
env_value = ENV[env_key]
|
26
|
+
new_value = to_save.delete(client_method)
|
27
|
+
tempfile.puts "#{env_key}=#{new_value}"
|
28
|
+
next if env_value == new_value.to_s
|
29
|
+
|
30
|
+
ENV[env_key] = new_value.to_s
|
31
|
+
tempfile.puts "# #{env_key}=#{env_value} # Updated on #{Time.now}"
|
32
|
+
else
|
33
|
+
tempfile.puts line
|
34
|
+
end
|
33
35
|
end
|
34
36
|
end
|
35
37
|
|
data/lib/ledger_sync/version.rb
CHANGED
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.0.
|
4
|
+
version: 2.0.1
|
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
|
@@ -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: []
|