eac_tools 0.28.0 → 0.30.0
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 -39
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +1 -1
- data/sub/avm/lib/avm/instances/base/auto_values/install.rb +2 -1
- data/sub/avm/lib/avm/instances/entry_keys.rb +1 -1
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +1 -1
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/runners/base/lib_rename.rb +77 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/namespace_replacer.rb +55 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/runners/update_dependencies_requirements.rb +21 -7
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
- data/sub/avm-eac_webapp_base0/avm-eac_webapp_base0.gemspec +2 -2
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/apache_host.rb +6 -1
- data/sub/avm-eac_webapp_base0/lib/avm/eac_webapp_base0/version.rb +1 -1
- data/sub/avm-eac_webapp_base0/template/avm/eac_webapp_base0/apache_host/no_ssl.conf +1 -1
- data/sub/avm-files/Gemfile +8 -0
- data/sub/avm-files/avm-files.gemspec +22 -0
- data/sub/avm-files/lib/avm/files/appendable/file_content.rb +24 -0
- data/sub/avm-files/lib/avm/files/appendable/plain_directory.rb +25 -0
- data/sub/avm-files/lib/avm/files/appendable/resource_base.rb +13 -0
- data/sub/avm-files/lib/avm/files/appendable/tar_output_command.rb +26 -0
- data/sub/avm-files/lib/avm/files/appendable/templatized_directory.rb +29 -0
- data/sub/avm-files/lib/avm/files/appendable.rb +55 -0
- data/sub/avm-files/lib/avm/files/appender.rb +11 -0
- data/sub/avm-files/lib/avm/files/deploy.rb +71 -0
- data/sub/avm-files/lib/avm/files/formatter/formats/base.rb +62 -0
- data/sub/avm-files/lib/avm/files/formatter/formats/generic_plain.rb +34 -0
- data/sub/avm-files/lib/avm/files/formatter/formats/html.rb +45 -0
- data/sub/avm-files/lib/avm/files/formatter/formats/javascript.rb +24 -0
- data/sub/avm-files/lib/avm/files/formatter/formats/json.rb +27 -0
- data/sub/avm-files/lib/avm/files/formatter/formats/php.rb +22 -0
- data/sub/avm-files/lib/avm/files/formatter/formats/python.rb +22 -0
- data/sub/avm-files/lib/avm/files/formatter/formats/ruby.rb +22 -0
- data/sub/avm-files/lib/avm/files/formatter/formats/xml.rb +28 -0
- data/sub/avm-files/lib/avm/files/formatter/formats.rb +13 -0
- data/sub/avm-files/lib/avm/files/formatter/utf8_assert.rb +74 -0
- data/sub/avm-files/lib/avm/files/formatter.rb +90 -0
- data/sub/avm-files/lib/avm/files/runner_with/file_replacer.rb +34 -0
- data/sub/avm-files/lib/avm/files/runner_with/filesystem_traverser.rb +54 -0
- data/sub/avm-files/lib/avm/files/runner_with.rb +11 -0
- data/sub/avm-files/lib/avm/files/text_replacer/gsub.rb +24 -0
- data/sub/avm-files/lib/avm/files/text_replacer.rb +32 -0
- data/sub/avm-files/lib/avm/files/version.rb +7 -0
- data/sub/avm-files/lib/avm/files.rb +9 -0
- data/sub/avm-files/spec/rubocop_spec.rb +3 -0
- data/sub/avm-files/spec/spec_helper.rb +4 -0
- data/sub/avm-tools/avm-tools.gemspec +5 -5
- data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
- data/sub/eac_cli/eac_cli.gemspec +3 -3
- data/sub/eac_cli/lib/eac_cli/core_ext.rb +1 -1
- data/sub/eac_cli/lib/eac_cli/runner_with_set.rb +7 -3
- data/sub/eac_cli/lib/eac_cli/version.rb +1 -1
- data/sub/eac_ruby_base0/eac_ruby_base0.gemspec +4 -4
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/version.rb +1 -1
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/object/debug.rb +11 -7
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- metadata +49 -26
- data/sub/avm/lib/avm/instances/base/auto_values/admin.rb +0 -19
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object/runner_with.rb +0 -5
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/patches/object.rb +0 -5
- data/sub/eac_ruby_base0/lib/eac_ruby_base0/runner_with/filesystem_traverser.rb +0 -52
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dc1385a1932c7e4a6b89b66db8ea6084663a9c690571b00ca73465b47421ddd2
|
|
4
|
+
data.tar.gz: 7dd2dab5f79240a7b8087532ee959accaf130ac12f4c6d9745b86a0ab85efd5f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6b28b72f7c1eafb7ca609ab9b0450cc07254316756668ae980af135710fa01dcd364d18bc403c2912b50dd1c3e6c5832f220c59aa8aaac7b2366436801aebb4a
|
|
7
|
+
data.tar.gz: e6fcad611277f1d36707f180da96fed11a25a98139e5cc889bb5aa3e5728d42d3a9fa4667d70f1055fdff114291dbc364b099d4fb72615696d6d6be1e19a05fc
|
data/Gemfile.lock
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
eac_tools (0.
|
|
5
|
-
avm (~> 0.
|
|
4
|
+
eac_tools (0.30.0)
|
|
5
|
+
avm (~> 0.43)
|
|
6
6
|
avm-eac_asciidoctor_base0 (~> 0.7)
|
|
7
7
|
avm-eac_generic_base0 (~> 0.5)
|
|
8
8
|
avm-eac_latex_base0 (~> 0.2)
|
|
@@ -10,11 +10,11 @@ PATH
|
|
|
10
10
|
avm-eac_rails_base1 (~> 0.6)
|
|
11
11
|
avm-eac_redmine_base0 (~> 0.14)
|
|
12
12
|
avm-eac_redmine_plugin_base0 (~> 0.3)
|
|
13
|
-
avm-eac_ruby_base1 (~> 0.
|
|
14
|
-
avm-eac_webapp_base0 (~> 0.
|
|
13
|
+
avm-eac_ruby_base1 (~> 0.21)
|
|
14
|
+
avm-eac_webapp_base0 (~> 0.8)
|
|
15
15
|
avm-eac_wordpress_base0 (~> 0.2)
|
|
16
|
-
avm-tools (~> 0.136)
|
|
17
|
-
eac_ruby_utils (~> 0.
|
|
16
|
+
avm-tools (~> 0.136, >= 0.136.1)
|
|
17
|
+
eac_ruby_utils (~> 0.103)
|
|
18
18
|
|
|
19
19
|
PATH
|
|
20
20
|
remote: sub/avm-eac_asciidoctor_base0
|
|
@@ -80,20 +80,20 @@ PATH
|
|
|
80
80
|
PATH
|
|
81
81
|
remote: sub/avm-eac_ruby_base1
|
|
82
82
|
specs:
|
|
83
|
-
avm-eac_ruby_base1 (0.
|
|
83
|
+
avm-eac_ruby_base1 (0.21.0)
|
|
84
84
|
avm (~> 0.41, >= 0.41.1)
|
|
85
85
|
avm-eac_generic_base0 (~> 0.5)
|
|
86
|
-
eac_ruby_utils (~> 0.
|
|
86
|
+
eac_ruby_utils (~> 0.103)
|
|
87
87
|
|
|
88
88
|
PATH
|
|
89
89
|
remote: sub/avm-eac_webapp_base0
|
|
90
90
|
specs:
|
|
91
|
-
avm-eac_webapp_base0 (0.
|
|
92
|
-
avm (~> 0.
|
|
91
|
+
avm-eac_webapp_base0 (0.8.0)
|
|
92
|
+
avm (~> 0.42)
|
|
93
93
|
avm-eac_generic_base0 (~> 0.5)
|
|
94
94
|
avm-eac_postgresql_base0 (~> 0.2)
|
|
95
95
|
avm-eac_ubuntu_base0 (~> 0.3)
|
|
96
|
-
eac_ruby_utils (~> 0.
|
|
96
|
+
eac_ruby_utils (~> 0.103)
|
|
97
97
|
|
|
98
98
|
PATH
|
|
99
99
|
remote: sub/avm-eac_wordpress_base0
|
|
@@ -103,33 +103,43 @@ PATH
|
|
|
103
103
|
avm-eac_webapp_base0 (~> 0.6)
|
|
104
104
|
eac_ruby_utils (~> 0.102)
|
|
105
105
|
|
|
106
|
+
PATH
|
|
107
|
+
remote: sub/avm-files
|
|
108
|
+
specs:
|
|
109
|
+
avm-files (0.4.0)
|
|
110
|
+
avm (~> 0.43)
|
|
111
|
+
eac_cli (~> 0.28)
|
|
112
|
+
eac_fs (~> 0.12, >= 0.12.3)
|
|
113
|
+
eac_ruby_utils (~> 0.103)
|
|
114
|
+
eac_templates (~> 0.3, >= 0.3.2)
|
|
115
|
+
|
|
106
116
|
PATH
|
|
107
117
|
remote: sub/avm-tools
|
|
108
118
|
specs:
|
|
109
|
-
avm-tools (0.136.
|
|
110
|
-
aranha-parsers (~> 0.14, >= 0.14.
|
|
119
|
+
avm-tools (0.136.1)
|
|
120
|
+
aranha-parsers (~> 0.14, >= 0.14.3)
|
|
111
121
|
avm (~> 0.42)
|
|
112
|
-
avm-eac_ruby_base1 (~> 0.
|
|
122
|
+
avm-eac_ruby_base1 (~> 0.21)
|
|
113
123
|
avm-eac_ubuntu_base0 (~> 0.3)
|
|
114
|
-
avm-files (~> 0.
|
|
124
|
+
avm-files (~> 0.4)
|
|
115
125
|
avm-git (~> 0.4)
|
|
116
126
|
clipboard (~> 1.3, >= 1.3.6)
|
|
117
127
|
curb (~> 0.9, >= 0.9.11)
|
|
118
128
|
eac_git (~> 0.12, >= 0.12.2)
|
|
119
|
-
eac_ruby_base0 (~> 0.
|
|
120
|
-
eac_templates (~> 0.3, >= 0.3.
|
|
129
|
+
eac_ruby_base0 (~> 0.17)
|
|
130
|
+
eac_templates (~> 0.3, >= 0.3.2)
|
|
121
131
|
git (~> 1.12)
|
|
122
132
|
ruby-progressbar (~> 1.11)
|
|
123
133
|
|
|
124
134
|
PATH
|
|
125
135
|
remote: sub/avm
|
|
126
136
|
specs:
|
|
127
|
-
avm (0.
|
|
137
|
+
avm (0.43.0)
|
|
128
138
|
eac_cli (~> 0.27, >= 0.27.8)
|
|
129
139
|
eac_config (~> 0.11, >= 0.11.1)
|
|
130
140
|
eac_docker (~> 0.4, >= 0.4.2)
|
|
131
141
|
eac_git (~> 0.12, >= 0.12.2)
|
|
132
|
-
eac_ruby_utils (~> 0.
|
|
142
|
+
eac_ruby_utils (~> 0.103)
|
|
133
143
|
eac_templates (~> 0.3, >= 0.3.1)
|
|
134
144
|
filesize (~> 0.2)
|
|
135
145
|
htmlbeautifier (~> 1.4, >= 1.4.2)
|
|
@@ -138,10 +148,10 @@ PATH
|
|
|
138
148
|
PATH
|
|
139
149
|
remote: sub/eac_cli
|
|
140
150
|
specs:
|
|
141
|
-
eac_cli (0.
|
|
142
|
-
colorize (~> 0.8.1)
|
|
143
|
-
eac_config (~> 0.
|
|
144
|
-
eac_ruby_utils (~> 0.
|
|
151
|
+
eac_cli (0.28.0)
|
|
152
|
+
colorize (~> 0.8, >= 0.8.1)
|
|
153
|
+
eac_config (~> 0.11, >= 0.11.1)
|
|
154
|
+
eac_ruby_utils (~> 0.103)
|
|
145
155
|
|
|
146
156
|
PATH
|
|
147
157
|
remote: sub/eac_config
|
|
@@ -168,16 +178,16 @@ PATH
|
|
|
168
178
|
PATH
|
|
169
179
|
remote: sub/eac_ruby_base0
|
|
170
180
|
specs:
|
|
171
|
-
eac_ruby_base0 (0.
|
|
172
|
-
avm-eac_ruby_base1 (~> 0.
|
|
173
|
-
eac_cli (~> 0.
|
|
174
|
-
eac_fs (~> 0.
|
|
175
|
-
eac_ruby_utils (~> 0.
|
|
181
|
+
eac_ruby_base0 (0.17.0)
|
|
182
|
+
avm-eac_ruby_base1 (~> 0.21)
|
|
183
|
+
eac_cli (~> 0.28)
|
|
184
|
+
eac_fs (~> 0.12, >= 0.12.3)
|
|
185
|
+
eac_ruby_utils (~> 0.103)
|
|
176
186
|
|
|
177
187
|
PATH
|
|
178
188
|
remote: sub/eac_ruby_utils
|
|
179
189
|
specs:
|
|
180
|
-
eac_ruby_utils (0.
|
|
190
|
+
eac_ruby_utils (0.103.0)
|
|
181
191
|
activesupport (>= 4, < 7)
|
|
182
192
|
addressable (~> 2.8)
|
|
183
193
|
bundler
|
|
@@ -187,7 +197,7 @@ PATH
|
|
|
187
197
|
GEM
|
|
188
198
|
remote: https://rubygems.org/
|
|
189
199
|
specs:
|
|
190
|
-
activesupport (6.1.
|
|
200
|
+
activesupport (6.1.7)
|
|
191
201
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
192
202
|
i18n (>= 1.6, < 2)
|
|
193
203
|
minitest (>= 5.1)
|
|
@@ -195,8 +205,8 @@ GEM
|
|
|
195
205
|
zeitwerk (~> 2.3)
|
|
196
206
|
addressable (2.8.1)
|
|
197
207
|
public_suffix (>= 2.0.2, < 6.0)
|
|
198
|
-
aranha-parsers (0.14.
|
|
199
|
-
activesupport (
|
|
208
|
+
aranha-parsers (0.14.3)
|
|
209
|
+
activesupport (>= 4.0.0)
|
|
200
210
|
addressable (~> 2.8, >= 2.8.1)
|
|
201
211
|
curb (~> 0.9, >= 0.9.11)
|
|
202
212
|
eac_ruby_utils (~> 0.102, >= 0.102.1)
|
|
@@ -213,11 +223,6 @@ GEM
|
|
|
213
223
|
avm (~> 0.7)
|
|
214
224
|
eac_ruby_utils (~> 0.77, >= 0.77.1)
|
|
215
225
|
eac_templates (~> 0.3)
|
|
216
|
-
avm-files (0.3.2)
|
|
217
|
-
avm (~> 0.6)
|
|
218
|
-
eac_fs (~> 0.5)
|
|
219
|
-
eac_ruby_utils (~> 0.76)
|
|
220
|
-
eac_templates (~> 0.2)
|
|
221
226
|
avm-git (0.4.0)
|
|
222
227
|
avm-files (~> 0.1)
|
|
223
228
|
eac_git (~> 0.11)
|
|
@@ -307,13 +312,13 @@ GEM
|
|
|
307
312
|
rspec-mocks (~> 3.11.0)
|
|
308
313
|
rspec-core (3.11.0)
|
|
309
314
|
rspec-support (~> 3.11.0)
|
|
310
|
-
rspec-expectations (3.11.
|
|
315
|
+
rspec-expectations (3.11.1)
|
|
311
316
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
312
317
|
rspec-support (~> 3.11.0)
|
|
313
318
|
rspec-mocks (3.11.1)
|
|
314
319
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
315
320
|
rspec-support (~> 3.11.0)
|
|
316
|
-
rspec-support (3.11.
|
|
321
|
+
rspec-support (3.11.1)
|
|
317
322
|
rubocop (0.80.1)
|
|
318
323
|
jaro_winkler (~> 1.5.1)
|
|
319
324
|
parallel (~> 1.10)
|
|
@@ -351,6 +356,7 @@ DEPENDENCIES
|
|
|
351
356
|
avm-eac_ruby_base1!
|
|
352
357
|
avm-eac_webapp_base0!
|
|
353
358
|
avm-eac_wordpress_base0!
|
|
359
|
+
avm-files!
|
|
354
360
|
avm-tools!
|
|
355
361
|
eac_cli!
|
|
356
362
|
eac_config!
|
data/lib/eac_tools/version.rb
CHANGED
data/sub/avm/avm.gemspec
CHANGED
|
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
|
16
16
|
s.add_dependency 'eac_config', '~> 0.11', '>= 0.11.1'
|
|
17
17
|
s.add_dependency 'eac_docker', '~> 0.4', '>= 0.4.2'
|
|
18
18
|
s.add_dependency 'eac_git', '~> 0.12', '>= 0.12.2'
|
|
19
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
|
19
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.103'
|
|
20
20
|
s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.1'
|
|
21
21
|
s.add_dependency 'filesize', '~> 0.2'
|
|
22
22
|
s.add_dependency 'htmlbeautifier', '~> 1.4', '>= 1.4.2'
|
|
@@ -8,7 +8,8 @@ module Avm
|
|
|
8
8
|
class Base
|
|
9
9
|
module AutoValues
|
|
10
10
|
module Install
|
|
11
|
-
(::Avm::Entries::UriBuilder::ENTRIES_FIELDS + %w[data_path groupname])
|
|
11
|
+
(::Avm::Entries::UriBuilder::ENTRIES_FIELDS + %w[data_path email groupname])
|
|
12
|
+
.each do |component|
|
|
12
13
|
method_suffix = "install_#{component}"
|
|
13
14
|
define_method "auto_#{method_suffix}" do
|
|
14
15
|
uri_component_entry_value(
|
|
@@ -49,7 +49,7 @@ module Avm
|
|
|
49
49
|
admin: URI_FIELDS + %w[api_key],
|
|
50
50
|
database: URI_FIELDS + %w[id limit name system timeout extra],
|
|
51
51
|
docker: %w[registry],
|
|
52
|
-
install: URI_FIELDS + %w[id data_path groupname],
|
|
52
|
+
install: URI_FIELDS + %w[id data_path email groupname],
|
|
53
53
|
mailer: {
|
|
54
54
|
'' => %w[id from reply_to],
|
|
55
55
|
smtp: URI_FIELDS + %w[address domain authentication openssl_verify_mode starttls_auto tls]
|
data/sub/avm/lib/avm/version.rb
CHANGED
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |s|
|
|
|
14
14
|
|
|
15
15
|
s.add_dependency 'avm', '~> 0.41', '>= 0.41.1'
|
|
16
16
|
s.add_dependency 'avm-eac_generic_base0', '~> 0.5'
|
|
17
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
|
17
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.103'
|
|
18
18
|
|
|
19
19
|
s.add_development_dependency 'aranha-parsers', '~> 0.14', '>= 0.14.1'
|
|
20
20
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'eac_cli/core_ext'
|
|
4
|
+
require 'avm/eac_ruby_base1/sources/namespace_replacer'
|
|
5
|
+
|
|
6
|
+
module Avm
|
|
7
|
+
module EacRubyBase1
|
|
8
|
+
module Runners
|
|
9
|
+
class Base
|
|
10
|
+
class LibRename
|
|
11
|
+
runner_with :help, :file_replacer do
|
|
12
|
+
desc 'Rename Ruby modules classes Ruby.'
|
|
13
|
+
arg_opt '-f', '--from', 'Rename "from".'
|
|
14
|
+
arg_opt '-t', '--to', 'Rename "to".'
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def run
|
|
18
|
+
start_banner
|
|
19
|
+
validate
|
|
20
|
+
replacements_banner
|
|
21
|
+
run_filesystem_traverser
|
|
22
|
+
success 'Done!'
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def validate
|
|
26
|
+
%w[from to].each do |opt|
|
|
27
|
+
fatal_error "No \"#{opt}\" option" if send(opt).blank?
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def start_banner
|
|
32
|
+
infov 'From', from
|
|
33
|
+
infov 'To', to
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
private
|
|
37
|
+
|
|
38
|
+
def namespace_replacer_uncached
|
|
39
|
+
::Avm::EacRubyBase1::Sources::NamespaceReplacer.new(from, to)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def text_replacer
|
|
43
|
+
@text_replacer ||= super.gsub(from, to).gsub(from_path, to_path)
|
|
44
|
+
.gsub(namespace_replacer.from_result, namespace_replacer.to_result)
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def replace_file?(file)
|
|
48
|
+
file.extname == '.rb'
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
def replacements_banner
|
|
52
|
+
infov 'Replacements', text_replacer.replacements.count
|
|
53
|
+
text_replacer.replacements.each do |rep|
|
|
54
|
+
infov ' * ', rep
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
def from
|
|
59
|
+
parsed.from.to_s
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def to
|
|
63
|
+
parsed.to.to_s
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def from_path
|
|
67
|
+
from.underscore
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
def to_path
|
|
71
|
+
to.underscore
|
|
72
|
+
end
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
end
|
|
77
|
+
end
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Avm
|
|
4
|
+
module EacRubyBase1
|
|
5
|
+
module Sources
|
|
6
|
+
class NamespaceReplacer
|
|
7
|
+
common_constructor :from, :to
|
|
8
|
+
|
|
9
|
+
def concat_regex(regexes)
|
|
10
|
+
r = regexes.first
|
|
11
|
+
regexes[1..-1].each do |x|
|
|
12
|
+
r = ::Regexp.new(r.source + x.source)
|
|
13
|
+
end
|
|
14
|
+
r
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def from_result
|
|
18
|
+
/\n#{from_open.source}(.+)#{from_close.source}/m
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def from_open
|
|
22
|
+
concat_regex(from.split('::')
|
|
23
|
+
.map { |v| / *(?:class|module) +#{::Regexp.quote(v)} *\n/m })
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def from_close
|
|
27
|
+
concat_regex(from.split('::').count.times.map { / *end *\n/m })
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def to_result
|
|
31
|
+
"\n\n#{to_open}\\1#{to_close}"
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def to_open
|
|
35
|
+
s = ''
|
|
36
|
+
to.split('::').each_with_index do |part, index|
|
|
37
|
+
s += (' ' * index) + "module #{part}\n"
|
|
38
|
+
end
|
|
39
|
+
s
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def to_close
|
|
43
|
+
parts = to.split('::')
|
|
44
|
+
s = ''
|
|
45
|
+
parts.each_with_index do |_part, index|
|
|
46
|
+
tabc = (parts.count - 1 - index)
|
|
47
|
+
tabc -= 1 if index.zero?
|
|
48
|
+
s += (' ' * tabc) + "end\n"
|
|
49
|
+
end
|
|
50
|
+
s
|
|
51
|
+
end
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
@@ -16,13 +16,9 @@ module Avm
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def run
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
infov 'Gem to update', gem_name
|
|
23
|
-
::Avm::EacRubyBase1::Sources::UpdateDependencyRequirements
|
|
24
|
-
.new(runner_context.call(:source), gem_name).perform
|
|
25
|
-
end
|
|
19
|
+
start_banner
|
|
20
|
+
update_gemfile_lock
|
|
21
|
+
process_all_gems
|
|
26
22
|
end
|
|
27
23
|
|
|
28
24
|
def gemspec
|
|
@@ -47,6 +43,24 @@ module Avm
|
|
|
47
43
|
|
|
48
44
|
gemspec.dependencies.map(&:gem_name)
|
|
49
45
|
end
|
|
46
|
+
|
|
47
|
+
def process_all_gems
|
|
48
|
+
gem_names.each do |gem_name|
|
|
49
|
+
infov 'Gem to update', gem_name
|
|
50
|
+
::Avm::EacRubyBase1::Sources::UpdateDependencyRequirements
|
|
51
|
+
.new(runner_context.call(:source), gem_name).perform
|
|
52
|
+
end
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def start_banner
|
|
56
|
+
runner_context.call(:source_banner)
|
|
57
|
+
infov 'Gems to update', gem_names.count
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
def update_gemfile_lock
|
|
61
|
+
infom 'Updating Gemfile\'s lock...'
|
|
62
|
+
runner_context.call(:source).bundle('update').execute!
|
|
63
|
+
end
|
|
50
64
|
end
|
|
51
65
|
end
|
|
52
66
|
end
|
|
@@ -12,11 +12,11 @@ Gem::Specification.new do |s|
|
|
|
12
12
|
|
|
13
13
|
s.files = Dir['{lib,template}/**/*']
|
|
14
14
|
|
|
15
|
-
s.add_dependency 'avm', '~> 0.
|
|
15
|
+
s.add_dependency 'avm', '~> 0.42'
|
|
16
16
|
s.add_dependency 'avm-eac_generic_base0', '~> 0.5'
|
|
17
17
|
s.add_dependency 'avm-eac_postgresql_base0', '~> 0.2'
|
|
18
18
|
s.add_dependency 'avm-eac_ubuntu_base0', '~> 0.3'
|
|
19
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
|
19
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.103'
|
|
20
20
|
|
|
21
21
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.2'
|
|
22
22
|
end
|
|
@@ -8,10 +8,15 @@ require 'eac_templates/core_ext'
|
|
|
8
8
|
module Avm
|
|
9
9
|
module EacWebappBase0
|
|
10
10
|
class ApacheHost
|
|
11
|
+
APACHE_DIRECTORY_EXTRA_CONFIG_KEY = 'install.apache_directory_extra_config'
|
|
11
12
|
JOBS = %w[write_available_no_ssl_site enable_no_ssl_site remove_ssl_site reload_apache
|
|
12
13
|
run_certbot enable_ssl_site reload_apache].freeze
|
|
13
14
|
include ::Avm::Jobs::Base
|
|
14
15
|
|
|
16
|
+
def directory_extra_config
|
|
17
|
+
instance.entry(APACHE_DIRECTORY_EXTRA_CONFIG_KEY).value.if_present { |v| " #{v}\n" }
|
|
18
|
+
end
|
|
19
|
+
|
|
15
20
|
def no_ssl_site_content
|
|
16
21
|
::Avm::EacWebappBase0::ApacheHost
|
|
17
22
|
.template.child('no_ssl.conf')
|
|
@@ -61,7 +66,7 @@ module Avm
|
|
|
61
66
|
instance.host_env.command(
|
|
62
67
|
'sudo', 'certbot', '--apache', '--domain', instance.read_entry('web.hostname'),
|
|
63
68
|
'--redirect', '--non-interactive', '--agree-tos',
|
|
64
|
-
'--email', instance.
|
|
69
|
+
'--email', instance.install_email
|
|
65
70
|
).system!
|
|
66
71
|
end
|
|
67
72
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
$LOAD_PATH.push File.expand_path('lib', __dir__)
|
|
4
|
+
|
|
5
|
+
require 'avm/files/version'
|
|
6
|
+
|
|
7
|
+
Gem::Specification.new do |s|
|
|
8
|
+
s.name = 'avm-files'
|
|
9
|
+
s.version = Avm::Files::VERSION
|
|
10
|
+
s.authors = ['Put here the authors']
|
|
11
|
+
s.summary = 'Put here de description.'
|
|
12
|
+
|
|
13
|
+
s.files = Dir['{lib}/**/*']
|
|
14
|
+
|
|
15
|
+
s.add_dependency 'avm', '~> 0.43'
|
|
16
|
+
s.add_dependency 'eac_cli', '~> 0.28'
|
|
17
|
+
s.add_dependency 'eac_fs', '~> 0.12', '>= 0.12.3'
|
|
18
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.103'
|
|
19
|
+
s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.2'
|
|
20
|
+
|
|
21
|
+
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
|
22
|
+
end
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
|
4
|
+
require 'avm/files/appendable/resource_base'
|
|
5
|
+
|
|
6
|
+
module Avm
|
|
7
|
+
module Files
|
|
8
|
+
module Appendable
|
|
9
|
+
class FileContent < ::Avm::Files::Appendable::ResourceBase
|
|
10
|
+
attr_reader :target_path, :content
|
|
11
|
+
|
|
12
|
+
def initialize(deploy, target_path, content)
|
|
13
|
+
super(deploy)
|
|
14
|
+
@target_path = target_path
|
|
15
|
+
@content = content
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def write_on(target_dir)
|
|
19
|
+
target_dir.join(target_path).write(content)
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
|
4
|
+
require 'avm/files/appendable/resource_base'
|
|
5
|
+
|
|
6
|
+
module Avm
|
|
7
|
+
module Files
|
|
8
|
+
module Appendable
|
|
9
|
+
class PlainDirectory < ::Avm::Files::Appendable::ResourceBase
|
|
10
|
+
attr_reader :source_path
|
|
11
|
+
|
|
12
|
+
def initialize(appender, source_path)
|
|
13
|
+
super(appender)
|
|
14
|
+
@source_path = source_path.to_pathname
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def write_on(target_dir)
|
|
18
|
+
raise "\"#{source_path}\" is not a directory" unless source_path.directory?
|
|
19
|
+
|
|
20
|
+
::FileUtils.cp_r("#{source_path}/.", target_dir.to_path)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
|
4
|
+
require 'eac_ruby_utils/envs'
|
|
5
|
+
require 'avm/files/appendable/resource_base'
|
|
6
|
+
|
|
7
|
+
module Avm
|
|
8
|
+
module Files
|
|
9
|
+
module Appendable
|
|
10
|
+
class TarOutputCommand < ::Avm::Files::Appendable::ResourceBase
|
|
11
|
+
attr_reader :command
|
|
12
|
+
|
|
13
|
+
def initialize(appender, command)
|
|
14
|
+
super(appender)
|
|
15
|
+
@command = command
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def write_on(target_dir)
|
|
19
|
+
command.pipe(
|
|
20
|
+
::EacRubyUtils::Envs.local.command('tar', '-xf', '-', '-C', target_dir)
|
|
21
|
+
).execute!
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
|
4
|
+
require 'avm/files/appendable/resource_base'
|
|
5
|
+
require 'eac_templates/directory'
|
|
6
|
+
|
|
7
|
+
module Avm
|
|
8
|
+
module Files
|
|
9
|
+
module Appendable
|
|
10
|
+
class TemplatizedDirectory < ::Avm::Files::Appendable::ResourceBase
|
|
11
|
+
attr_reader :source_path
|
|
12
|
+
|
|
13
|
+
def initialize(appender, source_path)
|
|
14
|
+
super(appender)
|
|
15
|
+
@source_path = source_path
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def write_on(target_dir)
|
|
19
|
+
raise 'Variables source not set' if appender.variables_source.blank?
|
|
20
|
+
|
|
21
|
+
::EacTemplates::Directory.new(source_path).apply(
|
|
22
|
+
appender.variables_source,
|
|
23
|
+
target_dir
|
|
24
|
+
)
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|