utils 0.95.1 → 0.96.0

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: 7bba639d101ec37e597a7563e2c3f524045a32ed4d2260a05854b8cc1da45b08
4
- data.tar.gz: 8376c5be9dfad9f442293f5ca4f493735c337a31e764416e258ffd50f200363a
3
+ metadata.gz: 5021e17950b487c03dcd9cffee109854cbfc111ec2707506ef57c5aa9a276232
4
+ data.tar.gz: 2c51ddcec5c7874b256122b247d1751fffd66846a28c9f29fbb74ed53a077c07
5
5
  SHA512:
6
- metadata.gz: a006bf976c08a413af61df53c776860a16f1661551fbf17ef920b7438f34f080b6104ca54355a01b54d549246821532c6cbc0acafb5e2a8a6cdd79bf81f29967
7
- data.tar.gz: 06a5bf9ffd17e00a210478cabcafca065909689986e7c24093cb178d3646a17311cb1f6a54ada9b3b7171959866e64a4a881f6d32b1e6583b94ec1aec1387282
6
+ metadata.gz: 0d70edd17ffdbc5a62af5b1893c78c6a1a7dd1b474ca4b00a1a08ddc0c8935bb6904d6a6cf912c5b86a119e30f82a64f337e79600bd2bb69e9809d11a2699a5b
7
+ data.tar.gz: e17513476a6a16b0e4b69431874c8e9c3b3fa73d9f3a208bebca5f6220f72d5327bb16ef269ca5ccf0675451d02b0edda3cd014b42021d12e2fe3296d0f9c85f
data/bin/changes CHANGED
@@ -3,11 +3,11 @@
3
3
  # Generate changelogs using Git history and LLM summaries
4
4
  #
5
5
  # Usage:
6
- # changes pending # Show changes since last version
7
- # changes current # Show changes between two latest versions
8
- # changes range v1.0.0..v1.2.0 # Show changes in a specific range
9
- # changes full # Generate full changelog from first tag
10
- # changes add CHANGELOG.md # Append new entries to existing file
6
+ # changes pending [-r vX.Y.Z] # Show changes since last version (optional future tag)
7
+ # changes current # Show changes between two latest versions
8
+ # changes range v1.0.0..v1.2.0 # Show changes in a specific range
9
+ # changes full # Generate full changelog from first tag
10
+ # changes add CHANGELOG.md # Append new entries to existing file
11
11
  #
12
12
  # Requires:
13
13
  # - Git repository with version tags (vX.Y.Z format)
@@ -29,6 +29,8 @@ require 'ollama'
29
29
  include Ollama
30
30
  require 'utils'
31
31
  include Utils::XDG
32
+ require 'tins/go'
33
+ include Tins::GO
32
34
 
33
35
  # Executes a shell command and returns its output.
34
36
  #
@@ -70,18 +72,20 @@ def find_highest_version_tag(filename)
70
72
  end
71
73
  end
72
74
 
73
- # The compute_change method generates a changelog entry by processing Git log
74
- # information and using an LLM to create a formatted summary.
75
+ # Generates a formatted changelog entry by processing Git logs and utilizing an
76
+ # LLM.
75
77
  #
76
- # This method takes two range parameters, computes the Git log between them,
77
- # retrieves the commit date, and then uses an LLM to generate a human-readable
78
- # changelog entry based on configuration files and prompt templates.
78
+ # This method calculates the commit range between two points, retrieves the
79
+ # date of the latest commit, and sends the log data to an Ollama-powered LLM to
80
+ # generate a human-readable summary based on local configuration templates.
79
81
  #
80
- # @param range_from [ Object ] the starting point of the Git log range
81
- # @param range_to [ Object ] the ending point of the Git log range
82
+ # @param range_from [Object] the starting point of the Git log (e.g., 'v1.0.0')
83
+ # @param range_to [Object] the ending point of the Git log (e.g., 'v1.1.0' or :HEAD)
84
+ # @param future_tag [String] optional override for the version label displayed
85
+ # in the resulting header; defaults to `range_to`
82
86
  #
83
- # @return [ String ] a formatted changelog entry including the date and LLM-generated content
84
- def compute_change(range_from, range_to)
87
+ # @return [String] a formatted Markdown changelog entry including date and summary
88
+ def compute_change(range_from, range_to, future_tag: range_to)
85
89
  range_from = range_from.to_s.sub(/\Av?/, ?v)
86
90
  if range_to.to_s == 'HEAD'
87
91
  range = "#{range_from}..HEAD"
@@ -98,7 +102,7 @@ def compute_change(range_from, range_to)
98
102
  if log.strip.empty?
99
103
  return <<~EOT
100
104
 
101
- ## #{date} #{range_to}
105
+ ## #{date} #{future_tag}
102
106
  EOT
103
107
  end
104
108
 
@@ -122,7 +126,7 @@ def compute_change(range_from, range_to)
122
126
 
123
127
  return <<~EOT
124
128
 
125
- ## #{date} #{range_to}
129
+ ## #{date} #{future_tag}
126
130
 
127
131
  #{changes}
128
132
  EOT
@@ -136,7 +140,8 @@ when 'pending'
136
140
  _1.sub(/\Av/, '').version
137
141
  }.max
138
142
  if last_version
139
- puts compute_change(last_version, :HEAD)
143
+ opts = go('r:')
144
+ puts compute_change(last_version, :HEAD, future_tag: opts[?r])
140
145
  else
141
146
  fail 'need at least one version tag to work'
142
147
  end
data/lib/utils/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.95.1'
3
+ VERSION = '0.96.0'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/utils.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: utils 0.95.1 ruby lib
2
+ # stub: utils 0.96.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "utils".freeze
6
- s.version = "0.95.1".freeze
6
+ s.version = "0.96.0".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]
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
 
24
24
  s.specification_version = 4
25
25
 
26
- s.add_development_dependency(%q<gem_hadar>.freeze, [">= 2.17.0".freeze])
26
+ s.add_development_dependency(%q<gem_hadar>.freeze, [">= 2.17.1".freeze])
27
27
  s.add_development_dependency(%q<test-unit>.freeze, [">= 0".freeze])
28
28
  s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.51".freeze])
29
29
  s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.11".freeze])
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.95.1
4
+ version: 0.96.0
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.0
18
+ version: 2.17.1
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.0
25
+ version: 2.17.1
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: test-unit
28
28
  requirement: !ruby/object:Gem::Requirement