conventional_commits 0.2.17 → 0.2.19

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: 3aa69ffeb923aaff95af828cb4becc52b2a1d1d4ae40d03745b81d68e3a21343
4
- data.tar.gz: 427ca091217da73e1c8efc2f749c7d76ce103bb0e7c6601980edcd8e40ce28c0
3
+ metadata.gz: 29882b64a2dd213339f93a2e0f12b0e8f2ceee3b37751a2815b4d664fa7f61e8
4
+ data.tar.gz: 192b9ce6f39d5aafd247684fa227c095dbe894a55714652f2cc1e8d1131b9a07
5
5
  SHA512:
6
- metadata.gz: 408d456a633b7ba27178d6bcd9426c83ccf8a209a4e697d4e1eb32091f4be396b339033a6fc64bc0cff561ec8e09d83140786dafca642465869b915468170427
7
- data.tar.gz: 4ea097e2fa9de5c08d18ee2eb8cde1af4743e24fb2a1b5fab82be9d77ed9aa2a548482efd1bc92b4dbc50260c793ed14ec04491422e69c04d3163295c709fa5a
6
+ metadata.gz: f06f2e3cf15cc2c44abb72903de5f32c5519d1f69a7a4dcba669c374577211e52ca394e74ec60d81177ea5538d1f1f971b04d04d93dc2891875007ce144bb2d0
7
+ data.tar.gz: 34e793ef79a91cdd1e1f3837c8f2e912f86f2549ba1ebe9d9d935d5cebdccea1d613c17eb58508c3e66cd975741ac3a12ac088d81c8ef38a5ddbb54d94b745b7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- conventional_commits (0.2.15)
4
+ conventional_commits (0.2.18)
5
5
  open3
6
6
  thor
7
7
  yaml
@@ -30,7 +30,7 @@ module ConventionalCommits
30
30
  cfg_path = options["cfg_path"] || Configuration::DEFAULT_CONFIGURATION_PATH
31
31
 
32
32
  generator = ConventionalCommits::CommitMessageGenerator.new
33
- unless generator.should_try_to_parse_msg_from_file(source:)
33
+ unless generator.should_preserve_original_message(source:)
34
34
  puts "Generating message"
35
35
  name = generator.prepare_message_template_for_type(type: source, cfg_path:, msg_file_path: msg_path)
36
36
  File.write_to_file(msg_path, name)
@@ -59,7 +59,7 @@ module ConventionalCommits
59
59
  def validate_commit_msg
60
60
  generator = ConventionalCommits::CommitMessageGenerator.new
61
61
  src = options["source"] || ""
62
- return if generator.should_try_to_parse_msg_from_file(source: src)
62
+ return if generator.should_preserve_original_message(source: src)
63
63
 
64
64
  msg_path = options["msg_path"] || Configuration::DEFAULT_COMMIT_MSG_PATH
65
65
  cfg_path = options["cfg_path"] || Configuration::DEFAULT_CONFIGURATION_PATH
@@ -39,16 +39,24 @@ module ConventionalCommits
39
39
  data = File.read_file(msg_file_path).to_s
40
40
  prepare_template_message(custom_body: data, cfg_path:)
41
41
  end
42
- def should_try_to_parse_msg_from_file(source: "")
43
- skippable_sources.include?(source)
42
+
43
+ def should_preserve_original_message(source: "")
44
+ preserving_message.include?(source)
44
45
  end
45
46
 
46
- private
47
47
 
48
+ private
49
+ def should_try_to_parse_msg_from_file(source: "")
50
+ skippable_sources.include?(source)
51
+ end
48
52
  def skippable_sources
49
53
  %w[message merge squash]
50
54
  end
51
55
 
56
+ def preserving_message
57
+ %w[rebase merge squash]
58
+ end
59
+
52
60
  def sanitize(string)
53
61
  string.gsub(/-/, " ").gsub(/_/, " ")
54
62
  end
@@ -5,6 +5,7 @@ module ConventionalCommits
5
5
  def message_components(commit_msg_path: Configuration::DEFAULT_COMMIT_MSG_PATH,
6
6
  cfg_path: Configuration::DEFAULT_CONFIGURATION_PATH)
7
7
  raise GenericError, "Commit Message File is not created" unless File.exist?(commit_msg_path)
8
+ return if commit_msg_path != Configuration::DEFAULT_COMMIT_MSG_PATH
8
9
 
9
10
  data = File.read_file(commit_msg_path)
10
11
  message_components_from_string(commit_msg: data.to_s, cfg_path:)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ConventionalCommits
4
- VERSION = "0.2.17"
4
+ VERSION = "0.2.19"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conventional_commits
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.17
4
+ version: 0.2.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swift-Gurus