eac_tools 0.55.1 → 0.55.2
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/Gemfile.lock +45 -55
- data/lib/eac_tools/version.rb +1 -1
- data/sub/aranha-parsers/aranha-parsers.gemspec +5 -4
- data/sub/aranha-parsers/lib/aranha/parsers/source_address/fetch_content_error.rb +6 -0
- data/sub/aranha-parsers/lib/aranha/parsers/source_address/hash_http_base.rb +5 -3
- data/sub/aranha-parsers/lib/aranha/parsers/source_address/http_get.rb +5 -4
- data/sub/aranha-parsers/lib/aranha/parsers/version.rb +1 -1
- data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +3 -2
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/launcher_stereotypes/base/publish.rb +2 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
- data/sub/eac_cli/eac_cli.gemspec +1 -1
- data/sub/eac_cli/lib/eac_cli/runner_with_set.rb +2 -0
- data/sub/eac_cli/lib/eac_cli/version.rb +1 -1
- data/sub/eac_docker/eac_docker.gemspec +1 -1
- data/sub/eac_docker/lib/eac_docker/container.rb +5 -0
- data/sub/eac_docker/lib/eac_docker/rspec/stub_image.rb +40 -0
- data/sub/eac_docker/lib/eac_docker/version.rb +1 -1
- data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +2 -2
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/immutable/hash_accessor.rb +23 -12
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/{immutable_spec.rb → immutable/array_accessor_spec.rb} +4 -3
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/immutable/hash_accessor_spec.rb +42 -0
- metadata +13 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f422d1a69e178f4f0643f72beb0c158f48c2ded6e611953f7c2ee64c8c23aad2
|
|
4
|
+
data.tar.gz: 33310a5babdc387e1087e5b32a3b40eb9ddc551dd9be0fa1109874debd509029
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2ebc2f2627a4c1d3b36c8149fb9689ba453d4d83e35de12dfb6bd0725b87c8468446c3ed7f20753f60e914910b53ca06e881ff3fbd7eb4514b962632f12a34ab
|
|
7
|
+
data.tar.gz: ee550bf4b5ccc5c7996a2e816f24a5fe7861e47a2c8c23e2f86c6c455b64651d3de8190b8b0ce6d3ccf1b570a517e5d1af7d3611a7303242872d65b342604985
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
eac_tools (0.55.
|
|
4
|
+
eac_tools (0.55.2)
|
|
5
5
|
avm (~> 0.62)
|
|
6
6
|
avm-eac_asciidoctor_base0 (~> 0.15)
|
|
7
7
|
avm-eac_generic_base0 (~> 0.10)
|
|
@@ -13,23 +13,24 @@ PATH
|
|
|
13
13
|
avm-eac_rails_base1 (~> 0.8)
|
|
14
14
|
avm-eac_redmine_base0 (~> 0.18)
|
|
15
15
|
avm-eac_redmine_plugin_base0 (~> 0.4)
|
|
16
|
-
avm-eac_ruby_base1 (~> 0.29)
|
|
16
|
+
avm-eac_ruby_base1 (~> 0.29, >= 0.29.1)
|
|
17
17
|
avm-eac_webapp_base0 (~> 0.13, >= 0.13.1)
|
|
18
18
|
avm-eac_wordpress_base0 (~> 0.3)
|
|
19
19
|
avm-tools (~> 0.145, >= 0.145.1)
|
|
20
|
-
eac_ruby_utils (~> 0.
|
|
20
|
+
eac_ruby_utils (~> 0.112)
|
|
21
21
|
|
|
22
22
|
PATH
|
|
23
23
|
remote: sub/aranha-parsers
|
|
24
24
|
specs:
|
|
25
|
-
aranha-parsers (0.
|
|
25
|
+
aranha-parsers (0.16.0)
|
|
26
26
|
activesupport (>= 4.0.0)
|
|
27
27
|
addressable (~> 2.8, >= 2.8.1)
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
eac_ruby_utils (~> 0.112)
|
|
29
|
+
faraday (~> 2.7, >= 2.7.4)
|
|
30
|
+
faraday-follow_redirects (~> 0.3)
|
|
30
31
|
faraday-gzip (~> 0.1)
|
|
31
|
-
|
|
32
|
-
nokogiri (~> 1.
|
|
32
|
+
faraday-retry (~> 2.1)
|
|
33
|
+
nokogiri (~> 1.14, >= 1.14.2)
|
|
33
34
|
ofx-parser (~> 1.1)
|
|
34
35
|
|
|
35
36
|
PATH
|
|
@@ -118,10 +119,11 @@ PATH
|
|
|
118
119
|
PATH
|
|
119
120
|
remote: sub/avm-eac_ruby_base1
|
|
120
121
|
specs:
|
|
121
|
-
avm-eac_ruby_base1 (0.29.
|
|
122
|
-
|
|
122
|
+
avm-eac_ruby_base1 (0.29.1)
|
|
123
|
+
aranha-parsers (~> 0.16)
|
|
124
|
+
avm (~> 0.62)
|
|
123
125
|
avm-eac_generic_base0 (~> 0.10)
|
|
124
|
-
eac_ruby_utils (~> 0.
|
|
126
|
+
eac_ruby_utils (~> 0.112)
|
|
125
127
|
|
|
126
128
|
PATH
|
|
127
129
|
remote: sub/avm-eac_ubuntu_base0
|
|
@@ -207,10 +209,10 @@ PATH
|
|
|
207
209
|
PATH
|
|
208
210
|
remote: sub/eac_cli
|
|
209
211
|
specs:
|
|
210
|
-
eac_cli (0.30.
|
|
212
|
+
eac_cli (0.30.1)
|
|
211
213
|
colorize (~> 0.8, >= 0.8.1)
|
|
212
214
|
eac_config (~> 0.12)
|
|
213
|
-
eac_ruby_utils (~> 0.
|
|
215
|
+
eac_ruby_utils (~> 0.112)
|
|
214
216
|
|
|
215
217
|
PATH
|
|
216
218
|
remote: sub/eac_config
|
|
@@ -222,8 +224,8 @@ PATH
|
|
|
222
224
|
PATH
|
|
223
225
|
remote: sub/eac_docker
|
|
224
226
|
specs:
|
|
225
|
-
eac_docker (0.
|
|
226
|
-
eac_ruby_utils (~> 0.
|
|
227
|
+
eac_docker (0.6.0)
|
|
228
|
+
eac_ruby_utils (~> 0.112)
|
|
227
229
|
eac_templates (~> 0.3, >= 0.3.2)
|
|
228
230
|
|
|
229
231
|
PATH
|
|
@@ -244,16 +246,16 @@ PATH
|
|
|
244
246
|
PATH
|
|
245
247
|
remote: sub/eac_ruby_base0
|
|
246
248
|
specs:
|
|
247
|
-
eac_ruby_base0 (0.17.
|
|
249
|
+
eac_ruby_base0 (0.17.3)
|
|
248
250
|
avm-eac_ruby_base1 (~> 0.29)
|
|
249
|
-
eac_cli (~> 0.30)
|
|
251
|
+
eac_cli (~> 0.30, >= 0.30.1)
|
|
250
252
|
eac_fs (~> 0.16)
|
|
251
|
-
eac_ruby_utils (~> 0.
|
|
253
|
+
eac_ruby_utils (~> 0.112)
|
|
252
254
|
|
|
253
255
|
PATH
|
|
254
256
|
remote: sub/eac_ruby_utils
|
|
255
257
|
specs:
|
|
256
|
-
eac_ruby_utils (0.
|
|
258
|
+
eac_ruby_utils (0.112.0)
|
|
257
259
|
activesupport (>= 4, < 7)
|
|
258
260
|
addressable (~> 2.8, >= 2.8.1)
|
|
259
261
|
bundler
|
|
@@ -263,7 +265,7 @@ PATH
|
|
|
263
265
|
GEM
|
|
264
266
|
remote: https://rubygems.org/
|
|
265
267
|
specs:
|
|
266
|
-
activesupport (6.1.7.
|
|
268
|
+
activesupport (6.1.7.2)
|
|
267
269
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
268
270
|
i18n (>= 1.6, < 2)
|
|
269
271
|
minitest (>= 5.1)
|
|
@@ -275,13 +277,16 @@ GEM
|
|
|
275
277
|
ast (2.4.2)
|
|
276
278
|
clipboard (1.3.6)
|
|
277
279
|
colorize (0.8.1)
|
|
278
|
-
concurrent-ruby (1.
|
|
280
|
+
concurrent-ruby (1.2.2)
|
|
279
281
|
content-type (0.0.2)
|
|
280
282
|
parslet (~> 2.0)
|
|
281
283
|
curb (0.9.11)
|
|
282
284
|
diff-lcs (1.5.0)
|
|
283
|
-
eac_rest (0.
|
|
284
|
-
|
|
285
|
+
eac_rest (0.7.1)
|
|
286
|
+
eac_fs (~> 0.16)
|
|
287
|
+
eac_ruby_utils (~> 0.112)
|
|
288
|
+
faraday (~> 2.7, >= 2.7.4)
|
|
289
|
+
faraday-multipart (~> 1.0, >= 1.0.4)
|
|
285
290
|
eac_ruby_gem_support (0.5.1)
|
|
286
291
|
eac_ruby_utils (~> 0.74)
|
|
287
292
|
rspec (~> 3.9)
|
|
@@ -291,36 +296,21 @@ GEM
|
|
|
291
296
|
eac_templates (0.3.2)
|
|
292
297
|
eac_config (~> 0.11, >= 0.11.1)
|
|
293
298
|
eac_ruby_utils (~> 0.102, >= 0.102.1)
|
|
294
|
-
faraday (
|
|
295
|
-
faraday-
|
|
296
|
-
faraday-em_synchrony (~> 1.0)
|
|
297
|
-
faraday-excon (~> 1.1)
|
|
298
|
-
faraday-httpclient (~> 1.0)
|
|
299
|
-
faraday-multipart (~> 1.0)
|
|
300
|
-
faraday-net_http (~> 1.0)
|
|
301
|
-
faraday-net_http_persistent (~> 1.0)
|
|
302
|
-
faraday-patron (~> 1.0)
|
|
303
|
-
faraday-rack (~> 1.0)
|
|
304
|
-
faraday-retry (~> 1.0)
|
|
299
|
+
faraday (2.7.4)
|
|
300
|
+
faraday-net_http (>= 2.0, < 3.1)
|
|
305
301
|
ruby2_keywords (>= 0.0.4)
|
|
306
|
-
faraday-
|
|
307
|
-
|
|
308
|
-
faraday-excon (1.1.0)
|
|
302
|
+
faraday-follow_redirects (0.3.0)
|
|
303
|
+
faraday (>= 1, < 3)
|
|
309
304
|
faraday-gzip (0.1.0)
|
|
310
305
|
faraday (>= 1.0)
|
|
311
306
|
zlib (~> 2.1)
|
|
312
|
-
faraday-httpclient (1.0.1)
|
|
313
307
|
faraday-multipart (1.0.4)
|
|
314
308
|
multipart-post (~> 2)
|
|
315
|
-
faraday-net_http (
|
|
316
|
-
faraday-
|
|
317
|
-
|
|
318
|
-
faraday-rack (1.0.0)
|
|
319
|
-
faraday-retry (1.0.3)
|
|
320
|
-
faraday_middleware (1.2.0)
|
|
321
|
-
faraday (~> 1.0)
|
|
309
|
+
faraday-net_http (3.0.2)
|
|
310
|
+
faraday-retry (2.1.0)
|
|
311
|
+
faraday (~> 2.0)
|
|
322
312
|
filesize (0.2.0)
|
|
323
|
-
git (1.
|
|
313
|
+
git (1.17.2)
|
|
324
314
|
addressable (~> 2.8)
|
|
325
315
|
rchardet (~> 1.8)
|
|
326
316
|
hpricot (0.8.6)
|
|
@@ -329,22 +319,22 @@ GEM
|
|
|
329
319
|
concurrent-ruby (~> 1.0)
|
|
330
320
|
jaro_winkler (1.5.4)
|
|
331
321
|
minitar (0.9)
|
|
332
|
-
minitest (5.
|
|
333
|
-
multipart-post (2.
|
|
322
|
+
minitest (5.18.0)
|
|
323
|
+
multipart-post (2.3.0)
|
|
334
324
|
net-ssh (4.2.0)
|
|
335
|
-
nokogiri (1.14.
|
|
325
|
+
nokogiri (1.14.2-x86_64-linux)
|
|
336
326
|
racc (~> 1.4)
|
|
337
327
|
ofx-parser (1.1.0)
|
|
338
328
|
hpricot (>= 0.6)
|
|
339
329
|
os (1.1.4)
|
|
340
330
|
parallel (1.22.1)
|
|
341
331
|
parseconfig (1.1.2)
|
|
342
|
-
parser (3.2.
|
|
332
|
+
parser (3.2.1.1)
|
|
343
333
|
ast (~> 2.4.1)
|
|
344
334
|
parslet (2.0.0)
|
|
345
335
|
public_suffix (5.0.1)
|
|
346
336
|
racc (1.6.2)
|
|
347
|
-
rack (3.0.4.
|
|
337
|
+
rack (3.0.4.2)
|
|
348
338
|
rainbow (3.1.1)
|
|
349
339
|
rchardet (1.8.0)
|
|
350
340
|
rexml (3.2.5)
|
|
@@ -353,7 +343,7 @@ GEM
|
|
|
353
343
|
rspec-core (~> 3.12.0)
|
|
354
344
|
rspec-expectations (~> 3.12.0)
|
|
355
345
|
rspec-mocks (~> 3.12.0)
|
|
356
|
-
rspec-core (3.12.
|
|
346
|
+
rspec-core (3.12.1)
|
|
357
347
|
rspec-support (~> 3.12.0)
|
|
358
348
|
rspec-expectations (3.12.2)
|
|
359
349
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
@@ -376,12 +366,12 @@ GEM
|
|
|
376
366
|
rubocop-rspec (1.38.1)
|
|
377
367
|
rubocop (>= 0.68.1)
|
|
378
368
|
ruby-filemagic (0.7.3)
|
|
379
|
-
ruby-progressbar (1.
|
|
369
|
+
ruby-progressbar (1.13.0)
|
|
380
370
|
ruby2_keywords (0.0.5)
|
|
381
|
-
tzinfo (2.0.
|
|
371
|
+
tzinfo (2.0.6)
|
|
382
372
|
concurrent-ruby (~> 1.0)
|
|
383
373
|
unicode-display_width (1.6.1)
|
|
384
|
-
zeitwerk (2.6.
|
|
374
|
+
zeitwerk (2.6.7)
|
|
385
375
|
zlib (2.1.1)
|
|
386
376
|
|
|
387
377
|
PLATFORMS
|
data/lib/eac_tools/version.rb
CHANGED
|
@@ -14,11 +14,12 @@ Gem::Specification.new do |s|
|
|
|
14
14
|
|
|
15
15
|
s.add_dependency 'activesupport', '>= 4.0.0'
|
|
16
16
|
s.add_dependency 'addressable', '~> 2.8', '>= 2.8.1'
|
|
17
|
-
s.add_dependency '
|
|
18
|
-
s.add_dependency '
|
|
17
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.112'
|
|
18
|
+
s.add_dependency 'faraday', '~> 2.7', '>= 2.7.4'
|
|
19
|
+
s.add_dependency 'faraday-follow_redirects', '~> 0.3'
|
|
19
20
|
s.add_dependency 'faraday-gzip', '~> 0.1'
|
|
20
|
-
s.add_dependency '
|
|
21
|
-
s.add_dependency 'nokogiri', '~> 1.
|
|
21
|
+
s.add_dependency 'faraday-retry', '~> 2.1'
|
|
22
|
+
s.add_dependency 'nokogiri', '~> 1.14', '>= 1.14.2'
|
|
22
23
|
s.add_dependency 'ofx-parser', '~> 1.1'
|
|
23
24
|
|
|
24
25
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
require 'aranha/parsers/source_address/fetch_content_error'
|
|
4
4
|
require 'aranha/parsers/source_address/hash_http_base'
|
|
5
5
|
require 'eac_ruby_utils/core_ext'
|
|
6
|
-
require '
|
|
6
|
+
require 'faraday'
|
|
7
|
+
require 'faraday/follow_redirects'
|
|
7
8
|
require 'faraday/gzip'
|
|
8
9
|
require 'yaml'
|
|
9
10
|
|
|
@@ -66,8 +67,9 @@ module Aranha
|
|
|
66
67
|
req = faraday_request
|
|
67
68
|
return req.body if req.status == 200
|
|
68
69
|
|
|
69
|
-
raise ::Aranha::Parsers::SourceAddress::FetchContentError
|
|
70
|
-
|
|
70
|
+
raise ::Aranha::Parsers::SourceAddress::FetchContentError.new(
|
|
71
|
+
"Get #{url} returned #{req.status.to_i}", req
|
|
72
|
+
)
|
|
71
73
|
end
|
|
72
74
|
|
|
73
75
|
def param(key, default_value)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'addressable'
|
|
4
|
-
require 'curb'
|
|
5
4
|
require 'aranha/parsers/source_address/fetch_content_error'
|
|
6
|
-
require '
|
|
5
|
+
require 'faraday'
|
|
6
|
+
require 'faraday/retry'
|
|
7
7
|
|
|
8
8
|
module Aranha
|
|
9
9
|
module Parsers
|
|
@@ -46,8 +46,9 @@ module Aranha
|
|
|
46
46
|
c = conn.get(url)
|
|
47
47
|
return c.body if c.status == 200
|
|
48
48
|
|
|
49
|
-
raise ::Aranha::Parsers::SourceAddress::FetchContentError
|
|
50
|
-
|
|
49
|
+
raise ::Aranha::Parsers::SourceAddress::FetchContentError.new(
|
|
50
|
+
"Get #{url} returned #{c.status.to_i}", c
|
|
51
|
+
)
|
|
51
52
|
end
|
|
52
53
|
|
|
53
54
|
def serialize
|
|
@@ -12,9 +12,10 @@ Gem::Specification.new do |s|
|
|
|
12
12
|
|
|
13
13
|
s.files = Dir['{lib,locale,template}/**/*']
|
|
14
14
|
|
|
15
|
-
s.add_dependency '
|
|
15
|
+
s.add_dependency 'aranha-parsers', '~> 0.16'
|
|
16
|
+
s.add_dependency 'avm', '~> 0.62'
|
|
16
17
|
s.add_dependency 'avm-eac_generic_base0', '~> 0.10'
|
|
17
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
|
18
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.112'
|
|
18
19
|
|
|
19
20
|
s.add_development_dependency 'aranha-parsers', '~> 0.14', '>= 0.14.1'
|
|
20
21
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
|
@@ -103,6 +103,8 @@ module Avm
|
|
|
103
103
|
"https://rubygems.org/api/v1/versions/#{gem_spec.name}.json"
|
|
104
104
|
).content
|
|
105
105
|
)
|
|
106
|
+
rescue ::Aranha::Parsers::SourceAddress::FetchContentError => e
|
|
107
|
+
e.request.status == 404 ? [] : raise(e)
|
|
106
108
|
end
|
|
107
109
|
|
|
108
110
|
def gem_version_max_uncached
|
data/sub/eac_cli/eac_cli.gemspec
CHANGED
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
|
14
14
|
|
|
15
15
|
s.add_dependency 'colorize', '~> 0.8', '>= 0.8.1'
|
|
16
16
|
s.add_dependency 'eac_config', '~> 0.12'
|
|
17
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
|
17
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.112'
|
|
18
18
|
|
|
19
19
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
|
20
20
|
end
|
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
|
12
12
|
|
|
13
13
|
s.files = Dir['{lib}/**/*']
|
|
14
14
|
|
|
15
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
|
15
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.112'
|
|
16
16
|
s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.2'
|
|
17
17
|
|
|
18
18
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
|
@@ -24,6 +24,11 @@ module EacDocker
|
|
|
24
24
|
).execute!.strip
|
|
25
25
|
end
|
|
26
26
|
|
|
27
|
+
# @return [String]
|
|
28
|
+
def logs
|
|
29
|
+
::EacDocker::Executables.docker.command('logs', id).execute!
|
|
30
|
+
end
|
|
31
|
+
|
|
27
32
|
def on_detached
|
|
28
33
|
command = ::EacDocker::Executables.docker.command(*(%w[run --detach] + run_command_args))
|
|
29
34
|
self.id = command.execute!.strip
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
|
4
|
+
|
|
5
|
+
module EacDocker
|
|
6
|
+
module Rspec
|
|
7
|
+
class StubImage
|
|
8
|
+
include ::ActiveSupport::Callbacks
|
|
9
|
+
define_callbacks :on_container
|
|
10
|
+
common_constructor :image
|
|
11
|
+
|
|
12
|
+
def build_container
|
|
13
|
+
image.provide.container.temporary(true)
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def container
|
|
17
|
+
raise 'internal container is blank' if internal_container.blank?
|
|
18
|
+
|
|
19
|
+
internal_container
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def on_container(&block)
|
|
23
|
+
raise 'A container was already created' if internal_container.present?
|
|
24
|
+
|
|
25
|
+
build_container.on_detached do |container|
|
|
26
|
+
self.internal_container = container
|
|
27
|
+
begin
|
|
28
|
+
run_callbacks(:on_container, &block)
|
|
29
|
+
ensure
|
|
30
|
+
self.internal_container = nil
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
private
|
|
36
|
+
|
|
37
|
+
attr_accessor :internal_container
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -13,9 +13,9 @@ Gem::Specification.new do |s|
|
|
|
13
13
|
s.files = Dir['{lib}/**/*']
|
|
14
14
|
|
|
15
15
|
s.add_dependency 'avm-eac_ruby_base1', '~> 0.29'
|
|
16
|
-
s.add_dependency 'eac_cli', '~> 0.30'
|
|
16
|
+
s.add_dependency 'eac_cli', '~> 0.30', '>= 0.30.1'
|
|
17
17
|
s.add_dependency 'eac_fs', '~> 0.16'
|
|
18
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
|
18
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.112'
|
|
19
19
|
|
|
20
20
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
|
21
21
|
end
|
|
@@ -7,35 +7,46 @@ module EacRubyUtils
|
|
|
7
7
|
module Immutable
|
|
8
8
|
class HashAccessor < ::EacRubyUtils::Immutable::BaseAccessor
|
|
9
9
|
def apply(klass)
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
apply_plural(klass)
|
|
11
|
+
apply_singular(klass)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def immutable_value_get(object)
|
|
15
15
|
super || {}
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
def
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
def immutable_value_get_single(object, key)
|
|
19
|
+
immutable_value_get(object)[key]
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def immutable_value_set(object, new_hash)
|
|
23
|
+
duplicate_object(object) { |_old_value| new_hash }
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def immutable_value_set_single(object, key, value)
|
|
27
|
+
immutable_value_set(object, immutable_value_get(object).merge(key => value))
|
|
22
28
|
end
|
|
23
29
|
|
|
24
30
|
private
|
|
25
31
|
|
|
26
|
-
def
|
|
32
|
+
def apply_plural(klass)
|
|
27
33
|
accessor = self
|
|
28
|
-
klass.send(:define_method, ::ActiveSupport::Inflector.pluralize(name)) do
|
|
29
|
-
|
|
34
|
+
klass.send(:define_method, ::ActiveSupport::Inflector.pluralize(name)) do |*args|
|
|
35
|
+
case args.count
|
|
36
|
+
when 0 then next accessor.immutable_value_get(self)
|
|
37
|
+
when 1 then next accessor.immutable_value_set(self, args[0])
|
|
38
|
+
else
|
|
39
|
+
raise ::ArgumentError, "wrong number of arguments (given #{args.count}, expected 0..1)"
|
|
40
|
+
end
|
|
30
41
|
end
|
|
31
42
|
end
|
|
32
43
|
|
|
33
|
-
def
|
|
44
|
+
def apply_singular(klass)
|
|
34
45
|
accessor = self
|
|
35
46
|
klass.send(:define_method, name) do |*args|
|
|
36
47
|
case args.count
|
|
37
|
-
when 1 then next accessor.
|
|
38
|
-
when 2 then next accessor.
|
|
48
|
+
when 1 then next accessor.immutable_value_get_single(self, args[0])
|
|
49
|
+
when 2 then next accessor.immutable_value_set_single(self, *args[0..1])
|
|
39
50
|
else
|
|
40
51
|
raise ::ArgumentError, "wrong number of arguments (given #{args.count}, expected 1..2)"
|
|
41
52
|
end
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
require 'eac_ruby_utils/immutable'
|
|
4
|
+
|
|
5
|
+
::RSpec.describe ::EacRubyUtils::Immutable::ArrayAccessor do
|
|
4
6
|
let(:stub_class) do
|
|
5
|
-
the_described_class = described_class
|
|
6
7
|
::Class.new do
|
|
7
|
-
include
|
|
8
|
+
include ::EacRubyUtils::Immutable
|
|
8
9
|
|
|
9
10
|
immutable_accessor :array_attr, type: :array
|
|
10
11
|
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'eac_ruby_utils/immutable'
|
|
4
|
+
|
|
5
|
+
::RSpec.describe ::EacRubyUtils::Immutable::HashAccessor do
|
|
6
|
+
let(:stub_class) do
|
|
7
|
+
::Class.new do
|
|
8
|
+
include ::EacRubyUtils::Immutable
|
|
9
|
+
|
|
10
|
+
immutable_accessor :the_hash, type: :hash
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
let(:initial_instance) { stub_class.new }
|
|
15
|
+
|
|
16
|
+
it { expect(initial_instance.the_hashes).to eq({}) }
|
|
17
|
+
it { expect(initial_instance.the_hash('key_a')).to be_nil }
|
|
18
|
+
|
|
19
|
+
context 'when a single value is set' do
|
|
20
|
+
let(:change1_instance) { initial_instance.the_hash('key_a', 'A') }
|
|
21
|
+
|
|
22
|
+
before { change1_instance }
|
|
23
|
+
|
|
24
|
+
it { expect(initial_instance.the_hashes).to eq({}) }
|
|
25
|
+
it { expect(initial_instance.the_hash('key_a')).to be_nil }
|
|
26
|
+
it { expect(change1_instance.the_hashes).to eq({ 'key_a' => 'A' }) }
|
|
27
|
+
it { expect(change1_instance.the_hash('key_a')).to eq('A') }
|
|
28
|
+
|
|
29
|
+
context 'when all valuesare set' do
|
|
30
|
+
let(:change2_instance) { initial_instance.the_hashes('key_b' => 'B') }
|
|
31
|
+
|
|
32
|
+
before { change2_instance }
|
|
33
|
+
|
|
34
|
+
it { expect(change1_instance.the_hashes).to eq({ 'key_a' => 'A' }) }
|
|
35
|
+
it { expect(change1_instance.the_hash('key_a')).to eq('A') }
|
|
36
|
+
it { expect(change1_instance.the_hash('key_b')).to be_nil }
|
|
37
|
+
it { expect(change2_instance.the_hashes).to eq({ 'key_b' => 'B' }) }
|
|
38
|
+
it { expect(change2_instance.the_hash('key_a')).to be_nil }
|
|
39
|
+
it { expect(change2_instance.the_hash('key_b')).to eq('B') }
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: eac_tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.55.
|
|
4
|
+
version: 0.55.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Put here the authors
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2023-
|
|
11
|
+
date: 2023-03-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: avm
|
|
@@ -189,6 +189,9 @@ dependencies:
|
|
|
189
189
|
- - "~>"
|
|
190
190
|
- !ruby/object:Gem::Version
|
|
191
191
|
version: '0.29'
|
|
192
|
+
- - ">="
|
|
193
|
+
- !ruby/object:Gem::Version
|
|
194
|
+
version: 0.29.1
|
|
192
195
|
type: :runtime
|
|
193
196
|
prerelease: false
|
|
194
197
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -196,6 +199,9 @@ dependencies:
|
|
|
196
199
|
- - "~>"
|
|
197
200
|
- !ruby/object:Gem::Version
|
|
198
201
|
version: '0.29'
|
|
202
|
+
- - ">="
|
|
203
|
+
- !ruby/object:Gem::Version
|
|
204
|
+
version: 0.29.1
|
|
199
205
|
- !ruby/object:Gem::Dependency
|
|
200
206
|
name: avm-eac_webapp_base0
|
|
201
207
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -256,14 +262,14 @@ dependencies:
|
|
|
256
262
|
requirements:
|
|
257
263
|
- - "~>"
|
|
258
264
|
- !ruby/object:Gem::Version
|
|
259
|
-
version: '0.
|
|
265
|
+
version: '0.112'
|
|
260
266
|
type: :runtime
|
|
261
267
|
prerelease: false
|
|
262
268
|
version_requirements: !ruby/object:Gem::Requirement
|
|
263
269
|
requirements:
|
|
264
270
|
- - "~>"
|
|
265
271
|
- !ruby/object:Gem::Version
|
|
266
|
-
version: '0.
|
|
272
|
+
version: '0.112'
|
|
267
273
|
- !ruby/object:Gem::Dependency
|
|
268
274
|
name: eac_ruby_gem_support
|
|
269
275
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -1344,6 +1350,7 @@ files:
|
|
|
1344
1350
|
- sub/eac_docker/lib/eac_docker/registry.rb
|
|
1345
1351
|
- sub/eac_docker/lib/eac_docker/rspec.rb
|
|
1346
1352
|
- sub/eac_docker/lib/eac_docker/rspec/setup.rb
|
|
1353
|
+
- sub/eac_docker/lib/eac_docker/rspec/stub_image.rb
|
|
1347
1354
|
- sub/eac_docker/lib/eac_docker/version.rb
|
|
1348
1355
|
- sub/eac_docker/spec/lib/eac_docker/executables_spec.rb
|
|
1349
1356
|
- sub/eac_docker/spec/lib/eac_docker/images/coded_spec.rb
|
|
@@ -1825,7 +1832,8 @@ files:
|
|
|
1825
1832
|
- sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/extname_spec.rb
|
|
1826
1833
|
- sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp/directory_spec.rb
|
|
1827
1834
|
- sub/eac_ruby_utils/spec/lib/eac_ruby_utils/fs/temp_spec.rb
|
|
1828
|
-
- sub/eac_ruby_utils/spec/lib/eac_ruby_utils/
|
|
1835
|
+
- sub/eac_ruby_utils/spec/lib/eac_ruby_utils/immutable/array_accessor_spec.rb
|
|
1836
|
+
- sub/eac_ruby_utils/spec/lib/eac_ruby_utils/immutable/hash_accessor_spec.rb
|
|
1829
1837
|
- sub/eac_ruby_utils/spec/lib/eac_ruby_utils/inflector_spec.rb
|
|
1830
1838
|
- sub/eac_ruby_utils/spec/lib/eac_ruby_utils/listable_spec.rb
|
|
1831
1839
|
- sub/eac_ruby_utils/spec/lib/eac_ruby_utils/local_time_zone_spec.rb
|