avm-git 0.13.2 → 0.13.4
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/lib/avm/git/commit/diff_tree_line.rb +1 -1
- data/lib/avm/git/launcher/base/underlying.rb +3 -5
- data/lib/avm/git/scms/git/commit_dirty.rb +36 -0
- data/lib/avm/git/scms/git/commits.rb +0 -14
- data/lib/avm/git/scms/git/run_commit.rb +1 -1
- data/lib/avm/git/scms/git_sub_base/changed_file.rb +21 -0
- data/lib/avm/git/scms/git_sub_base/commit.rb +1 -3
- data/lib/avm/git/scms/git_sub_base.rb +8 -1
- data/lib/avm/git/version.rb +1 -1
- metadata +17 -15
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 97b90e458de2c4249f60e964c1d95564bd46dbe0f4fd754ce591f475ba13313f
|
|
4
|
+
data.tar.gz: 03bc99cf2b5863dc919a8d06f92711959c8f3fd8b4ae360500528a5b82f74a9a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: afb7e4062254feab12e955691537fabe63c5a31318aa4965a31b807c40636ade3835dd90649bff89b830eb79d666d73680e0b74501910b1d7f58f9c5eed009c7
|
|
7
|
+
data.tar.gz: aba1de78c58adcfee8009bf3a02f2ac7e87ff97a0313643745dd393416d76559ba02197ebab4e345244758d6e8de80f2f726957360f58b3edab5608c8a4b7129
|
|
@@ -21,11 +21,9 @@ module Avm
|
|
|
21
21
|
|
|
22
22
|
%w[execute execute! system system!].each do |exec_type|
|
|
23
23
|
define_method exec_type do |*args|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
raise ::Avm::Git::Launcher::Error
|
|
28
|
-
end
|
|
24
|
+
command(*args).send(exec_type)
|
|
25
|
+
rescue ::EacRubyUtils::Envs::ExecutionError
|
|
26
|
+
raise ::Avm::Git::Launcher::Error
|
|
29
27
|
end
|
|
30
28
|
end
|
|
31
29
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'avm/scms/commit_info'
|
|
4
|
+
require 'avm/git/scms/git/changed_file'
|
|
5
|
+
require 'eac_ruby_utils/core_ext'
|
|
6
|
+
|
|
7
|
+
module Avm
|
|
8
|
+
module Git
|
|
9
|
+
module Scms
|
|
10
|
+
class Git < ::Avm::Scms::Base
|
|
11
|
+
class CommitDirty
|
|
12
|
+
enable_method_class
|
|
13
|
+
# @param commit_info [Avm::Scms::CommitInfo, nil]
|
|
14
|
+
common_constructor :scm, :commit_info, default: [nil]
|
|
15
|
+
delegate :git_repo, :head_commit, :run_commit, to: :scm
|
|
16
|
+
|
|
17
|
+
# @return [Avm::Git::Scms::Git::Commit,nil]
|
|
18
|
+
def result
|
|
19
|
+
return nil unless git_repo.dirty?
|
|
20
|
+
|
|
21
|
+
run_commit(asserted_commit_info)
|
|
22
|
+
head_commit
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
private
|
|
26
|
+
|
|
27
|
+
def asserted_commit_info
|
|
28
|
+
r = ::Avm::Scms::CommitInfo.assert(commit_info)
|
|
29
|
+
r = r.message(COMMIT_DIRTY_DEFAULT_MESSAGE) if r.message.blank?
|
|
30
|
+
git_repo.dirty_files.inject(r) { |a, e| a.path(e.absolute_path) }
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
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)
|
|
@@ -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
|
|
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 :
|
|
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]
|
data/lib/avm/git/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: avm-git
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.13.
|
|
4
|
+
version: 0.13.4
|
|
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
|
|
11
|
+
date: 2023-09-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: avm
|
|
@@ -16,20 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '0.
|
|
20
|
-
- - ">="
|
|
21
|
-
- !ruby/object:Gem::Version
|
|
22
|
-
version: 0.67.1
|
|
19
|
+
version: '0.79'
|
|
23
20
|
type: :runtime
|
|
24
21
|
prerelease: false
|
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
26
23
|
requirements:
|
|
27
24
|
- - "~>"
|
|
28
25
|
- !ruby/object:Gem::Version
|
|
29
|
-
version: '0.
|
|
30
|
-
- - ">="
|
|
31
|
-
- !ruby/object:Gem::Version
|
|
32
|
-
version: 0.67.1
|
|
26
|
+
version: '0.79'
|
|
33
27
|
- !ruby/object:Gem::Dependency
|
|
34
28
|
name: avm-files
|
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -76,14 +70,20 @@ dependencies:
|
|
|
76
70
|
requirements:
|
|
77
71
|
- - "~>"
|
|
78
72
|
- !ruby/object:Gem::Version
|
|
79
|
-
version: '0.
|
|
73
|
+
version: '0.119'
|
|
74
|
+
- - ">="
|
|
75
|
+
- !ruby/object:Gem::Version
|
|
76
|
+
version: 0.119.1
|
|
80
77
|
type: :runtime
|
|
81
78
|
prerelease: false
|
|
82
79
|
version_requirements: !ruby/object:Gem::Requirement
|
|
83
80
|
requirements:
|
|
84
81
|
- - "~>"
|
|
85
82
|
- !ruby/object:Gem::Version
|
|
86
|
-
version: '0.
|
|
83
|
+
version: '0.119'
|
|
84
|
+
- - ">="
|
|
85
|
+
- !ruby/object:Gem::Version
|
|
86
|
+
version: 0.119.1
|
|
87
87
|
- !ruby/object:Gem::Dependency
|
|
88
88
|
name: git
|
|
89
89
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -124,14 +124,14 @@ dependencies:
|
|
|
124
124
|
requirements:
|
|
125
125
|
- - "~>"
|
|
126
126
|
- !ruby/object:Gem::Version
|
|
127
|
-
version:
|
|
127
|
+
version: 0.7.0
|
|
128
128
|
type: :development
|
|
129
129
|
prerelease: false
|
|
130
130
|
version_requirements: !ruby/object:Gem::Requirement
|
|
131
131
|
requirements:
|
|
132
132
|
- - "~>"
|
|
133
133
|
- !ruby/object:Gem::Version
|
|
134
|
-
version:
|
|
134
|
+
version: 0.7.0
|
|
135
135
|
description:
|
|
136
136
|
email:
|
|
137
137
|
executables: []
|
|
@@ -194,11 +194,13 @@ files:
|
|
|
194
194
|
- lib/avm/git/scms/git/commit.rb
|
|
195
195
|
- lib/avm/git/scms/git/commit/deploy.rb
|
|
196
196
|
- lib/avm/git/scms/git/commit/deploy_methods.rb
|
|
197
|
+
- lib/avm/git/scms/git/commit_dirty.rb
|
|
197
198
|
- lib/avm/git/scms/git/commits.rb
|
|
198
199
|
- lib/avm/git/scms/git/interval.rb
|
|
199
200
|
- lib/avm/git/scms/git/milestones.rb
|
|
200
201
|
- lib/avm/git/scms/git/run_commit.rb
|
|
201
202
|
- lib/avm/git/scms/git_sub_base.rb
|
|
203
|
+
- lib/avm/git/scms/git_sub_base/changed_file.rb
|
|
202
204
|
- lib/avm/git/scms/git_sub_base/commit.rb
|
|
203
205
|
- lib/avm/git/scms/git_sub_base/interval.rb
|
|
204
206
|
- lib/avm/git/scms/git_subrepo.rb
|
|
@@ -225,7 +227,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
225
227
|
requirements:
|
|
226
228
|
- - ">="
|
|
227
229
|
- !ruby/object:Gem::Version
|
|
228
|
-
version: '
|
|
230
|
+
version: '2.7'
|
|
229
231
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
232
|
requirements:
|
|
231
233
|
- - ">="
|