utils 0.49.0 → 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: f6c937a65dea15baa84a877d5edd995c3603438bfde093f11ff3288f1261c290
4
- data.tar.gz: 350a2711f49f1e055a6b7e06eb2215a4fbd7d60974ffaa309c4b7e585040405b
3
+ metadata.gz: dadd4a293214a787936b14864d1dd05c0808ac65d257f19d67bfdd1226509293
4
+ data.tar.gz: 6d3b76168a3a581c40090a7cd5b9405ccd20c808c0aff3b7459effa39b003170
5
5
  SHA512:
6
- metadata.gz: 7d33c8650b22df039abe078236d5af3f828e970040aa8e307a23d37d2157f1cd7e56e4a06316a10d761c32d299353e39058431925180262e4ede8097798347d5
7
- data.tar.gz: 4bc385055c625c31d13b1bec07377a94a6a104b90b63a41907d23b365f6f9cae569b977eb0722b33ef525262d12f54efc180cf10f03395bae395d98506b7485a
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/bin/probe CHANGED
@@ -28,9 +28,7 @@ def usage
28
28
  end
29
29
 
30
30
  def cmd(*args)
31
- if ENV.key?('BUNDLE_GEMFILE')
32
- args.unshift 'bundle', 'exec'
33
- end
31
+ args.unshift 'bundle', 'exec'
34
32
  puts Shellwords.join(args)
35
33
  system(*args) or exit $?.exitstatus
36
34
  end
data/lib/utils/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.49.0'
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.0 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.0".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-09"
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.0
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-09 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: