eac_tools 0.60.0 → 0.60.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +51 -51
  3. data/lib/eac_tools/version.rb +1 -1
  4. data/sub/aranha-parsers/aranha-parsers.gemspec +2 -5
  5. data/sub/aranha-parsers/lib/aranha/parsers/source_address/hash_http_base.rb +13 -22
  6. data/sub/aranha-parsers/lib/aranha/parsers/source_address/http_get.rb +6 -12
  7. data/sub/aranha-parsers/lib/aranha/parsers/version.rb +1 -1
  8. data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec.rb +32 -0
  9. data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/hash_http_get.source.yml +6 -0
  10. data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/hash_http_get.target.yaml +10 -0
  11. data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/hash_http_post.source.yml +5 -0
  12. data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/hash_http_post.target.yaml +12 -0
  13. data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/http_get.source.yml +1 -0
  14. data/sub/aranha-parsers/spec/lib/aranha/parsers/source_address/detect_sub_spec_files/http_get.target.yaml +10 -0
  15. data/sub/avm/avm.gemspec +1 -1
  16. data/sub/avm/lib/avm/data/package/build_directory.rb +28 -0
  17. data/sub/avm/lib/avm/data/package/dump.rb +10 -8
  18. data/sub/avm/lib/avm/data/package/load.rb +8 -11
  19. data/sub/avm/lib/avm/data/package.rb +3 -0
  20. data/sub/avm/lib/avm/data/unit.rb +5 -0
  21. data/sub/avm/lib/avm/instances/data/files_unit.rb +8 -1
  22. data/sub/avm/lib/avm/version.rb +1 -1
  23. data/sub/avm-eac_asciidoctor_base0/avm-eac_asciidoctor_base0.gemspec +1 -1
  24. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/instances/base.rb +0 -1
  25. data/sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/version.rb +1 -1
  26. data/sub/avm-eac_latex_base0/avm-eac_latex_base0.gemspec +3 -3
  27. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/instances/base.rb +0 -1
  28. data/sub/avm-eac_latex_base0/lib/avm/eac_latex_base0/version.rb +1 -1
  29. data/sub/avm-eac_php_base0/avm-eac_php_base0.gemspec +3 -3
  30. data/sub/avm-eac_php_base0/lib/avm/eac_php_base0/instances/base.rb +0 -1
  31. data/sub/avm-eac_php_base0/lib/avm/eac_php_base0/version.rb +1 -1
  32. data/sub/avm-eac_postgresql_base0/avm-eac_postgresql_base0.gemspec +2 -2
  33. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/instance/data_unit.rb +1 -1
  34. data/sub/avm-eac_postgresql_base0/lib/avm/eac_postgresql_base0/version.rb +1 -1
  35. data/sub/avm-eac_rails_base0/avm-eac_rails_base0.gemspec +1 -1
  36. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/instances/base.rb +11 -1
  37. data/sub/avm-eac_rails_base0/lib/avm/eac_rails_base0/version.rb +1 -1
  38. data/sub/avm-eac_rails_base1/avm-eac_rails_base1.gemspec +2 -2
  39. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/instances/base.rb +5 -0
  40. data/sub/avm-eac_rails_base1/lib/avm/eac_rails_base1/version.rb +1 -1
  41. data/sub/avm-eac_redmine_base0/avm-eac_redmine_base0.gemspec +2 -2
  42. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/base.rb +5 -4
  43. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/docker_image.rb +7 -2
  44. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/version.rb +1 -1
  45. data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/apache_path_dockerfile +5 -0
  46. data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +2 -2
  47. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/base.rb +7 -12
  48. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy/{file_unit.rb → setup_files_unit.rb} +12 -3
  49. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/deploy.rb +3 -4
  50. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/instances/runners/data/load.rb +2 -1
  51. data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
  52. data/sub/avm-eac_wordpress_base0/avm-eac_wordpress_base0.gemspec +3 -3
  53. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/instances/base.rb +19 -1
  54. data/sub/avm-eac_wordpress_base0/lib/avm/eac_wordpress_base0/version.rb +1 -1
  55. metadata +53 -21
  56. data/sub/avm-eac_redmine_base0/lib/avm/eac_redmine_base0/instances/data_package.rb +0 -23
  57. /data/sub/avm-eac_redmine_base0/template/avm/eac_redmine_base0/instances/docker_image/{Dockerfile_apache_setup → apache_host_dockerfile} +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 327ae2eff08c0ad4c133241be2a63b4c7a0867317996c75f96254289510efc92
4
- data.tar.gz: 7f683ac460509520c772af752277317ffbd6adfbc099757ad0f88cd104a85517
3
+ metadata.gz: cea9f60c673884523dc9facce73368d7f9de5308a57e31da5a50a343a58fbeaa
4
+ data.tar.gz: 799fbec7b964b8453d66c77c75181d20f24149b38e2dc9bc6a8e007f62b8e474
5
5
  SHA512:
6
- metadata.gz: '08edc8c921395b4593f0ae47b0c36d1f67c1847d752d8e17fb258f82fa637854652e85b77ee69fd0a0664ca9f633d0ba2f3812bd188b750c1b55ddaeac60f732'
7
- data.tar.gz: d6753df13da2becc01dccf9a71896f2aba4506e236f05b2c8026e8c0dc30a59f472da6dd4453a4b3506cdd778b76f1437e1cc3ac48f873622514b4613a6e0347
6
+ metadata.gz: 46f50888ff1612d6636f6e68d3132c202b40f01334638ef2ea1aa921425c530ae677f365bedad0b09178094e2033c4844ec8489bc83eeaf92622dc69dbe5533b
7
+ data.tar.gz: db1a4bc114d5870ed7ad1f3034d79d6c069e8c72b44e6915a71198675cd7ee9435fe3851d294130426b3c4c215854809930f6b288bd8e9ed6b059de23b7e05b5
data/Gemfile.lock CHANGED
@@ -1,21 +1,21 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eac_tools (0.60.0)
5
- avm (~> 0.66, >= 0.66.1)
6
- avm-eac_asciidoctor_base0 (~> 0.18)
4
+ eac_tools (0.60.2)
5
+ avm (~> 0.67)
6
+ avm-eac_asciidoctor_base0 (~> 0.18, >= 0.18.1)
7
7
  avm-eac_generic_base0 (~> 0.12)
8
- avm-eac_latex_base0 (~> 0.3)
9
- avm-eac_php_base0 (~> 0.4, >= 0.4.1)
10
- avm-eac_postgresql_base0 (~> 0.2, >= 0.2.3)
8
+ avm-eac_latex_base0 (~> 0.3, >= 0.3.1)
9
+ avm-eac_php_base0 (~> 0.4, >= 0.4.2)
10
+ avm-eac_postgresql_base0 (~> 0.2, >= 0.2.4)
11
11
  avm-eac_python_base0 (~> 0.2, >= 0.2.1)
12
- avm-eac_rails_base0 (~> 0.10)
13
- avm-eac_rails_base1 (~> 0.8, >= 0.8.2)
14
- avm-eac_redmine_base0 (~> 0.19)
12
+ avm-eac_rails_base0 (~> 0.10, >= 0.10.1)
13
+ avm-eac_rails_base1 (~> 0.8, >= 0.8.3)
14
+ avm-eac_redmine_base0 (~> 0.19, >= 0.19.2)
15
15
  avm-eac_redmine_plugin_base0 (~> 0.4)
16
16
  avm-eac_ruby_base1 (~> 0.30, >= 0.30.1)
17
- avm-eac_webapp_base0 (~> 0.14)
18
- avm-eac_wordpress_base0 (~> 0.3)
17
+ avm-eac_webapp_base0 (~> 0.15)
18
+ avm-eac_wordpress_base0 (~> 0.3, >= 0.3.1)
19
19
  avm-git (~> 0.13, >= 0.13.1)
20
20
  avm-tools (~> 0.145, >= 0.145.1)
21
21
  eac_ruby_utils (~> 0.112)
@@ -23,23 +23,20 @@ PATH
23
23
  PATH
24
24
  remote: sub/aranha-parsers
25
25
  specs:
26
- aranha-parsers (0.17.0)
26
+ aranha-parsers (0.17.1)
27
27
  activesupport (>= 4.0.0)
28
- addressable (~> 2.8, >= 2.8.1)
28
+ addressable (~> 2.8, >= 2.8.3)
29
+ eac_envs-http (~> 0.3)
29
30
  eac_ruby_utils (~> 0.112)
30
- faraday (~> 2.7, >= 2.7.4)
31
- faraday-follow_redirects (~> 0.3)
32
- faraday-gzip (~> 0.1)
33
- faraday-retry (~> 2.1)
34
31
  nokogiri (~> 1.14, >= 1.14.2)
35
32
  ofx-parser (~> 1.1)
36
33
 
37
34
  PATH
38
35
  remote: sub/avm-eac_asciidoctor_base0
39
36
  specs:
40
- avm-eac_asciidoctor_base0 (0.18.0)
37
+ avm-eac_asciidoctor_base0 (0.18.1)
41
38
  asciidoctor (~> 2.0, >= 2.0.18)
42
- avm-eac_webapp_base0 (~> 0.14)
39
+ avm-eac_webapp_base0 (~> 0.15)
43
40
  eac_ruby_utils (~> 0.112)
44
41
  os (~> 1.1, >= 1.1.4)
45
42
  rouge (~> 3.30)
@@ -54,25 +51,25 @@ PATH
54
51
  PATH
55
52
  remote: sub/avm-eac_latex_base0
56
53
  specs:
57
- avm-eac_latex_base0 (0.3.0)
58
- avm (~> 0.52)
59
- avm-eac_webapp_base0 (~> 0.12)
60
- eac_ruby_utils (~> 0.106)
54
+ avm-eac_latex_base0 (0.3.1)
55
+ avm (~> 0.67)
56
+ avm-eac_webapp_base0 (~> 0.15)
57
+ eac_ruby_utils (~> 0.112)
61
58
 
62
59
  PATH
63
60
  remote: sub/avm-eac_php_base0
64
61
  specs:
65
- avm-eac_php_base0 (0.4.1)
66
- avm-eac_generic_base0 (~> 0.8)
67
- avm-eac_webapp_base0 (~> 0.13)
68
- eac_ruby_utils (~> 0.109)
62
+ avm-eac_php_base0 (0.4.2)
63
+ avm-eac_generic_base0 (~> 0.12)
64
+ avm-eac_webapp_base0 (~> 0.15)
65
+ eac_ruby_utils (~> 0.112)
69
66
 
70
67
  PATH
71
68
  remote: sub/avm-eac_postgresql_base0
72
69
  specs:
73
- avm-eac_postgresql_base0 (0.2.3)
74
- avm (~> 0.57)
75
- eac_ruby_utils (~> 0.109)
70
+ avm-eac_postgresql_base0 (0.2.4)
71
+ avm (~> 0.66, >= 0.66.1)
72
+ eac_ruby_utils (~> 0.112)
76
73
 
77
74
  PATH
78
75
  remote: sub/avm-eac_python_base0
@@ -84,26 +81,26 @@ PATH
84
81
  PATH
85
82
  remote: sub/avm-eac_rails_base0
86
83
  specs:
87
- avm-eac_rails_base0 (0.10.0)
88
- avm-eac_rails_base1 (~> 0.8, >= 0.8.1)
84
+ avm-eac_rails_base0 (0.10.1)
85
+ avm-eac_rails_base1 (~> 0.8, >= 0.8.3)
89
86
  eac_ruby_utils (~> 0.112)
90
87
 
91
88
  PATH
92
89
  remote: sub/avm-eac_rails_base1
93
90
  specs:
94
- avm-eac_rails_base1 (0.8.2)
95
- avm (~> 0.66, >= 0.66.1)
91
+ avm-eac_rails_base1 (0.8.3)
92
+ avm (~> 0.67)
96
93
  avm-eac_ruby_base1 (~> 0.30, >= 0.30.1)
97
- avm-eac_webapp_base0 (~> 0.14)
94
+ avm-eac_webapp_base0 (~> 0.15)
98
95
  eac_ruby_utils (~> 0.112)
99
96
 
100
97
  PATH
101
98
  remote: sub/avm-eac_redmine_base0
102
99
  specs:
103
- avm-eac_redmine_base0 (0.19.0)
104
- avm (~> 0.66, >= 0.66.1)
100
+ avm-eac_redmine_base0 (0.19.2)
101
+ avm (~> 0.67)
105
102
  avm-eac_generic_base0 (~> 0.12)
106
- avm-eac_rails_base1 (~> 0.8, >= 0.8.2)
103
+ avm-eac_rails_base1 (~> 0.8, >= 0.8.3)
107
104
  avm-eac_ubuntu_base0 (~> 0.4, >= 0.4.1)
108
105
  curb (~> 0.9, >= 0.9.11)
109
106
  eac_fs (~> 0.16)
@@ -137,10 +134,10 @@ PATH
137
134
  PATH
138
135
  remote: sub/avm-eac_webapp_base0
139
136
  specs:
140
- avm-eac_webapp_base0 (0.14.0)
141
- avm (~> 0.66)
137
+ avm-eac_webapp_base0 (0.15.0)
138
+ avm (~> 0.67)
142
139
  avm-eac_generic_base0 (~> 0.12)
143
- avm-eac_postgresql_base0 (~> 0.2, >= 0.2.3)
140
+ avm-eac_postgresql_base0 (~> 0.2, >= 0.2.4)
144
141
  avm-eac_ubuntu_base0 (~> 0.4, >= 0.4.1)
145
142
  avm-files (~> 0.6)
146
143
  eac_ruby_utils (~> 0.112)
@@ -148,10 +145,10 @@ PATH
148
145
  PATH
149
146
  remote: sub/avm-eac_wordpress_base0
150
147
  specs:
151
- avm-eac_wordpress_base0 (0.3.0)
152
- avm (~> 0.57)
153
- avm-eac_webapp_base0 (~> 0.13)
154
- eac_ruby_utils (~> 0.109)
148
+ avm-eac_wordpress_base0 (0.3.1)
149
+ avm (~> 0.67)
150
+ avm-eac_webapp_base0 (~> 0.15)
151
+ eac_ruby_utils (~> 0.112)
155
152
 
156
153
  PATH
157
154
  remote: sub/avm-files
@@ -194,8 +191,8 @@ PATH
194
191
  PATH
195
192
  remote: sub/avm
196
193
  specs:
197
- avm (0.66.1)
198
- aranha-parsers (~> 0.17)
194
+ avm (0.67.0)
195
+ aranha-parsers (~> 0.17, >= 0.17.1)
199
196
  eac_cli (~> 0.30, >= 0.30.1)
200
197
  eac_config (~> 0.12)
201
198
  eac_docker (~> 0.7)
@@ -272,7 +269,7 @@ GEM
272
269
  minitest (>= 5.1)
273
270
  tzinfo (~> 2.0)
274
271
  zeitwerk (~> 2.3)
275
- addressable (2.8.3)
272
+ addressable (2.8.4)
276
273
  public_suffix (>= 2.0.2, < 6.0)
277
274
  asciidoctor (2.0.18)
278
275
  ast (2.4.2)
@@ -283,11 +280,14 @@ GEM
283
280
  parslet (~> 2.0)
284
281
  curb (0.9.11)
285
282
  diff-lcs (1.5.0)
286
- eac_envs-http (0.2.0)
283
+ eac_envs-http (0.3.0)
287
284
  eac_fs (~> 0.16)
288
285
  eac_ruby_utils (~> 0.112)
289
286
  faraday (~> 2.7, >= 2.7.4)
287
+ faraday-follow_redirects (~> 0.3)
288
+ faraday-gzip (~> 0.1)
290
289
  faraday-multipart (~> 1.0, >= 1.0.4)
290
+ faraday-retry (~> 2.1)
291
291
  eac_rest (0.7.3)
292
292
  eac_envs-http (~> 0.2)
293
293
  eac_fs (~> 0.16)
@@ -327,12 +327,12 @@ GEM
327
327
  minitest (5.18.0)
328
328
  multipart-post (2.3.0)
329
329
  net-ssh (4.2.0)
330
- nokogiri (1.14.2-x86_64-linux)
330
+ nokogiri (1.14.3-x86_64-linux)
331
331
  racc (~> 1.4)
332
332
  ofx-parser (1.1.0)
333
333
  hpricot (>= 0.6)
334
334
  os (1.1.4)
335
- parallel (1.22.1)
335
+ parallel (1.23.0)
336
336
  parseconfig (1.1.2)
337
337
  parser (3.2.2.0)
338
338
  ast (~> 2.4.1)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacTools
4
- VERSION = '0.60.0'
4
+ VERSION = '0.60.2'
5
5
  end
@@ -13,12 +13,9 @@ Gem::Specification.new do |s|
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
15
  s.add_dependency 'activesupport', '>= 4.0.0'
16
- s.add_dependency 'addressable', '~> 2.8', '>= 2.8.1'
16
+ s.add_dependency 'addressable', '~> 2.8', '>= 2.8.3'
17
+ s.add_dependency 'eac_envs-http', '~> 0.3'
17
18
  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'
20
- s.add_dependency 'faraday-gzip', '~> 0.1'
21
- s.add_dependency 'faraday-retry', '~> 2.1'
22
19
  s.add_dependency 'nokogiri', '~> 1.14', '>= 1.14.2'
23
20
  s.add_dependency 'ofx-parser', '~> 1.1'
24
21
 
@@ -2,10 +2,9 @@
2
2
 
3
3
  require 'aranha/parsers/source_address/fetch_content_error'
4
4
  require 'aranha/parsers/source_address/hash_http_base'
5
+ require 'eac_envs/http/error'
6
+ require 'eac_envs/http/request'
5
7
  require 'eac_ruby_utils/core_ext'
6
- require 'faraday'
7
- require 'faraday/follow_redirects'
8
- require 'faraday/gzip'
9
8
  require 'yaml'
10
9
 
11
10
  module Aranha
@@ -55,21 +54,11 @@ module Aranha
55
54
  source.to_yaml
56
55
  end
57
56
 
58
- # @return [Faraday]
59
- def faraday_connection
60
- ::Faraday.new do |f|
61
- f.request :gzip
62
- f.response :follow_redirects if follow_redirect?
63
- end
64
- end
65
-
66
57
  def content
67
- req = faraday_request
68
- return req.body if req.status == 200
69
-
70
- raise ::Aranha::Parsers::SourceAddress::FetchContentError.new(
71
- "Get #{url} returned #{req.status.to_i}", req
72
- )
58
+ request = http_request
59
+ request.response.body_str
60
+ rescue ::EacEnvs::Http::Error => e
61
+ raise ::Aranha::Parsers::SourceAddress::FetchContentError, e.message, request
73
62
  end
74
63
 
75
64
  def param(key, default_value)
@@ -82,11 +71,13 @@ module Aranha
82
71
 
83
72
  private
84
73
 
85
- def faraday_request_uncached
86
- faraday_connection.send(self.class.http_method, url) do |req|
87
- headers.if_present { |v| req.headers = v }
88
- body.if_present { |v| req.body = v }
89
- end
74
+ # @return [EacEnvs::Http::Request]
75
+ def http_request
76
+ r = ::EacEnvs::Http::Request.new.verb(self.class.http_method).url(url)
77
+ r = headers.if_present(r) { |v| r.headers(v) }
78
+ r = body.if_present(r) { |v| r.body(v) }
79
+ r = r.follow_redirect(true) if follow_redirect?
80
+ r
90
81
  end
91
82
  end
92
83
  end
@@ -2,8 +2,8 @@
2
2
 
3
3
  require 'addressable'
4
4
  require 'aranha/parsers/source_address/fetch_content_error'
5
- require 'faraday'
6
- require 'faraday/retry'
5
+ require 'eac_envs/http/error'
6
+ require 'eac_envs/http/request'
7
7
 
8
8
  module Aranha
9
9
  module Parsers
@@ -39,16 +39,10 @@ module Aranha
39
39
  end
40
40
 
41
41
  def content
42
- conn = ::Faraday.new do |f|
43
- f.request :retry # retry transient failures
44
- f.response :follow_redirects # follow redirects
45
- end
46
- c = conn.get(url)
47
- return c.body if c.status == 200
48
-
49
- raise ::Aranha::Parsers::SourceAddress::FetchContentError.new(
50
- "Get #{url} returned #{c.status.to_i}", c
51
- )
42
+ request = ::EacEnvs::Http::Request.new.url(url).retry(true).follow_redirect(true)
43
+ request.response.body_str
44
+ rescue ::EacEnvs::Http::Error => e
45
+ raise ::Aranha::Parsers::SourceAddress::FetchContentError, e.message, request
52
46
  end
53
47
 
54
48
  def serialize
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Aranha
4
4
  module Parsers
5
- VERSION = '0.17.0'
5
+ VERSION = '0.17.1'
6
6
  end
7
7
  end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'aranha/parsers/source_address'
4
+ require 'eac_envs/http/rspec/echo_server'
5
+ require 'eac_ruby_utils/yaml'
6
+
7
+ ::RSpec.describe ::Aranha::Parsers::SourceAddress do
8
+ describe '#detect_sub' do
9
+ let(:http_server) { ::EacEnvs::Http::Rspec::EchoServer.http }
10
+
11
+ around { |example| http_server.on_active(&example) }
12
+
13
+ include_examples 'source_target_fixtures', __FILE__
14
+
15
+ def source_data(source_file)
16
+ source = ::EacRubyUtils::Yaml.load_file(source_file)
17
+ url = source_url_get(source)
18
+ %w[scheme host port].each { |attr| url.send("#{attr}=", http_server.root_url.send(attr)) }
19
+ if source.is_a?(::Hash)
20
+ source[:url] = url.to_s
21
+ else
22
+ source = url.to_s
23
+ end
24
+ ::JSON.parse(described_class.detect_sub(source).content)
25
+ end
26
+
27
+ # @return [Addressable::URI]
28
+ def source_url_get(source)
29
+ (source.is_a?(::Hash) ? source.fetch(:url) : source).to_uri
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,6 @@
1
+ ---
2
+ :method: :get
3
+ :url: http://getdata.net
4
+ :params:
5
+ :headers:
6
+ - abc
@@ -0,0 +1,10 @@
1
+ ---
2
+ ssl: false
3
+ method: GET
4
+ uri: "/"
5
+ body:
6
+ headers:
7
+ user-agent: Faraday v2.7.4
8
+ accept-encoding: gzip,deflate
9
+ accept: "*/*"
10
+ host: localhost:8080
@@ -0,0 +1,5 @@
1
+ ---
2
+ :method: :post
3
+ :url: http://postdata.net
4
+ :params:
5
+ :key1: :value1
@@ -0,0 +1,12 @@
1
+ ---
2
+ ssl: false
3
+ method: POST
4
+ uri: "/"
5
+ body:
6
+ headers:
7
+ user-agent: Faraday v2.7.4
8
+ accept-encoding: gzip,deflate
9
+ content-length: '0'
10
+ accept: "*/*"
11
+ host: localhost:8080
12
+ content-type: application/x-www-form-urlencoded
@@ -0,0 +1,10 @@
1
+ ---
2
+ ssl: false
3
+ method: GET
4
+ uri: "/"
5
+ body:
6
+ headers:
7
+ user-agent: Faraday v2.7.4
8
+ accept-encoding: gzip,deflate
9
+ accept: "*/*"
10
+ host: localhost:8080
data/sub/avm/avm.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
- s.add_dependency 'aranha-parsers', '~> 0.17'
15
+ s.add_dependency 'aranha-parsers', '~> 0.17', '>= 0.17.1'
16
16
  s.add_dependency 'eac_cli', '~> 0.30', '>= 0.30.1'
17
17
  s.add_dependency 'eac_config', '~> 0.12'
18
18
  s.add_dependency 'eac_docker', '~> 0.7'
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'eac_ruby_utils/fs/temp'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Data
8
+ class Package
9
+ module BuildDirectory
10
+ private
11
+
12
+ attr_writer :build_directory
13
+
14
+ # @return [EacRubyUtils::Fs::Temp::Directory]
15
+ def build_directory
16
+ @build_directory || raise('@build_directory is blank')
17
+ end
18
+
19
+ def on_build_directory
20
+ ::EacRubyUtils::Fs::Temp.on_directory do |directory|
21
+ self.build_directory = directory
22
+ yield
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/data/package/build_directory'
3
4
  require 'avm/data/rotate'
4
5
  require 'eac_ruby_utils/core_ext'
5
6
  require 'minitar'
@@ -10,6 +11,7 @@ module Avm
10
11
  class Dump
11
12
  enable_speaker
12
13
  enable_listable
14
+ include ::Avm::Data::Package::BuildDirectory
13
15
 
14
16
  DEFAULT_EXPIRE_TIME = 1.day
15
17
  DEFAULT_FILE_EXTENSION = '.tar'
@@ -45,8 +47,10 @@ module Avm
45
47
  def run
46
48
  raise "Cannot run: #{cannot_run_reason}" unless runnable?
47
49
 
48
- build_dir = dump_units_to_build_directory
49
- package_file = create_package_file(build_dir)
50
+ package_file = on_build_directory do
51
+ dump_units_to_build_directory
52
+ create_package_file
53
+ end
50
54
  rotate
51
55
  move_download_to_final_dest(package_file)
52
56
  end
@@ -100,15 +104,13 @@ module Avm
100
104
  end
101
105
 
102
106
  def dump_units_to_build_directory
103
- dir = ::Dir.mktmpdir
104
- package.dump_units_to_directory(dir)
105
- dir
107
+ package.dump_units_to_directory(build_directory)
106
108
  end
107
109
 
108
- def create_package_file(build_dir)
110
+ def create_package_file
109
111
  package_path = new_build_path
110
- infom "Creating package \"#{package_path}\" from \"#{build_dir}\"..."
111
- Dir.chdir(build_dir) do
112
+ infom "Creating package \"#{package_path}\" from \"#{build_directory}\"..."
113
+ ::Dir.chdir(build_directory.to_path) do
112
114
  ::Minitar.pack('.', File.open(::File.expand_path(package_path), 'wb'))
113
115
  end
114
116
  package_path
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'avm/data/package/build_directory'
3
4
  require 'eac_ruby_utils/core_ext'
4
5
  require 'minitar'
5
6
 
@@ -8,13 +9,9 @@ module Avm
8
9
  class Package
9
10
  class Load
10
11
  enable_speaker
12
+ include ::Avm::Data::Package::BuildDirectory
11
13
 
12
- attr_reader :package, :data_file_path
13
-
14
- def initialize(package, data_file_path)
15
- @package = package
16
- @data_file_path = data_file_path
17
- end
14
+ common_constructor :package, :data_file_path
18
15
 
19
16
  def runnable?
20
17
  cannot_run_reason.blank?
@@ -29,8 +26,10 @@ module Avm
29
26
  def run
30
27
  raise "Cannot run: #{cannot_run_reason}" unless runnable?
31
28
 
32
- build_dir = extract_packages_to_build_directory
33
- package.load_units_from_directory(build_dir)
29
+ on_build_directory do
30
+ extract_packages_to_build_directory
31
+ package.load_units_from_directory(build_directory)
32
+ end
34
33
  end
35
34
 
36
35
  def data_file_exist?
@@ -38,9 +37,7 @@ module Avm
38
37
  end
39
38
 
40
39
  def extract_packages_to_build_directory
41
- dir = ::Dir.mktmpdir
42
- ::Minitar.unpack(data_file_path, dir)
43
- dir
40
+ ::Minitar.unpack(data_file_path, build_directory.to_path)
44
41
  end
45
42
  end
46
43
  end
@@ -18,8 +18,11 @@ module Avm
18
18
  end
19
19
  end
20
20
 
21
+ # @return [Avm::Data::Package] Return +self+.
21
22
  def add_unit(identifier, unit)
22
23
  units[identifier.to_sym] = unit
24
+
25
+ self
23
26
  end
24
27
 
25
28
  def dump(data_path, options = {})
@@ -46,6 +46,11 @@ module Avm
46
46
  end
47
47
  end
48
48
 
49
+ # @return [Struct(:key, :subpath), nil]
50
+ def installation_files_data
51
+ nil
52
+ end
53
+
49
54
  def load(data_path)
50
55
  run_callbacks :load do
51
56
  infom "Loading unit \"#{name}\" from \"#{data_path}\"..."
@@ -39,10 +39,17 @@ module Avm
39
39
  instance_command('find', files_path, '-mindepth', 1, '-delete').execute!
40
40
  end
41
41
 
42
+ # @return [Struct(:key, :subpath), nil]
43
+ def installation_files_data
44
+ return nil unless fs_path_subpath.relative?
45
+
46
+ ::Struct.new(:key, :subpath).new(fs_path_subpath.basename.to_path, fs_path_subpath)
47
+ end
48
+
42
49
  # @return [EacRubyUtils::Envs::Command]
43
50
  def instance_command(*args)
44
51
  args = ['sudo', '-Hu', sudo_user] + args if sudo_user.present?
45
- instance.host_env.command(*args)
52
+ instance.host_env.command(*args).chdir('/')
46
53
  end
47
54
 
48
55
  # @return [String, nil]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.66.1'
4
+ VERSION = '0.67.0'
5
5
  end
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.files = Dir['{lib,template}/**/*']
14
14
 
15
15
  s.add_dependency 'asciidoctor', '~> 2.0', '>= 2.0.18'
16
- s.add_dependency 'avm-eac_webapp_base0', '~> 0.14'
16
+ s.add_dependency 'avm-eac_webapp_base0', '~> 0.15'
17
17
  s.add_dependency 'eac_ruby_utils', '~> 0.112'
18
18
  s.add_dependency 'os', '~> 1.1', '>= 1.1.4'
19
19
  s.add_dependency 'rouge', '~> 3.30'
@@ -9,7 +9,6 @@ module Avm
9
9
  module EacAsciidoctorBase0
10
10
  module Instances
11
11
  class Base < ::Avm::EacWebappBase0::Instances::Base
12
- FILES_UNITS = {}.freeze
13
12
  AUTHOR_EMAIL_ENTRY_PATH = 'install.email'
14
13
  AUTHOR_NAME_ENTRY_PATH = 'install.name'
15
14
  AUTHOR_NAME_INITIALS_ENTRY_PATH = 'install.name_initials'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module EacAsciidoctorBase0
5
- VERSION = '0.18.0'
5
+ VERSION = '0.18.1'
6
6
  end
7
7
  end
@@ -12,9 +12,9 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.52'
16
- s.add_dependency 'avm-eac_webapp_base0', '~> 0.12'
17
- s.add_dependency 'eac_ruby_utils', '~> 0.106'
15
+ s.add_dependency 'avm', '~> 0.67'
16
+ s.add_dependency 'avm-eac_webapp_base0', '~> 0.15'
17
+ s.add_dependency 'eac_ruby_utils', '~> 0.112'
18
18
 
19
19
  s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5', '>= 0.5.1'
20
20
  end