eac_tools 0.67.0 → 0.67.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4eaf414401edd6cd32a363aa20ae12bfd3641bfc0c11d8007911f0dfce9738e0
4
- data.tar.gz: 56e6df8b4ac42ed7f10cf7b3121d17cc825ce3c4a8e46018101f2ce71316f654
3
+ metadata.gz: '0650351188a8e6d37ba2f6de9f72aaafea66701164cd576ada4fb32ffaba32cc'
4
+ data.tar.gz: 748edc307ad72537a3bbfa167e537fcf9747f44b1ed49b71e58e24fa470de65b
5
5
  SHA512:
6
- metadata.gz: c24f42e05720c894b99c1757654fe045ce0f306f2e2f4c5ef4fdc9477f048aa227e5d4e58c6a1d97ff90ebeede013c331152fbfa354def48591cb6b213a47ab0
7
- data.tar.gz: fd0260cb92aee69652efbab55ef85f73ab6b442966d8aeaf0a09b522db6a6dd59dd5a39c6490255878f24c801c1f9557888017c75b6ec66bc2f4ee9f045f41c2
6
+ metadata.gz: e08048e32da53d1cb6a81053e9412661102a9d1fdb2e2f9370a6a783b4a0e09b3edfa0cb96a79b452578bfed7ab443ee61f89208b786a600ec3679be0247e224
7
+ data.tar.gz: f5e0fa874e7a5c6992a0f7a0fac38ed3c85a0b2005857eaabf22ec3faab481d3852e8f971d5b0415c474a1ca704878f62341366f4bcf15bcc0820f0891bed9b4
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- eac_tools (0.67.0)
5
- avm (~> 0.73)
4
+ eac_tools (0.67.1)
5
+ avm (~> 0.73, >= 0.73.1)
6
6
  avm-eac_asciidoctor_base0 (~> 0.19)
7
7
  avm-eac_generic_base0 (~> 0.12)
8
8
  avm-eac_latex_base0 (~> 0.3, >= 0.3.1)
@@ -16,7 +16,7 @@ PATH
16
16
  avm-eac_ruby_base1 (~> 0.30, >= 0.30.3)
17
17
  avm-eac_webapp_base0 (~> 0.17, >= 0.17.2)
18
18
  avm-eac_wordpress_base0 (~> 0.3, >= 0.3.1)
19
- avm-git (~> 0.13, >= 0.13.2)
19
+ avm-git (~> 0.13, >= 0.13.3)
20
20
  avm-tools (~> 0.149)
21
21
  eac_ruby_utils (~> 0.117)
22
22
 
@@ -164,11 +164,11 @@ PATH
164
164
  PATH
165
165
  remote: sub/avm-git
166
166
  specs:
167
- avm-git (0.13.2)
168
- avm (~> 0.67, >= 0.67.1)
167
+ avm-git (0.13.3)
168
+ avm (~> 0.73, >= 0.73.1)
169
169
  avm-files (~> 0.6, >= 0.6.2)
170
170
  eac_git (~> 0.14, >= 0.14.1)
171
- eac_ruby_utils (~> 0.112)
171
+ eac_ruby_utils (~> 0.117)
172
172
  git (~> 1.18)
173
173
 
174
174
  PATH
@@ -192,7 +192,7 @@ PATH
192
192
  PATH
193
193
  remote: sub/avm
194
194
  specs:
195
- avm (0.73.0)
195
+ avm (0.73.1)
196
196
  aranha-parsers (~> 0.18)
197
197
  eac_cli (~> 0.35)
198
198
  eac_config (~> 0.12)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EacTools
4
- VERSION = '0.67.0'
4
+ VERSION = '0.67.1'
5
5
  end
@@ -7,15 +7,15 @@ module Avm
7
7
  module Instances
8
8
  class Base
9
9
  class SubcommandParent
10
+ include ::EacCli::Runner
10
11
  enable_simple_cache
11
- common_constructor :instance
12
+ common_constructor :instance do
13
+ self.runner_context = ::EacCli::Runner::Context.new(self, argv: runner_argv)
14
+ end
15
+ for_context :instance
12
16
 
13
17
  private
14
18
 
15
- def runner_context_uncached
16
- ::EacCli::Runner::Context.new(self, argv: runner_argv)
17
- end
18
-
19
19
  def runner_argv
20
20
  [instance.class.name.split('::')[-2].dasherize, instance.id]
21
21
  end
@@ -28,6 +28,11 @@ module Avm
28
28
 
29
29
  private
30
30
 
31
+ # @return [Boolean]
32
+ def changed?
33
+ scm.changed_files.any? { |cf| cf.path == scm_relative_path }
34
+ end
35
+
31
36
  def commit_info_uncached
32
37
  rules.lazy.map { |rule| rule.with_file(self).commit_info }.find(&:present?)
33
38
  .if_present { |v| v.path(path) }
@@ -42,8 +47,13 @@ module Avm
42
47
  return false if commit_info.blank?
43
48
 
44
49
  infov ' Commit info', commit_info
45
- scm.run_commit(commit_info)
46
- success ' Commited'
50
+ if changed?
51
+ scm.run_commit(commit_info)
52
+ success ' Commited'
53
+ else
54
+ warn " File \"#{path}\" unchanged"
55
+ end
56
+
47
57
  true
48
58
  end
49
59
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Avm
4
- VERSION = '0.73.0'
4
+ VERSION = '0.73.1'
5
5
  end
@@ -12,10 +12,10 @@ Gem::Specification.new do |s|
12
12
 
13
13
  s.files = Dir['{lib,locale}/**/*']
14
14
 
15
- s.add_dependency 'avm', '~> 0.67', '>= 0.67.1'
15
+ s.add_dependency 'avm', '~> 0.73', '>= 0.73.1'
16
16
  s.add_dependency 'avm-files', '~> 0.6', '>= 0.6.2'
17
17
  s.add_dependency 'eac_git', '~> 0.14', '>= 0.14.1'
18
- s.add_dependency 'eac_ruby_utils', '~> 0.112'
18
+ s.add_dependency 'eac_ruby_utils', '~> 0.117'
19
19
  s.add_dependency 'git', '~> 1.18'
20
20
 
21
21
  s.add_development_dependency 'aranha-parsers', '~> 0.8', '>= 0.8.5'
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/git/scms/git/changed_file'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Git
8
+ module Scms
9
+ class Git < ::Avm::Scms::Base
10
+ class CommitDirty
11
+ enable_method_class
12
+ # @param commit_info [Avm::Scms::CommitInfo, nil]
13
+ common_constructor :scm, :commit_info, default: [nil]
14
+ delegate :git_repo, :head_commit, :run_commit, to: :scm
15
+
16
+ # @return [Avm::Git::Scms::Git::Commit,nil]
17
+ def result
18
+ return nil unless git_repo.dirty?
19
+
20
+ run_commit(asserted_commit_info)
21
+ head_commit
22
+ end
23
+
24
+ private
25
+
26
+ def asserted_commit_info
27
+ r = ::Avm::Scms::CommitInfo.assert(commit_info)
28
+ r = r.message(COMMIT_DIRTY_DEFAULT_MESSAGE) if r.message.blank?
29
+ git_repo.dirty_files.inject(r) { |a, e| a.path(e.absolute_path) }
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -20,20 +20,6 @@ module Avm
20
20
  end
21
21
  end
22
22
 
23
- # @param commit_info [Avm::Scms::CommitInfo]
24
- # @return [Avm::Git::Scms::Git::Commit,nil]
25
- def commit_dirty(commit_info = nil)
26
- return nil unless git_repo.dirty?
27
-
28
- commit_info = ::Avm::Scms::CommitInfo.assert(commit_info)
29
- commit_info = commit_info.message(COMMIT_DIRTY_DEFAULT_MESSAGE) if
30
- commit_info.message.blank?
31
-
32
- git_repo.command('add', '.').execute!
33
- run_commit(commit_info)
34
- head_commit
35
- end
36
-
37
23
  # @param commit_info [Avm::Scms::CommitInfo]
38
24
  # @return [Avm::Git::Scms::Git::Commit,nil]
39
25
  def commit_if_change(commit_info = nil)
@@ -48,7 +48,7 @@ module Avm
48
48
  end
49
49
 
50
50
  def reset
51
- scm.git_repo.command('reset', '--soft', 'HEAD').execute!
51
+ scm.git_repo.command('reset', 'HEAD').execute!
52
52
  end
53
53
  end
54
54
  end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'avm/scms/changed_file'
4
+ require 'eac_ruby_utils/core_ext'
5
+
6
+ module Avm
7
+ module Git
8
+ module Scms
9
+ class GitSubBase < ::Avm::Scms::Base
10
+ class ChangedFile < ::Avm::Scms::ChangedFile
11
+ common_constructor :scm, :parent_changed_file
12
+
13
+ # @return [Pathname]
14
+ def path
15
+ parent_changed_file.path.relative_path_from(scm.relative_path_from_parent_scm)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
21
+ end
@@ -9,9 +9,7 @@ module Avm
9
9
  module Scms
10
10
  class GitSubBase < ::Avm::Scms::Base
11
11
  class Commit < ::Avm::Scms::Commit
12
- common_constructor :scm, :parent_commit do
13
- # parent_commit.assert_argument(::Avm::Git::Scms::Git::Commit, 'parent_commit')
14
- end
12
+ common_constructor :scm, :parent_commit
15
13
 
16
14
  delegate :deploy_to_env_path, :fixup?, :id, :merge_with, :reword, :scm_file?, :subject,
17
15
  :to_s, to: :parent_commit
@@ -9,9 +9,16 @@ module Avm
9
9
  class GitSubBase < ::Avm::Scms::Base
10
10
  enable_abstract_methods
11
11
 
12
- delegate :changed_files, :commit_if_change, :current_milestone_base_commit,
12
+ delegate :commit_if_change, :current_milestone_base_commit,
13
13
  :head_commit, :reset_and_commit, :run_commit, to: :parent_scm
14
14
 
15
+ # @return [Enumerable<Avm::Git::Scms::GitSubBase::ChangedFile>]
16
+ def changed_files
17
+ parent_scm.changed_files.map do |parent_changed_file|
18
+ ::Avm::Git::Scms::GitSubBase::ChangedFile.new(self, parent_changed_file)
19
+ end
20
+ end
21
+
15
22
  # @param from [Avm::Git::Scms::Git::Commit]
16
23
  # @param to [Avm::Git::Scms::Git::Commit]
17
24
  # @return [Avm::Git::Scms::GitSubBase::Interval]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Avm
4
4
  module Git
5
- VERSION = '0.13.2'
5
+ VERSION = '0.13.3'
6
6
  end
7
7
  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.67.0
4
+ version: 0.67.1
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-05-20 00:00:00.000000000 Z
11
+ date: 2023-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: avm
@@ -17,6 +17,9 @@ dependencies:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.73'
20
+ - - ">="
21
+ - !ruby/object:Gem::Version
22
+ version: 0.73.1
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -24,6 +27,9 @@ dependencies:
24
27
  - - "~>"
25
28
  - !ruby/object:Gem::Version
26
29
  version: '0.73'
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: 0.73.1
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: avm-eac_asciidoctor_base0
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -275,7 +281,7 @@ dependencies:
275
281
  version: '0.13'
276
282
  - - ">="
277
283
  - !ruby/object:Gem::Version
278
- version: 0.13.2
284
+ version: 0.13.3
279
285
  type: :runtime
280
286
  prerelease: false
281
287
  version_requirements: !ruby/object:Gem::Requirement
@@ -285,7 +291,7 @@ dependencies:
285
291
  version: '0.13'
286
292
  - - ">="
287
293
  - !ruby/object:Gem::Version
288
- version: 0.13.2
294
+ version: 0.13.3
289
295
  - !ruby/object:Gem::Dependency
290
296
  name: avm-tools
291
297
  requirement: !ruby/object:Gem::Requirement
@@ -998,11 +1004,13 @@ files:
998
1004
  - sub/avm-git/lib/avm/git/scms/git/commit.rb
999
1005
  - sub/avm-git/lib/avm/git/scms/git/commit/deploy.rb
1000
1006
  - sub/avm-git/lib/avm/git/scms/git/commit/deploy_methods.rb
1007
+ - sub/avm-git/lib/avm/git/scms/git/commit_dirty.rb
1001
1008
  - sub/avm-git/lib/avm/git/scms/git/commits.rb
1002
1009
  - sub/avm-git/lib/avm/git/scms/git/interval.rb
1003
1010
  - sub/avm-git/lib/avm/git/scms/git/milestones.rb
1004
1011
  - sub/avm-git/lib/avm/git/scms/git/run_commit.rb
1005
1012
  - sub/avm-git/lib/avm/git/scms/git_sub_base.rb
1013
+ - sub/avm-git/lib/avm/git/scms/git_sub_base/changed_file.rb
1006
1014
  - sub/avm-git/lib/avm/git/scms/git_sub_base/commit.rb
1007
1015
  - sub/avm-git/lib/avm/git/scms/git_sub_base/interval.rb
1008
1016
  - sub/avm-git/lib/avm/git/scms/git_subrepo.rb