gem_hadar 2.18.0 → 2.19.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: 4a611c21e21c49be5ed37e09624d8036474e19bdb3a49de0f9ae4d75a4bba8f4
4
- data.tar.gz: 883a417418e398cc78d3e8828ef79a2ca427a2638cd83ad3251aebf78dc614f5
3
+ metadata.gz: fa1210ad135557e6e4a436f81fbed3e7f0529948e83ee43e61389f5174b9b60f
4
+ data.tar.gz: e3e51b44c6c88125d196219ecd9be87114745cb505f24960849ba33ada20ce64
5
5
  SHA512:
6
- metadata.gz: e203cadc253ab29fbb576b907b7e0b74962e3ab5fcad832a7a598ce9572407b136350ce80fd0d7ec503960d4f713134f82cdedf2309c3c96c1d51bab877de900
7
- data.tar.gz: '08075104eb3b809ce859fb56564442a2479603c290d58e7c53869c8a713715dec5fece3159d39768dfef51689f568a53f0004b0c97f12782accc614f5e01ed95'
6
+ metadata.gz: e81e0dfa1100249bdff83845f5cffe2e3e54355567d02bc95963e55b6a3b1e715d56d3d82c38b48e40423aa483f131b5f209bd8a8eaefc96a821e08bc93f7382
7
+ data.tar.gz: ca57360e525ffffd232b317862833b2a3063573bfb3652f10c64c91afa5827386c883cb0821eb4ddadd10093f85e7c03c32fc50cb58b32dfb6702c75a551a132
data/gem_hadar.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: gem_hadar 2.18.0 ruby lib
2
+ # stub: gem_hadar 2.19.1 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "gem_hadar".freeze
6
- s.version = "2.18.0".freeze
6
+ s.version = "2.19.1".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
@@ -17,13 +17,13 @@ Gem::Specification.new do |s|
17
17
  s.homepage = "https://github.com/flori/gem_hadar".freeze
18
18
  s.licenses = ["MIT".freeze]
19
19
  s.rdoc_options = ["--title".freeze, "GemHadar - Library for the development of Ruby Gems".freeze, "--main".freeze, "README.md".freeze]
20
- s.rubygems_version = "4.0.17".freeze
20
+ s.rubygems_version = "4.0.22".freeze
21
21
  s.summary = "Library for the development of Ruby Gems".freeze
22
22
  s.test_files = ["spec/gem_hadar_spec.rb".freeze, "spec/spec_helper.rb".freeze]
23
23
 
24
24
  s.specification_version = 4
25
25
 
26
- s.add_development_dependency(%q<gem_hadar>.freeze, [">= 2.17.1".freeze])
26
+ s.add_development_dependency(%q<gem_hadar>.freeze, [">= 2.19.0".freeze])
27
27
  s.add_development_dependency(%q<all_images>.freeze, [">= 0".freeze])
28
28
  s.add_development_dependency(%q<rspec>.freeze, ["~> 3.13".freeze])
29
29
  s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
@@ -52,10 +52,10 @@ class GemHadar
52
52
 
53
53
  range = "#{from.tag}..#{to.tag}"
54
54
 
55
- log = `git log #{range}`
55
+ log = `git log --color=never -p #{range}`
56
56
  $?.success? or raise "Failed to get git log for range #{range}"
57
57
 
58
- date = `git log -n1 --pretty='format:%cd' --date=short #{to.tag.inspect}`.chomp
58
+ date = `git log --color=never -n1 --pretty='format:%cd' --date=short #{to.tag.inspect}`.chomp
59
59
 
60
60
  if log.strip.empty?
61
61
  return "\n## #{date} #{to.without_prefix.to_s}\n"
@@ -129,7 +129,7 @@ class GemHadar
129
129
  end
130
130
 
131
131
  first_version = versions.first
132
- date = `git log -n1 --pretty='format:%cd' --date=short #{first_version.tag.to_s}`.chomp
132
+ date = `git log --color=never -n1 --pretty='format:%cd' --date=short #{first_version.tag.to_s}`.chomp
133
133
  changelog = ["\n## #{date} #{first_version.tag.to_s}\n\n* Start\n"]
134
134
 
135
135
  changelog = generate_changelog(versions, changelog:)
@@ -269,7 +269,7 @@ class GemHadar
269
269
  # chronological order
270
270
  def generate_changelog(versions, changelog: [])
271
271
  versions = versions.each_cons(2).
272
- with_infobar(total: versions.size - 1, label: 'Change')
272
+ with_infobar(total: versions.size - 1, label: 'Change', show: STDOUT.tty?)
273
273
  versions.each do |range_from, range_to|
274
274
  changelog << generate(range_from, range_to)
275
275
  +infobar
@@ -34,25 +34,62 @@ module GemHadar::PromptTemplate
34
34
  # @return [ String ] the prompt template for GitHub release changelog generation
35
35
  def default_git_release_prompt
36
36
  <<~EOT
37
- Output the content of a changelog this new release, but never mention
38
- the version of the release.
37
+ Generate the release body for a new release from the following Git log
38
+ (commit messages and unified diffs):
39
39
 
40
- **Strictly** follow these guidelines:
40
+ %{log_diff}
41
41
 
42
- - Use bullet points in markdown format (`-`) to list significant changes.
43
- - Exclude trivial updates such as:
44
- * Version number increments
45
- * Dependency version bumps (unless they resolve critical issues)
46
- * Minor code style adjustments
47
- * Internal documentation tweaks
48
- - Include only verified and substantial changes that impact
49
- functionality, performance, or user experience.
50
- - If unsure about a change's significance, omit it from the output.
51
- - Avoid adding any comments or notes; keep the output purely factual.
42
+ **Input:**
43
+ - Commit messages describe the author's intent.
44
+ - Patches show the actual code changes and are the source of truth.
45
+ - If a commit message is vague or misleading, trust the patch.
52
46
 
53
- These are the log messages including patches for the new release:
47
+ **Rules:**
48
+ 1. Categorize each change into one of the sections below.
49
+ 2. **Omit any section that has zero entries. Do NOT output an
50
+ empty header with no bullet points beneath it.**
51
+ 3. Never mention the version number of the release.
52
+ 4. Include only significant changes that impact functionality,
53
+ performance, or user experience.
54
+ 5. Exclude trivial updates:
55
+ - Version number increments
56
+ - Dependency version bumps (unless they resolve critical issues)
57
+ - Minor code style adjustments
58
+ - Internal documentation tweaks
59
+ 6. Wrap variable, method, function, and constant names in backticks.
60
+ 7. Wrap version numbers in **bold**.
61
+ 8. Do NOT reference individual commits by SHA-1 hash.
62
+ 9. Do NOT add chatty remarks, notes, introductions, or closing lines.
63
+ 10. If unsure about a change's significance, omit it.
54
64
 
55
- %{log_diff}
65
+ **Output format:**
66
+ - Use the section headers below. Omit empty sections entirely.
67
+
68
+ ### Breaking
69
+ API changes, removed features, or compatibility changes
70
+ that require user action.
71
+ - …
72
+
73
+ ### Features
74
+ New user-facing APIs, options, or capabilities.
75
+ - …
76
+
77
+ ### Fixes
78
+ - …
79
+
80
+ ### Improvements
81
+ - …
82
+
83
+ ### Build & CI
84
+ CI pipeline, Dockerfile, dependency, gemspec metadata,
85
+ test infrastructure, and tooling changes.
86
+ - …
87
+
88
+ ### Testing
89
+ - …
90
+
91
+ ### Documentation
92
+ - …
56
93
  EOT
57
94
  end
58
95
 
@@ -69,10 +106,10 @@ module GemHadar::PromptTemplate
69
106
  def default_version_bump_system_prompt
70
107
  <<~EOT
71
108
  You are an expert at semantic versioning. Analyze the provided changes
72
- and suggest whether to bump major, minor, or build version according to
73
- Semantic Versioning. Provide a brief explanation of your reasoning,
74
- followed by a single line containing only one word: 'major', 'minor', or
75
- 'build'.
109
+ and suggest whether to bump major, minor, or build (=patch) version
110
+ according to Semantic Versioning. Provide a brief explanation of your
111
+ reasoning, followed by a single line containing only one word: 'major',
112
+ 'minor', or 'build'.
76
113
  EOT
77
114
  end
78
115
 
@@ -109,8 +146,9 @@ module GemHadar::PromptTemplate
109
146
  # @return [ String ] the system prompt for changelog generation
110
147
  def default_changelog_system_prompt
111
148
  <<~EOT
112
- You are a Ruby programmer generating a change log entry in markdown syntax,
113
- summarizing the code changes for a new version in a professional way.
149
+ You are a Ruby programmer generating a changelog entry in markdown.
150
+ Summarize code changes for a new version in a professional, factual
151
+ tone. You are not a chatbot.
114
152
  EOT
115
153
  end
116
154
 
@@ -124,23 +162,57 @@ module GemHadar::PromptTemplate
124
162
  # while focusing on significant functional changes.
125
163
  def default_changelog_prompt
126
164
  <<~EOT
127
- Generate a changelog entry for the following Git commit history:
165
+ Generate a changelog entry from the following Git log
166
+ (commit messages and unified diffs):
128
167
 
129
168
  %{log_diff}
130
169
 
131
- - Summarize the changes in the following git log messages as bullet points.
132
- - Don't mention the version of the change set
133
- - Skip bullet points about version bumps.
134
- - List significant changes as bullet points using markdown when applicable.
135
- - Mark all names and values for variables, methods, functions, and
136
- constants, you see in the messages as markdown code surrounded by
137
- backtick characters.
138
- - Mark all version numbers you see in the messages as markdown bold
139
- surrounded by two asterisk characters.
140
- - Don't refer to single commits by sha1 hash.
141
- - Don't add information about changes you are not sure about.
142
- - Don't output any additional chatty remarks, notes, introductions,
143
- communications, etc.
170
+ **Input:**
171
+ - Commit messages describe the author's intent.
172
+ - Patches show the actual code changes and are the source of truth.
173
+ - If a commit message is vague or misleading, trust the patch.
174
+
175
+ **Rules:**
176
+ 1. Categorize each change into one of the sections below.
177
+ 2. **Omit any section that has zero entries. Do NOT output an
178
+ empty header with no bullet points beneath it.**
179
+ 3. Do NOT mention the version number of the change set.
180
+ 4. Skip entries that are purely version bumps.
181
+ 5. Wrap variable, method, function, and constant names found in
182
+ messages or patches in backticks.
183
+ 6. Wrap version numbers found in messages in **bold**.
184
+ 7. Do NOT reference individual commits by SHA-1 hash.
185
+ 8. Do NOT add information you are not certain about.
186
+ 9. Do NOT include chatty remarks, introductions, or closing notes.
187
+
188
+ **Output format:**
189
+ - Use the section headers below. Omit empty sections entirely.
190
+
191
+ ### Breaking
192
+ API changes, removed features, or compatibility changes
193
+ that require user action.
194
+ - …
195
+
196
+ ### Features
197
+ New user-facing APIs, options, or capabilities.
198
+ - …
199
+
200
+ ### Fixes
201
+ - …
202
+
203
+ ### Improvements
204
+ - …
205
+
206
+ ### Build & CI
207
+ CI pipeline, Dockerfile, dependency, gemspec metadata,
208
+ test infrastructure, and tooling changes.
209
+ - …
210
+
211
+ ### Testing
212
+ - …
213
+
214
+ ### Documentation
215
+ - …
144
216
  EOT
145
217
  end
146
218
  end
@@ -1,6 +1,11 @@
1
+ # Version information for the GemHadar gem.
2
+ #
3
+ # This module is auto-generated by GemHadar and exposes the
4
+ # current release version as a set of constants. Do not edit it
5
+ # by hand; it is rewritten on every `rake version` invocation.
1
6
  class GemHadar
2
- # GemHadar version
3
- VERSION = '2.18.0'
7
+ # The current version of the GemHadar gem as a String.
8
+ VERSION = '2.19.1'
4
9
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
10
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
11
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/lib/gem_hadar.rb CHANGED
@@ -808,8 +808,13 @@ class GemHadar
808
808
  mkdir_p dir = File.join('lib', path_name)
809
809
  secure_write(File.join(dir, 'version.rb')) do |v|
810
810
  v.puts <<~EOT
811
+ # Version information for the #{path_module} gem.
812
+ #
813
+ # This #{module_type} is auto-generated by GemHadar and exposes the
814
+ # current release version as a set of constants. Do not edit it
815
+ # by hand; it is rewritten on every `rake version` invocation.
811
816
  #{module_type} #{path_module}
812
- # #{path_module} version
817
+ # The current version of the #{path_module} gem as a String.
813
818
  VERSION = '#{version}'
814
819
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
815
820
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
@@ -873,7 +878,7 @@ class GemHadar
873
878
  fail "Could not find #{from_version.inspect}."
874
879
  end
875
880
  end
876
- `git log -p #{from_version.tag}..HEAD`
881
+ `git log --color=never -p #{from_version.tag}..HEAD`
877
882
  else
878
883
  unless versions.find { |v| v == to_version }
879
884
  fail "Could not find #{to_version.inspect}."
@@ -885,14 +890,14 @@ class GemHadar
885
890
  end
886
891
  end
887
892
  unless from_version
888
- return `git log -p #{to_version.tag}`
893
+ return `git log --color=never -p #{to_version.tag}`
889
894
  end
890
895
  else
891
896
  unless versions.find { |v| v == from_version }
892
897
  fail "Could not find #{from_version.inspect}."
893
898
  end
894
899
  end
895
- `git log -p #{from_version.tag}..#{to_version.tag}`
900
+ `git log --color=never -p #{from_version.tag}..#{to_version.tag}`
896
901
  end
897
902
  end
898
903
 
@@ -1378,8 +1383,16 @@ class GemHadar
1378
1383
  # @return [ String ] the generated changelog content for the release body
1379
1384
  def create_git_release_body
1380
1385
  log_diff = version_log_diff(to_version: version)
1381
- system = xdg_config('gem_hadar', 'release_system_prompt.txt', default_git_release_system_prompt)
1382
- prompt = xdg_config('gem_hadar', 'release_prompt.txt', default_git_release_prompt) % { name:, version:, log_diff: }
1386
+ system = xdg_config(
1387
+ 'gem_hadar',
1388
+ 'release_system_prompt.txt',
1389
+ default_git_release_system_prompt
1390
+ )
1391
+ prompt = xdg_config(
1392
+ 'gem_hadar', 'release_prompt.txt', default_git_release_prompt
1393
+ ) % {
1394
+ name:, version:, log_diff:
1395
+ }
1383
1396
  ollama_generate(system:, prompt:)
1384
1397
  end
1385
1398
 
@@ -2171,8 +2184,9 @@ class GemHadar
2171
2184
  # - Applies template variables to customize the generated workflows
2172
2185
  def github_workflows_task
2173
2186
  namespace :github do
2187
+ github_workflow_templates = create_github_workflow_templates
2174
2188
  desc "Create all configured github workflow tasks"
2175
- task :workflows => create_github_workflow_templates
2189
+ task :workflows => github_workflow_templates
2176
2190
  namespace :workflows do
2177
2191
  desc "Delete all created github workflows"
2178
2192
  task :clean do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem_hadar
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.18.0
4
+ version: 2.19.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - ">="
17
17
  - !ruby/object:Gem::Version
18
- version: 2.17.1
18
+ version: 2.19.0
19
19
  type: :development
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - ">="
24
24
  - !ruby/object:Gem::Version
25
- version: 2.17.1
25
+ version: 2.19.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: all_images
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -319,7 +319,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
319
319
  - !ruby/object:Gem::Version
320
320
  version: '0'
321
321
  requirements: []
322
- rubygems_version: 4.0.17
322
+ rubygems_version: 4.0.22
323
323
  specification_version: 4
324
324
  summary: Library for the development of Ruby Gems
325
325
  test_files: