utils 0.49.1 → 0.50.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e43caf044e808fccbaac98f0038bc9f0d19912614d3ebef62ca8547044297fd
4
- data.tar.gz: bbb6babbd0f49c101827ad5d9d38a30dc13165c08b9b12c884405d1f29897927
3
+ metadata.gz: dadd4a293214a787936b14864d1dd05c0808ac65d257f19d67bfdd1226509293
4
+ data.tar.gz: 6d3b76168a3a581c40090a7cd5b9405ccd20c808c0aff3b7459effa39b003170
5
5
  SHA512:
6
- metadata.gz: 264d31ca22cc9339a1be6afd47cd227db204cda858583f8f5c4ab616d980a4f3c3313199d3169e62bf154412c87205b4ad03aa519a944dfbbadfe0d260a5374e
7
- data.tar.gz: e539b003de097193944a4f300d90b6f7e4a3bbf78ca2896de9797b205067f1ad0c77afcd54258277b107279f6dd5cdf819747f5b533fd5b58681762c9b823fe9
6
+ metadata.gz: 488fd24d4c446bf86f4b13ed5091701d8e411dee6a884dd9a86fb7f0392c6cd623d75c1f7bd0e997305cad59755404bc8acb2edcce04e1c727f5952220f7c314
7
+ data.tar.gz: 617b678a20a2d41a08cb8d070d7052bb022a50f3cde0864f37910e656d8c18e8c8e2df9137021c447957efaf8021d5d022303b276b933591a3ad6db4242302eb
data/Rakefile CHANGED
@@ -29,6 +29,7 @@ GemHadar do
29
29
  dependency 'search_ui', '~> 0.0'
30
30
  dependency 'all_images', '~> 0.5.0'
31
31
  dependency 'ollama-ruby', '~> 0.3.0'
32
+ dependency 'simplecov'
32
33
  development_dependency 'debug'
33
34
 
34
35
  install_library do
data/bin/changes CHANGED
@@ -26,8 +26,12 @@ end
26
26
 
27
27
  def compute_change(range_from, range_to)
28
28
  range_from = range_from.to_s.sub(/\Av?/, ?v)
29
- range_to = range_to.to_s.sub(/\Av?/, ?v)
30
- range = "#{range_from}..#{range_to}"
29
+ if range_to.to_s == 'HEAD'
30
+ range = "#{range_from}..HEAD"
31
+ else
32
+ range_to = range_to.to_s.sub(/\Av?/, ?v)
33
+ range = "#{range_from}..#{range_to}"
34
+ end
31
35
 
32
36
  log=x("git log #{range}")
33
37
  $?.success? or exit 1
@@ -52,10 +56,13 @@ def compute_change(range_from, range_to)
52
56
  prompt = <<~EOT
53
57
  - Summarize the changes in the following git log messages as bullet points.
54
58
  - List significant changes as bullet points using markdown when applicable.
59
+ - Mark all names and values for variables, methods, functions, and
60
+ constants, you see in the messages as markdown `code`.
61
+ - Mark all version numbers you see in the messages as markdown **bold**.
55
62
  - Don't refer to single commits by sha1 hash.
56
63
  - Don't add information about changes you are not sure about.
57
64
  - Don't output any additional chatty remarks, notes, introductions,
58
- communications.
65
+ communications, etc.
59
66
 
60
67
  #{log}
61
68
  EOT
@@ -88,6 +95,24 @@ end
88
95
  x("git fetch --tags")
89
96
 
90
97
  case command = ARGV.shift
98
+ when 'pending'
99
+ last_version = x("git tag").lines.grep(/^v?\d+\.\d+\.\d+$/).map(&:chomp).map {
100
+ Tins::StringVersion::Version.new(_1.sub(/\Av/, ''))
101
+ }.max
102
+ if last_version
103
+ puts compute_change(last_version, :HEAD)
104
+ else
105
+ fail 'need at least one version tag to work'
106
+ end
107
+ when 'current'
108
+ version1, version2 = x("git tag").lines.grep(/^v?\d+\.\d+\.\d+$/).map(&:chomp).map {
109
+ Tins::StringVersion::Version.new(_1.sub(/\Av/, ''))
110
+ }.sort.last(2)
111
+ if version1 and version2
112
+ puts compute_change(version1, version2)
113
+ else
114
+ fail 'need at least two version tags to work'
115
+ end
91
116
  when 'range'
92
117
  range = ARGV.shift
93
118
  if range =~ /\A(.+)\.\.(.+)\z/
@@ -98,7 +123,7 @@ when 'range'
98
123
  end
99
124
  when 'full', 'add'
100
125
  ary = []
101
- tags=x("git tag").lines.grep(/^v?\d+\.\d+\.\d+$/).map(&:chomp).map {
126
+ tags = x("git tag").lines.grep(/^v?\d+\.\d+\.\d+$/).map(&:chomp).map {
102
127
  Tins::StringVersion::Version.new(_1.sub(/\Av/, ''))
103
128
  }.sort
104
129
  if command == 'full'
@@ -152,6 +177,6 @@ when 'full', 'add'
152
177
  end
153
178
  else
154
179
  puts <<~end
155
- Usage: #{File.basename($0)} help|range|full|add
180
+ Usage: #{File.basename($0)} help|range|full|add|pending
156
181
  end
157
182
  end
data/lib/utils/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.49.1'
3
+ VERSION = '0.50.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,14 +1,14 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: utils 0.49.1 ruby lib
2
+ # stub: utils 0.50.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "utils".freeze
6
- s.version = "0.49.1".freeze
6
+ s.version = "0.50.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]
10
10
  s.authors = ["Florian Frank".freeze]
11
- s.date = "2024-09-13"
11
+ s.date = "2024-09-15"
12
12
  s.description = "This ruby gem provides some useful command line utilities".freeze
13
13
  s.email = "flori@ping.de".freeze
14
14
  s.executables = ["ascii7".freeze, "blameline".freeze, "changes".freeze, "classify".freeze, "code_comment".freeze, "commit_message".freeze, "create_cstags".freeze, "create_tags".freeze, "discover".freeze, "edit".freeze, "edit_wait".freeze, "enum".freeze, "git-empty".freeze, "git-versions".freeze, "json_check".freeze, "long_lines".freeze, "myex".freeze, "number_files".freeze, "on_change".freeze, "path".freeze, "print_method".freeze, "probe".freeze, "rd2md".freeze, "search".freeze, "sedit".freeze, "serve".freeze, "ssh-tunnel".freeze, "strip_spaces".freeze, "sync_dir".freeze, "untest".freeze, "utils-utilsrc".freeze, "vcf2alias".freeze, "yaml_check".freeze]
@@ -34,4 +34,5 @@ Gem::Specification.new do |s|
34
34
  s.add_runtime_dependency(%q<search_ui>.freeze, ["~> 0.0".freeze])
35
35
  s.add_runtime_dependency(%q<all_images>.freeze, ["~> 0.5.0".freeze])
36
36
  s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 0.3.0".freeze])
37
+ s.add_runtime_dependency(%q<simplecov>.freeze, [">= 0".freeze])
37
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: utils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.49.1
4
+ version: 0.50.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-13 00:00:00.000000000 Z
11
+ date: 2024-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -178,6 +178,20 @@ dependencies:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
180
  version: 0.3.0
181
+ - !ruby/object:Gem::Dependency
182
+ name: simplecov
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
181
195
  description: This ruby gem provides some useful command line utilities
182
196
  email: flori@ping.de
183
197
  executables: