conventional_commits 0.2.6 → 0.2.7
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 +1 -1
- data/Gemfile.lock +22 -22
- data/lib/conventional_commits/version.rb +1 -1
- data/lib/helpers/file_extension.rb +15 -0
- data/lib/hooks/hooks_installer.rb +15 -8
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0e0c30235e345a6224bdff22ec8624f93609069208cecbb8a37423e502fc7e07
|
|
4
|
+
data.tar.gz: 920cd751c076e80e05e35be2c61ccf8019e00ec23be87a1bb3a73d9451fb45e6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 33bbca653a41c902318db519625930deef5f5e87be84f695c81b335dd53040da9b7cce771833be391e7a242b69db4e101dce82640b3f8d4c9217c8ca46374208
|
|
7
|
+
data.tar.gz: 51551e59749b5c9db999ff8eaf9d99012a2aada1551cfff6ac4dc0eaa843f1e19937bd0567e6fa7a3cffb5db659ed2100b054b6c59ab355c666b7acb5088cc33
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
conventional_commits (0.2.
|
|
4
|
+
conventional_commits (0.2.6)
|
|
5
5
|
open3
|
|
6
6
|
thor
|
|
7
7
|
yaml
|
|
@@ -16,39 +16,39 @@ GEM
|
|
|
16
16
|
rspec-expectations (~> 3.4)
|
|
17
17
|
thor (~> 1.0)
|
|
18
18
|
ast (2.4.2)
|
|
19
|
-
bigdecimal (3.1.
|
|
19
|
+
bigdecimal (3.1.7)
|
|
20
20
|
builder (3.2.4)
|
|
21
21
|
contracts (0.17)
|
|
22
|
-
cucumber (9.
|
|
23
|
-
builder (~> 3.2
|
|
24
|
-
cucumber-ci-environment (
|
|
25
|
-
cucumber-core (
|
|
22
|
+
cucumber (9.2.0)
|
|
23
|
+
builder (~> 3.2)
|
|
24
|
+
cucumber-ci-environment (> 9, < 11)
|
|
25
|
+
cucumber-core (> 13, < 14)
|
|
26
26
|
cucumber-cucumber-expressions (~> 17.0)
|
|
27
|
-
cucumber-gherkin (> 24, <
|
|
27
|
+
cucumber-gherkin (> 24, < 28)
|
|
28
28
|
cucumber-html-formatter (> 20.3, < 22)
|
|
29
29
|
cucumber-messages (> 19, < 25)
|
|
30
30
|
diff-lcs (~> 1.5)
|
|
31
|
-
mini_mime (~> 1.1
|
|
32
|
-
multi_test (~> 1.1
|
|
33
|
-
sys-uname (~> 1.2
|
|
34
|
-
cucumber-ci-environment (
|
|
35
|
-
cucumber-core (
|
|
36
|
-
cucumber-gherkin (>=
|
|
31
|
+
mini_mime (~> 1.1)
|
|
32
|
+
multi_test (~> 1.1)
|
|
33
|
+
sys-uname (~> 1.2)
|
|
34
|
+
cucumber-ci-environment (10.0.1)
|
|
35
|
+
cucumber-core (13.0.2)
|
|
36
|
+
cucumber-gherkin (>= 27, < 28)
|
|
37
37
|
cucumber-messages (>= 20, < 23)
|
|
38
|
-
cucumber-tag-expressions (
|
|
39
|
-
cucumber-cucumber-expressions (17.0
|
|
38
|
+
cucumber-tag-expressions (> 5, < 7)
|
|
39
|
+
cucumber-cucumber-expressions (17.1.0)
|
|
40
40
|
bigdecimal
|
|
41
|
-
cucumber-gherkin (
|
|
42
|
-
cucumber-messages (>= 19.1.4, <
|
|
43
|
-
cucumber-html-formatter (21.
|
|
41
|
+
cucumber-gherkin (27.0.0)
|
|
42
|
+
cucumber-messages (>= 19.1.4, < 23)
|
|
43
|
+
cucumber-html-formatter (21.3.1)
|
|
44
44
|
cucumber-messages (> 19, < 25)
|
|
45
45
|
cucumber-messages (22.0.0)
|
|
46
|
-
cucumber-tag-expressions (
|
|
46
|
+
cucumber-tag-expressions (6.1.0)
|
|
47
47
|
diff-lcs (1.5.1)
|
|
48
48
|
docile (1.4.0)
|
|
49
49
|
ffi (1.16.3)
|
|
50
50
|
gem-release (2.2.2)
|
|
51
|
-
json (2.7.
|
|
51
|
+
json (2.7.2)
|
|
52
52
|
language_server-protocol (3.17.0.3)
|
|
53
53
|
mini_mime (1.1.5)
|
|
54
54
|
multi_test (1.1.0)
|
|
@@ -59,7 +59,7 @@ GEM
|
|
|
59
59
|
racc
|
|
60
60
|
racc (1.7.3)
|
|
61
61
|
rainbow (3.1.1)
|
|
62
|
-
rake (13.1
|
|
62
|
+
rake (13.2.1)
|
|
63
63
|
regexp_parser (2.9.0)
|
|
64
64
|
rexml (3.2.6)
|
|
65
65
|
rspec (3.13.0)
|
|
@@ -75,7 +75,7 @@ GEM
|
|
|
75
75
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
76
76
|
rspec-support (~> 3.13.0)
|
|
77
77
|
rspec-support (3.13.1)
|
|
78
|
-
rubocop (1.
|
|
78
|
+
rubocop (1.63.1)
|
|
79
79
|
json (~> 2.3)
|
|
80
80
|
language_server-protocol (>= 3.17.0)
|
|
81
81
|
parallel (~> 1.10)
|
|
@@ -28,6 +28,21 @@ class File
|
|
|
28
28
|
end
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
+
def self.add_to_file_data(path, data)
|
|
32
|
+
File.open(path, "a") do |f|
|
|
33
|
+
f.write(data)
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def self.create_or_add_to_file_data(path, data)
|
|
38
|
+
if exist?(path)
|
|
39
|
+
data = data.empty? ? "" : "\n#{data}"
|
|
40
|
+
add_to_file_data(path, data)
|
|
41
|
+
else
|
|
42
|
+
create_new_file_with_data(path, data)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
31
46
|
def self.read_file(path)
|
|
32
47
|
File.open(path, "r") do |f|
|
|
33
48
|
data = f.read.to_s
|
|
@@ -9,19 +9,17 @@ module ConventionalCommits
|
|
|
9
9
|
cmd = (common_hooks + [
|
|
10
10
|
cli_command(prepare_commit_cli)
|
|
11
11
|
])
|
|
12
|
-
|
|
13
|
-
create_file_and_make_executable(path: "prepare-commit-msg", data: cmd)
|
|
12
|
+
create_file_and_make_executable(path: "prepare-commit-msg", commands: cmd)
|
|
14
13
|
end
|
|
15
14
|
|
|
16
15
|
def install_pre_commit
|
|
17
16
|
cmd = common_hooks
|
|
18
|
-
|
|
19
|
-
create_file_and_make_executable(path: "pre-commit", data: cmd)
|
|
17
|
+
create_file_and_make_executable(path: "pre-commit", commands: cmd)
|
|
20
18
|
end
|
|
21
19
|
|
|
22
20
|
def install_commit_msg
|
|
23
|
-
cmd = (common_hooks + [cli_command(validate_commit_msg)])
|
|
24
|
-
create_file_and_make_executable(path: "commit-msg",
|
|
21
|
+
cmd = (common_hooks + [cli_command(validate_commit_msg)])
|
|
22
|
+
create_file_and_make_executable(path: "commit-msg", commands: cmd)
|
|
25
23
|
end
|
|
26
24
|
|
|
27
25
|
def install_all
|
|
@@ -30,13 +28,22 @@ module ConventionalCommits
|
|
|
30
28
|
install_prepare_commit_msg
|
|
31
29
|
end
|
|
32
30
|
|
|
33
|
-
def create_file_and_make_executable(path:,
|
|
31
|
+
def create_file_and_make_executable(path:, commands:)
|
|
34
32
|
File.create_directory(path: hook_directory)
|
|
35
33
|
full_path = "#{hook_directory}/#{path}"
|
|
36
|
-
|
|
34
|
+
filtered_commands = filter_existed_values_in_script(path: full_path, commands:)
|
|
35
|
+
data = filtered_commands.join("\n")
|
|
36
|
+
File.create_or_add_to_file_data(full_path, data)
|
|
37
37
|
FileUtils.chmod("+x", full_path)
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
+
def filter_existed_values_in_script(path:, commands:)
|
|
41
|
+
return commands unless File.exist?(path)
|
|
42
|
+
|
|
43
|
+
data = File.read_file(path) || ""
|
|
44
|
+
commands.reject { |cmd| data.include?(cmd) }
|
|
45
|
+
end
|
|
46
|
+
|
|
40
47
|
def initial_lines
|
|
41
48
|
[start_line,
|
|
42
49
|
ruby_eval]
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: conventional_commits
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Swift-Gurus
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-04-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: open3
|