eac_tools 0.53.0 → 0.55.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +28 -28
- data/lib/eac_tools/version.rb +1 -1
- data/sub/avm/avm.gemspec +1 -1
- data/sub/avm/lib/avm/scms/auto_commit/file_resource_name.rb +1 -1
- data/sub/avm/lib/avm/scms/base/commits.rb +7 -0
- data/sub/avm/lib/avm/scms/commit_info.rb +13 -0
- data/sub/avm/lib/avm/scms/null/commit.rb +15 -0
- data/sub/avm/lib/avm/scms/null.rb +7 -0
- data/sub/avm/lib/avm/sources/auto_commit/for_file.rb +31 -0
- data/sub/avm/lib/avm/sources/auto_commit.rb +11 -0
- data/sub/avm/lib/avm/sources/base/configuration.rb +12 -6
- data/sub/avm/lib/avm/sources/base/locale.rb +7 -0
- data/sub/avm/lib/avm/sources/base/organizational.rb +32 -0
- data/sub/avm/lib/avm/sources/base/subs.rb +5 -0
- data/sub/avm/lib/avm/sources/base/update.rb +43 -0
- data/sub/avm/lib/avm/sources/base/update_sub.rb +57 -0
- data/sub/avm/lib/avm/sources/base/version_bump.rb +29 -0
- data/sub/avm/lib/avm/sources/base.rb +1 -1
- data/sub/avm/lib/avm/version.rb +1 -1
- data/sub/avm-eac_generic_base0/avm-eac_generic_base0.gemspec +1 -1
- data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/base.rb +1 -5
- data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/version.rb +1 -1
- data/sub/avm-eac_ruby_base1/avm-eac_ruby_base1.gemspec +2 -2
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/update.rb +22 -0
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base/version_bump.rb +0 -4
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/base.rb +0 -5
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update_dependency_requirements.rb +1 -3
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/version.rb +1 -1
- data/sub/avm-eac_ruby_base1/locale/en.yml +3 -4
- data/sub/avm-eac_ruby_base1/locale/pt-BR.yml +3 -4
- data/sub/avm-git/avm-git.gemspec +3 -3
- data/sub/avm-git/lib/avm/git/scms/git/change_tracker.rb +2 -2
- data/sub/avm-git/lib/avm/git/scms/git/commits.rb +13 -9
- data/sub/avm-git/lib/avm/git/scms/git_sub_base.rb +17 -0
- data/sub/avm-git/lib/avm/git/scms/git_subrepo.rb +2 -5
- data/sub/avm-git/lib/avm/git/scms/git_subtree.rb +26 -0
- data/sub/avm-git/lib/avm/git/scms/provider.rb +3 -1
- data/sub/avm-git/lib/avm/git/version.rb +1 -1
- data/sub/avm-git/locale/en.yml +6 -0
- data/sub/avm-git/locale/pt-BR.yml +6 -0
- data/sub/avm-tools/avm-tools.gemspec +4 -4
- data/sub/avm-tools/lib/avm/tools/runner/source/auto_commit.rb +2 -2
- data/sub/avm-tools/lib/avm/tools/runner/source/subs.rb +2 -1
- data/sub/avm-tools/lib/avm/tools/version.rb +1 -1
- data/sub/avm-tools/spec/lib/avm/tools/runner/source/issue/complete_spec.rb +1 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/patches/pathname/child_of.rb +16 -0
- data/sub/eac_ruby_utils/lib/eac_ruby_utils/version.rb +1 -1
- data/sub/eac_ruby_utils/spec/lib/eac_ruby_utils/patches/pathname/child_of_spec.rb +26 -0
- metadata +26 -26
- data/sub/avm-eac_generic_base0/lib/avm/eac_generic_base0/sources/base/version_bump.rb +0 -35
- data/sub/avm-eac_ruby_base1/lib/avm/eac_ruby_base1/sources/update.rb +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae856818c701f2192ec09610cac0d471e150e435c7700028e93f2b3e511e49f5
|
4
|
+
data.tar.gz: 9214f069183c0b48d954c883e3a1f2e0f59d7a3227c1089b4315c70464a9028f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0b1c879ce8f91b853f1677f217c2e4c89f63a63de8a3525e9ce422a47a819a94cd83aee66d4edbc8d8a8ada4b7f153098eb2f365bd4a5e3e304d6bc7c4a1f45
|
7
|
+
data.tar.gz: 4b8ec43cea4942df3538d83fa40627d53e668066d6961d4b3bf1a26c2f2a0922890b3d846f56e501d64c0fb81e1e11e727b6f347a613886d442c52fcedd399c8
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
eac_tools (0.
|
5
|
-
avm (~> 0.
|
4
|
+
eac_tools (0.55.0)
|
5
|
+
avm (~> 0.62)
|
6
6
|
avm-eac_asciidoctor_base0 (~> 0.15)
|
7
|
-
avm-eac_generic_base0 (~> 0.
|
7
|
+
avm-eac_generic_base0 (~> 0.10)
|
8
8
|
avm-eac_latex_base0 (~> 0.3)
|
9
9
|
avm-eac_php_base0 (~> 0.4, >= 0.4.1)
|
10
10
|
avm-eac_postgresql_base0 (~> 0.2, >= 0.2.3)
|
@@ -13,11 +13,11 @@ 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.
|
16
|
+
avm-eac_ruby_base1 (~> 0.29)
|
17
17
|
avm-eac_webapp_base0 (~> 0.13, >= 0.13.1)
|
18
18
|
avm-eac_wordpress_base0 (~> 0.3)
|
19
|
-
avm-tools (~> 0.
|
20
|
-
eac_ruby_utils (~> 0.
|
19
|
+
avm-tools (~> 0.145)
|
20
|
+
eac_ruby_utils (~> 0.111)
|
21
21
|
|
22
22
|
PATH
|
23
23
|
remote: sub/aranha-parsers
|
@@ -45,8 +45,8 @@ PATH
|
|
45
45
|
PATH
|
46
46
|
remote: sub/avm-eac_generic_base0
|
47
47
|
specs:
|
48
|
-
avm-eac_generic_base0 (0.
|
49
|
-
avm (~> 0.
|
48
|
+
avm-eac_generic_base0 (0.10.0)
|
49
|
+
avm (~> 0.61)
|
50
50
|
eac_ruby_utils (~> 0.110, >= 0.110.1)
|
51
51
|
|
52
52
|
PATH
|
@@ -118,9 +118,9 @@ PATH
|
|
118
118
|
PATH
|
119
119
|
remote: sub/avm-eac_ruby_base1
|
120
120
|
specs:
|
121
|
-
avm-eac_ruby_base1 (0.
|
122
|
-
avm (~> 0.
|
123
|
-
avm-eac_generic_base0 (~> 0.
|
121
|
+
avm-eac_ruby_base1 (0.29.0)
|
122
|
+
avm (~> 0.61)
|
123
|
+
avm-eac_generic_base0 (~> 0.10)
|
124
124
|
eac_ruby_utils (~> 0.110, >= 0.110.1)
|
125
125
|
|
126
126
|
PATH
|
@@ -163,42 +163,42 @@ PATH
|
|
163
163
|
PATH
|
164
164
|
remote: sub/avm-git
|
165
165
|
specs:
|
166
|
-
avm-git (0.
|
167
|
-
avm (~> 0.
|
166
|
+
avm-git (0.12.0)
|
167
|
+
avm (~> 0.61)
|
168
168
|
avm-files (~> 0.6)
|
169
169
|
eac_git (~> 0.14)
|
170
170
|
eac_ruby_utils (~> 0.110, >= 0.110.1)
|
171
|
-
git (~> 1.13)
|
171
|
+
git (~> 1.13, >= 1.13.1)
|
172
172
|
|
173
173
|
PATH
|
174
174
|
remote: sub/avm-tools
|
175
175
|
specs:
|
176
|
-
avm-tools (0.
|
176
|
+
avm-tools (0.145.0)
|
177
177
|
aranha-parsers (~> 0.14, >= 0.14.4)
|
178
|
-
avm (~> 0.
|
179
|
-
avm-eac_ruby_base1 (~> 0.
|
178
|
+
avm (~> 0.62)
|
179
|
+
avm-eac_ruby_base1 (~> 0.29)
|
180
180
|
avm-eac_ubuntu_base0 (~> 0.4)
|
181
181
|
avm-files (~> 0.6)
|
182
|
-
avm-git (~> 0.
|
182
|
+
avm-git (~> 0.12)
|
183
183
|
clipboard (~> 1.3, >= 1.3.6)
|
184
184
|
curb (~> 0.9, >= 0.9.11)
|
185
185
|
eac_git (~> 0.14)
|
186
186
|
eac_ruby_base0 (~> 0.17, >= 0.17.1)
|
187
187
|
eac_templates (~> 0.3, >= 0.3.2)
|
188
|
-
git (~> 1.13)
|
188
|
+
git (~> 1.13, >= 1.13.1)
|
189
189
|
ruby-progressbar (~> 1.11)
|
190
190
|
|
191
191
|
PATH
|
192
192
|
remote: sub/avm
|
193
193
|
specs:
|
194
|
-
avm (0.
|
194
|
+
avm (0.62.0)
|
195
195
|
aranha-parsers (~> 0.14, >= 0.14.4)
|
196
196
|
eac_cli (~> 0.30)
|
197
197
|
eac_config (~> 0.12)
|
198
198
|
eac_docker (~> 0.5)
|
199
199
|
eac_fs (~> 0.16)
|
200
200
|
eac_git (~> 0.14)
|
201
|
-
eac_ruby_utils (~> 0.
|
201
|
+
eac_ruby_utils (~> 0.111)
|
202
202
|
eac_templates (~> 0.3, >= 0.3.2)
|
203
203
|
filesize (~> 0.2)
|
204
204
|
htmlbeautifier (~> 1.4, >= 1.4.2)
|
@@ -253,7 +253,7 @@ PATH
|
|
253
253
|
PATH
|
254
254
|
remote: sub/eac_ruby_utils
|
255
255
|
specs:
|
256
|
-
eac_ruby_utils (0.
|
256
|
+
eac_ruby_utils (0.111.0)
|
257
257
|
activesupport (>= 4, < 7)
|
258
258
|
addressable (~> 2.8, >= 2.8.1)
|
259
259
|
bundler
|
@@ -263,7 +263,7 @@ PATH
|
|
263
263
|
GEM
|
264
264
|
remote: https://rubygems.org/
|
265
265
|
specs:
|
266
|
-
activesupport (6.1.7)
|
266
|
+
activesupport (6.1.7.1)
|
267
267
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
268
268
|
i18n (>= 1.6, < 2)
|
269
269
|
minitest (>= 5.1)
|
@@ -291,7 +291,7 @@ GEM
|
|
291
291
|
eac_templates (0.3.2)
|
292
292
|
eac_config (~> 0.11, >= 0.11.1)
|
293
293
|
eac_ruby_utils (~> 0.102, >= 0.102.1)
|
294
|
-
faraday (1.10.
|
294
|
+
faraday (1.10.3)
|
295
295
|
faraday-em_http (~> 1.0)
|
296
296
|
faraday-em_synchrony (~> 1.0)
|
297
297
|
faraday-excon (~> 1.1)
|
@@ -320,7 +320,7 @@ GEM
|
|
320
320
|
faraday_middleware (1.2.0)
|
321
321
|
faraday (~> 1.0)
|
322
322
|
filesize (0.2.0)
|
323
|
-
git (1.13.
|
323
|
+
git (1.13.1)
|
324
324
|
addressable (~> 2.8)
|
325
325
|
rchardet (~> 1.8)
|
326
326
|
hpricot (0.8.6)
|
@@ -332,7 +332,7 @@ GEM
|
|
332
332
|
minitest (5.17.0)
|
333
333
|
multipart-post (2.2.3)
|
334
334
|
net-ssh (4.2.0)
|
335
|
-
nokogiri (1.
|
335
|
+
nokogiri (1.14.0-x86_64-linux)
|
336
336
|
racc (~> 1.4)
|
337
337
|
ofx-parser (1.1.0)
|
338
338
|
hpricot (>= 0.6)
|
@@ -344,7 +344,7 @@ GEM
|
|
344
344
|
parslet (2.0.0)
|
345
345
|
public_suffix (5.0.1)
|
346
346
|
racc (1.6.2)
|
347
|
-
rack (3.0.
|
347
|
+
rack (3.0.4.1)
|
348
348
|
rainbow (3.1.1)
|
349
349
|
rchardet (1.8.0)
|
350
350
|
rexml (3.2.5)
|
@@ -358,7 +358,7 @@ GEM
|
|
358
358
|
rspec-expectations (3.12.2)
|
359
359
|
diff-lcs (>= 1.2.0, < 2.0)
|
360
360
|
rspec-support (~> 3.12.0)
|
361
|
-
rspec-mocks (3.12.
|
361
|
+
rspec-mocks (3.12.3)
|
362
362
|
diff-lcs (>= 1.2.0, < 2.0)
|
363
363
|
rspec-support (~> 3.12.0)
|
364
364
|
rspec-support (3.12.0)
|
data/lib/eac_tools/version.rb
CHANGED
data/sub/avm/avm.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.add_dependency 'eac_docker', '~> 0.5'
|
19
19
|
s.add_dependency 'eac_fs', '~> 0.16'
|
20
20
|
s.add_dependency 'eac_git', '~> 0.14'
|
21
|
-
s.add_dependency 'eac_ruby_utils', '~> 0.
|
21
|
+
s.add_dependency 'eac_ruby_utils', '~> 0.111'
|
22
22
|
s.add_dependency 'eac_templates', '~> 0.3', '>= 0.3.2'
|
23
23
|
s.add_dependency 'filesize', '~> 0.2'
|
24
24
|
s.add_dependency 'htmlbeautifier', '~> 1.4', '>= 1.4.2'
|
@@ -16,6 +16,13 @@ module Avm
|
|
16
16
|
raise_abstract_method __method__
|
17
17
|
end
|
18
18
|
|
19
|
+
# @param commit_to_reset [Avm::Scms::Commit]
|
20
|
+
# @param commit_info [Avm::Scms::CommitInfo]
|
21
|
+
# @return [Avm::Scms::Commit]
|
22
|
+
def reset_and_commit(_commit_to_reset, _commit_info)
|
23
|
+
raise_abstract_method __method__
|
24
|
+
end
|
25
|
+
|
19
26
|
# @param commit_info [Avm::Scms::CommitInfo]
|
20
27
|
# @return [Avm::Scms::Commit]
|
21
28
|
def run_commit(_commit_info)
|
@@ -5,6 +5,19 @@ require 'eac_ruby_utils/core_ext'
|
|
5
5
|
module Avm
|
6
6
|
module Scms
|
7
7
|
class CommitInfo
|
8
|
+
class << self
|
9
|
+
# @param source [Avm::Scms::CommitInfo, String]
|
10
|
+
# @return [Avm::Scms::CommitInfo]
|
11
|
+
def assert(source)
|
12
|
+
return source if source.is_a?(self)
|
13
|
+
return new if source.nil?
|
14
|
+
return new.message(source) if source.is_a?(::String)
|
15
|
+
return assert(source.call) if source.is_a?(::Proc)
|
16
|
+
|
17
|
+
raise "Unmapped assertion for #{source.to_debug}"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
8
21
|
enable_immutable
|
9
22
|
|
10
23
|
immutable_accessor :fixup, :message
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/scms/base'
|
4
|
+
require 'avm/scms/commit'
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
6
|
+
|
7
|
+
module Avm
|
8
|
+
module Scms
|
9
|
+
class Null < ::Avm::Scms::Base
|
10
|
+
class Commit < ::Avm::Scms::Commit
|
11
|
+
common_constructor :scm
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -6,6 +6,13 @@ require 'eac_ruby_utils/core_ext'
|
|
6
6
|
module Avm
|
7
7
|
module Scms
|
8
8
|
class Null < ::Avm::Scms::Base
|
9
|
+
require_sub __FILE__
|
10
|
+
|
11
|
+
# @return [Avm::Scms::Null::Commit]
|
12
|
+
def head_commit
|
13
|
+
@head_commit ||= Avm::Scms::Null::Commit.new(self)
|
14
|
+
end
|
15
|
+
|
9
16
|
def update
|
10
17
|
# Do nothing
|
11
18
|
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Sources
|
7
|
+
module AutoCommit
|
8
|
+
class ForFile
|
9
|
+
common_constructor :source, :path, :rules
|
10
|
+
|
11
|
+
delegate :run, to: :scm_auto_commit
|
12
|
+
|
13
|
+
# @return [Pathname]
|
14
|
+
def path_for_auto_commit
|
15
|
+
path.relative_path_from(source_for_auto_commit.path)
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [Avm::Scms::AutoCommit::ForFile]
|
19
|
+
def scm_auto_commit
|
20
|
+
::Avm::Scms::AutoCommit::ForFile.new(source_for_auto_commit.scm, path_for_auto_commit,
|
21
|
+
rules)
|
22
|
+
end
|
23
|
+
|
24
|
+
# @return [Avm::Sources::Base]
|
25
|
+
def source_for_auto_commit
|
26
|
+
source.sub_for_path(path) || source
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -22,6 +22,13 @@ module Avm
|
|
22
22
|
configuration.entry(*entry_args)
|
23
23
|
end
|
24
24
|
|
25
|
+
# The possible absolute paths for configuration files.
|
26
|
+
#
|
27
|
+
# @return [Array<Pathname>]
|
28
|
+
def configuration_paths
|
29
|
+
CONFIGURATION_FILENAMES.map { |filename| path.join(filename) }
|
30
|
+
end
|
31
|
+
|
25
32
|
# @return [EacRubyUtils::Envs::Command, nil]
|
26
33
|
def configuration_value_to_env_command(value)
|
27
34
|
return value if value.is_a?(::EacRubyUtils::Envs::Command)
|
@@ -51,10 +58,10 @@ module Avm
|
|
51
58
|
|
52
59
|
# @return [EacConfig::YamlFileNode]
|
53
60
|
def configuration_uncached
|
54
|
-
|
55
|
-
configuration_with_filename(
|
61
|
+
configuration_paths.each do |config_path|
|
62
|
+
configuration_with_filename(config_path, true)
|
56
63
|
end
|
57
|
-
configuration_with_filename(
|
64
|
+
configuration_with_filename(configuration_paths.first, false)
|
58
65
|
end
|
59
66
|
|
60
67
|
# @return [String]
|
@@ -68,9 +75,8 @@ module Avm
|
|
68
75
|
end
|
69
76
|
|
70
77
|
# @return [EacConfig::YamlFileNode, nil]
|
71
|
-
def configuration_with_filename(
|
72
|
-
|
73
|
-
return ::EacConfig::YamlFileNode.new(file_path) if !needs_exist || file_path.exist?
|
78
|
+
def configuration_with_filename(config_path, needs_exist)
|
79
|
+
return ::EacConfig::YamlFileNode.new(config_path) if !needs_exist || config_path.exist?
|
74
80
|
|
75
81
|
nil
|
76
82
|
end
|
@@ -20,6 +20,13 @@ module Avm
|
|
20
20
|
def default_locale
|
21
21
|
::I18n.default_locale
|
22
22
|
end
|
23
|
+
|
24
|
+
# @param entry_suffix [String]
|
25
|
+
# @param values [Hash]
|
26
|
+
# @return [String]
|
27
|
+
def i18n_translate(entry_suffix, values = {})
|
28
|
+
self.class.i18n_translate(entry_suffix, values.merge(__locale: locale))
|
29
|
+
end
|
23
30
|
end
|
24
31
|
end
|
25
32
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Sources
|
7
|
+
class Base
|
8
|
+
module Organizational
|
9
|
+
DEFAULT_ORGANIZATIONAL = false
|
10
|
+
ORGANIZATIONAL_KEY = 'organizational'
|
11
|
+
|
12
|
+
# @return [Boolean]
|
13
|
+
def organizational?
|
14
|
+
if organizational_entry.found?
|
15
|
+
organizational_entry.value.to_bool
|
16
|
+
else
|
17
|
+
default_organizational
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
def organizational_entry
|
22
|
+
configuration.entry(ORGANIZATIONAL_KEY)
|
23
|
+
end
|
24
|
+
|
25
|
+
# @return [Boolean]
|
26
|
+
def default_organizational
|
27
|
+
DEFAULT_ORGANIZATIONAL
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -12,6 +12,11 @@ module Avm
|
|
12
12
|
SUBS_EXCLUDE_PATHS_DEFAULT = [].freeze
|
13
13
|
SUBS_INCLUDE_PATHS_DEFAULT = ['sub/*'].freeze
|
14
14
|
|
15
|
+
# @return [Avm::Sources::Base, nil]
|
16
|
+
def sub_for_path(path)
|
17
|
+
subs.lazy.map { |sub| path.expand_path.child_of?(sub.path) ? sub : nil }.find(&:present?)
|
18
|
+
end
|
19
|
+
|
15
20
|
# @return [Enumerable<Avm::Sources::Base>]
|
16
21
|
def subs
|
17
22
|
subs_paths_to_search
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Sources
|
7
|
+
class Base
|
8
|
+
module Update
|
9
|
+
# To override in subclasses.
|
10
|
+
def on_sub_updated
|
11
|
+
# Do nothing
|
12
|
+
end
|
13
|
+
|
14
|
+
def update
|
15
|
+
update_self
|
16
|
+
update_subs
|
17
|
+
end
|
18
|
+
|
19
|
+
def update_self
|
20
|
+
scm.commit_if_change(-> { update_self_commit_message }) do
|
21
|
+
update_self_content
|
22
|
+
parent.if_present(&:on_sub_updated)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# Update source self content.
|
27
|
+
#
|
28
|
+
# To override in subclasses.
|
29
|
+
def update_self_content
|
30
|
+
# Do nothing
|
31
|
+
end
|
32
|
+
|
33
|
+
def update_self_commit_message
|
34
|
+
i18n_translate(__method__)
|
35
|
+
end
|
36
|
+
|
37
|
+
def update_subs
|
38
|
+
subs.each { |sub| update_sub(sub) }
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'eac_ruby_utils/core_ext'
|
4
|
+
|
5
|
+
module Avm
|
6
|
+
module Sources
|
7
|
+
class Base
|
8
|
+
class UpdateSub
|
9
|
+
enable_method_class
|
10
|
+
|
11
|
+
common_constructor :source, :sub
|
12
|
+
|
13
|
+
def result
|
14
|
+
update_version
|
15
|
+
return unless sub.organizational?
|
16
|
+
|
17
|
+
sub.update
|
18
|
+
end
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def update_version
|
23
|
+
base_commit = source.scm.head_commit
|
24
|
+
sub.scm.update
|
25
|
+
on_update_version_commit_change(base_commit) unless base_commit == source.scm.head_commit
|
26
|
+
end
|
27
|
+
|
28
|
+
def on_update_version_commit_change(base_commit)
|
29
|
+
source.on_sub_updated if no_scm_updated?
|
30
|
+
source.scm.reset_and_commit(base_commit, update_version_commit_info)
|
31
|
+
end
|
32
|
+
|
33
|
+
def no_scm_updated?
|
34
|
+
source.scm.head_commit.no_scm_changed_files.any?
|
35
|
+
end
|
36
|
+
|
37
|
+
# @param commit_info [Avm::Scms::CommitInfo]
|
38
|
+
def update_version_commit_info
|
39
|
+
Avm::Scms::CommitInfo.new.message(
|
40
|
+
no_scm_updated? ? update_version_no_scm_message : update_version_scm_message
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
# @return [String]
|
45
|
+
def update_version_no_scm_message
|
46
|
+
source.i18n_translate(__method__, application_id: sub.application_id,
|
47
|
+
path: sub.relative_path, version: sub.version)
|
48
|
+
end
|
49
|
+
|
50
|
+
# @return [String]
|
51
|
+
def update_version_scm_message
|
52
|
+
sub.scm.i18n_translate(__method__)
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/sources/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module Sources
|
8
|
+
class Base
|
9
|
+
module VersionBump
|
10
|
+
# @return [Avm::Scms::Commit, nil]
|
11
|
+
def version_bump(target_version)
|
12
|
+
scm.commit_if_change(version_bump_commit_message(target_version)) do
|
13
|
+
version_bump_do_changes(target_version)
|
14
|
+
parent.if_present(&:on_sub_updated)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [String]
|
19
|
+
def version_bump_commit_message(target_version)
|
20
|
+
i18n_translate(__method__, version: target_version, __locale: locale)
|
21
|
+
end
|
22
|
+
|
23
|
+
def version_bump_do_changes(_target_version)
|
24
|
+
raise_abstract_method(__METHOD__)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/sub/avm/lib/avm/version.rb
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib,locale}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'avm', '~> 0.
|
15
|
+
s.add_dependency 'avm', '~> 0.61'
|
16
16
|
s.add_dependency 'eac_ruby_utils', '~> 0.110', '>= 0.110.1'
|
17
17
|
|
18
18
|
s.add_development_dependency 'eac_ruby_gem_support', '~> 0.5.1'
|
@@ -10,12 +10,8 @@ module Avm
|
|
10
10
|
require_sub __FILE__, include_modules: true
|
11
11
|
enable_abstract_methods
|
12
12
|
|
13
|
-
def update
|
14
|
-
# Do nothing
|
15
|
-
end
|
16
|
-
|
17
13
|
def valid?
|
18
|
-
|
14
|
+
configuration_paths.any?(&:exist?)
|
19
15
|
end
|
20
16
|
end
|
21
17
|
end
|
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
|
|
12
12
|
|
13
13
|
s.files = Dir['{lib,locale,template}/**/*']
|
14
14
|
|
15
|
-
s.add_dependency 'avm', '~> 0.
|
16
|
-
s.add_dependency 'avm-eac_generic_base0', '~> 0.
|
15
|
+
s.add_dependency 'avm', '~> 0.61'
|
16
|
+
s.add_dependency 'avm-eac_generic_base0', '~> 0.10'
|
17
17
|
s.add_dependency 'eac_ruby_utils', '~> 0.110', '>= 0.110.1'
|
18
18
|
|
19
19
|
s.add_development_dependency 'aranha-parsers', '~> 0.14', '>= 0.14.1'
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'avm/eac_generic_base0/sources/base'
|
4
|
+
require 'eac_ruby_utils/core_ext'
|
5
|
+
|
6
|
+
module Avm
|
7
|
+
module EacRubyBase1
|
8
|
+
module Sources
|
9
|
+
class Base < ::Avm::EacGenericBase0::Sources::Base
|
10
|
+
module Update
|
11
|
+
def on_sub_updated
|
12
|
+
update_self_content
|
13
|
+
end
|
14
|
+
|
15
|
+
def update_self_content
|
16
|
+
bundle_update.execute!
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -8,10 +8,6 @@ module Avm
|
|
8
8
|
module Sources
|
9
9
|
class Base < ::Avm::EacGenericBase0::Sources::Base
|
10
10
|
module VersionBump
|
11
|
-
def after_sub_version_bump_do_changes
|
12
|
-
bundle('install').chdir_root.execute!
|
13
|
-
end
|
14
|
-
|
15
11
|
def version_bump_do_changes(target_version)
|
16
12
|
self.version = target_version
|
17
13
|
bundle('install').chdir_root.execute!
|
@@ -3,7 +3,6 @@
|
|
3
3
|
require 'avm/eac_generic_base0/sources/base'
|
4
4
|
require 'avm/eac_ruby_base1/rubygems/version_file'
|
5
5
|
require 'avm/eac_ruby_base1/sources/runners'
|
6
|
-
require 'avm/eac_ruby_base1/sources/update'
|
7
6
|
require 'avm/version_number'
|
8
7
|
require 'eac_ruby_utils/core_ext'
|
9
8
|
|
@@ -57,10 +56,6 @@ module Avm
|
|
57
56
|
gemfile_path.exist? || gemspec_path.present?
|
58
57
|
end
|
59
58
|
|
60
|
-
def update
|
61
|
-
::Avm::EacRubyBase1::Sources::Update.new(self)
|
62
|
-
end
|
63
|
-
|
64
59
|
# @return [Avm::VersionNumber]
|
65
60
|
def version
|
66
61
|
version_file.value.if_present { |v| ::Avm::VersionNumber.new(v) }
|