utils 0.52.0 → 0.53.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: dfade6a59e0995d7ee7477ccdafdbda0c14e9797a37c55d4d112f30b31fc2e76
4
- data.tar.gz: c449da7722535dfa051df409388554840e5c146249a06f4bf2b758aada7d492c
3
+ metadata.gz: 21f05ea58a7b07704aa6572c3f201eae89e464d4edf724d1dca42207feb6dcd6
4
+ data.tar.gz: 8186f8020edca70be3570c90690c942aa1296329df5f6bff1e31be5635e25947
5
5
  SHA512:
6
- metadata.gz: 588351709d351fe808643d54adf8afa17f89235650bbd54d645fe7a4977c6a31eaedd6fe3b4d0c84907d487e019b098ed6020307c08f327fe5f249c3c6298e6e
7
- data.tar.gz: 04ea3235073f97bf229be082680eadfa366315bc8ea4bba8230808bc87679e82ea40b9b63575f5a7a90e39f2c3ad817e41f00717c8fbccd12959ecd9c98d6af4
6
+ metadata.gz: 1ceac9a0dd84f3deccdccaa1655cee0182e878b1d5151bac426e759330665dade75094ecdab5d72e4e61e8cd00442e38ed0a58cb371c921025d26574f24f4f8d
7
+ data.tar.gz: 3644e14c5df97f7d086063d6f1f401e9ca639b097963733142b814e3eea1cd0ff585aa3e30e5c76c856ce240b6207829005e17bac61dccd7b9e75646d9f586f7
data/Rakefile CHANGED
@@ -28,7 +28,7 @@ GemHadar do
28
28
  dependency 'mize', '~> 0.6'
29
29
  dependency 'search_ui', '~> 0.0'
30
30
  dependency 'all_images', '~> 0.5.0'
31
- dependency 'ollama-ruby', '~> 0.3.0'
31
+ dependency 'ollama-ruby', '~> 0.4.0'
32
32
  dependency 'simplecov'
33
33
  dependency 'debug'
34
34
 
data/bin/discover CHANGED
@@ -64,7 +64,7 @@ STDOUT.sync = true
64
64
  config = Utils::ConfigFile.new
65
65
  config.configure_from_paths
66
66
  args[?b] ||= config.discover.binary
67
- args[?n] ||= args[?l] ? 1 << 60 : config.discover.max_matches
67
+ args[?n] ||= (args[?l] || args[?L]) ? 1 << 60 : config.discover.max_matches
68
68
 
69
69
  if args[?s]
70
70
  pattern = ''
data/bin/git-md ADDED
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'ollama'
4
+ require 'shellwords'
5
+
6
+ def markdown(message)
7
+ Ollama::Utils::ANSIMarkdown.parse(message)
8
+ end
9
+
10
+ cmd = %{git log --color=always --pretty=format:"commit %C(auto)%H%d%nDate: %Cgreen%cD (%cr)%Creset%nAuthor: %Cblue%an <%ae>%Creset%n%nMARKUP%n%s%n%n%bMARKDOWN"}
11
+
12
+ IO.popen("#{cmd} #{Shellwords.join(ARGV)}") do |log|
13
+ until log.eof?
14
+ message = nil
15
+ log.each do |line|
16
+ case line
17
+ when /^MARKUP$/
18
+ message = ''
19
+ when /^MARKDOWN$/
20
+ puts markdown(message)
21
+ message = nil
22
+ else
23
+ if message
24
+ message << line
25
+ else
26
+ puts line
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
data/lib/utils/finder.rb CHANGED
@@ -18,11 +18,15 @@ class Utils::Finder
18
18
  @args = opts[:args] || {}
19
19
  @roots = discover_roots(opts[:roots])
20
20
  @config = opts[:config] || Utils::ConfigFile.new
21
- pattern_opts = opts.subhash(:pattern) | {
22
- :cset => @args[?a],
23
- :icase => @args[?i] != ?n,
24
- }
25
- @pattern = choose(@args[?p], pattern_opts)
21
+ if @args[?l] || @args[?L]
22
+ @pattern = nil
23
+ else
24
+ pattern_opts = opts.subhash(:pattern) | {
25
+ :cset => @args[?a],
26
+ :icase => @args[?i] != ?n,
27
+ }
28
+ @pattern = choose(@args[?p], pattern_opts)
29
+ end
26
30
  @paths = []
27
31
  reset_index
28
32
  end
@@ -112,7 +116,9 @@ class Utils::Finder
112
116
  paths.select! { |path| s.include?(File.extname(path)[1..-1]) }
113
117
  end
114
118
  paths = paths.map! do |path|
115
- if match = @pattern.match(path)
119
+ if @pattern.nil?
120
+ [ [ path.count(?/), path ], path, path ]
121
+ elsif match = @pattern.match(path)
116
122
  if FuzzyPattern === @pattern
117
123
  current = 0
118
124
  marked_path = ''
data/lib/utils/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.52.0'
3
+ VERSION = '0.53.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,19 +1,19 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: utils 0.52.0 ruby lib
2
+ # stub: utils 0.53.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "utils".freeze
6
- s.version = "0.52.0".freeze
6
+ s.version = "0.53.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-22"
11
+ s.date = "2024-09-23"
12
12
  s.description = "This ruby gem provides some useful command line utilities".freeze
13
13
  s.email = "flori@ping.de".freeze
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]
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-md".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]
15
15
  s.extra_rdoc_files = ["README.md".freeze, "lib/utils.rb".freeze, "lib/utils/config_file.rb".freeze, "lib/utils/editor.rb".freeze, "lib/utils/file_xt.rb".freeze, "lib/utils/finder.rb".freeze, "lib/utils/grepper.rb".freeze, "lib/utils/irb.rb".freeze, "lib/utils/line_blamer.rb".freeze, "lib/utils/line_formatter.rb".freeze, "lib/utils/md5.rb".freeze, "lib/utils/patterns.rb".freeze, "lib/utils/probe_server.rb".freeze, "lib/utils/ssh_tunnel_specification.rb".freeze, "lib/utils/version.rb".freeze, "lib/utils/xt/source_location_extension.rb".freeze]
16
- s.files = [".github/dependabot.yml".freeze, ".github/workflows/codeql-analysis.yml".freeze, "COPYING".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ascii7".freeze, "bin/blameline".freeze, "bin/changes".freeze, "bin/classify".freeze, "bin/code_comment".freeze, "bin/commit_message".freeze, "bin/create_cstags".freeze, "bin/create_tags".freeze, "bin/discover".freeze, "bin/edit".freeze, "bin/edit_wait".freeze, "bin/enum".freeze, "bin/git-empty".freeze, "bin/git-versions".freeze, "bin/json_check".freeze, "bin/long_lines".freeze, "bin/myex".freeze, "bin/number_files".freeze, "bin/on_change".freeze, "bin/path".freeze, "bin/print_method".freeze, "bin/probe".freeze, "bin/rd2md".freeze, "bin/search".freeze, "bin/sedit".freeze, "bin/serve".freeze, "bin/ssh-tunnel".freeze, "bin/strip_spaces".freeze, "bin/sync_dir".freeze, "bin/untest".freeze, "bin/utils-utilsrc".freeze, "bin/vcf2alias".freeze, "bin/yaml_check".freeze, "lib/utils.rb".freeze, "lib/utils/config_file.rb".freeze, "lib/utils/editor.rb".freeze, "lib/utils/file_xt.rb".freeze, "lib/utils/finder.rb".freeze, "lib/utils/grepper.rb".freeze, "lib/utils/irb.rb".freeze, "lib/utils/line_blamer.rb".freeze, "lib/utils/line_formatter.rb".freeze, "lib/utils/md5.rb".freeze, "lib/utils/patterns.rb".freeze, "lib/utils/probe_server.rb".freeze, "lib/utils/ssh_tunnel_specification.rb".freeze, "lib/utils/version.rb".freeze, "lib/utils/xt/source_location_extension.rb".freeze, "utils.gemspec".freeze]
16
+ s.files = [".github/dependabot.yml".freeze, ".github/workflows/codeql-analysis.yml".freeze, "COPYING".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ascii7".freeze, "bin/blameline".freeze, "bin/changes".freeze, "bin/classify".freeze, "bin/code_comment".freeze, "bin/commit_message".freeze, "bin/create_cstags".freeze, "bin/create_tags".freeze, "bin/discover".freeze, "bin/edit".freeze, "bin/edit_wait".freeze, "bin/enum".freeze, "bin/git-empty".freeze, "bin/git-md".freeze, "bin/git-versions".freeze, "bin/json_check".freeze, "bin/long_lines".freeze, "bin/myex".freeze, "bin/number_files".freeze, "bin/on_change".freeze, "bin/path".freeze, "bin/print_method".freeze, "bin/probe".freeze, "bin/rd2md".freeze, "bin/search".freeze, "bin/sedit".freeze, "bin/serve".freeze, "bin/ssh-tunnel".freeze, "bin/strip_spaces".freeze, "bin/sync_dir".freeze, "bin/untest".freeze, "bin/utils-utilsrc".freeze, "bin/vcf2alias".freeze, "bin/yaml_check".freeze, "lib/utils.rb".freeze, "lib/utils/config_file.rb".freeze, "lib/utils/editor.rb".freeze, "lib/utils/file_xt.rb".freeze, "lib/utils/finder.rb".freeze, "lib/utils/grepper.rb".freeze, "lib/utils/irb.rb".freeze, "lib/utils/line_blamer.rb".freeze, "lib/utils/line_formatter.rb".freeze, "lib/utils/md5.rb".freeze, "lib/utils/patterns.rb".freeze, "lib/utils/probe_server.rb".freeze, "lib/utils/ssh_tunnel_specification.rb".freeze, "lib/utils/version.rb".freeze, "lib/utils/xt/source_location_extension.rb".freeze, "utils.gemspec".freeze]
17
17
  s.homepage = "http://github.com/flori/utils".freeze
18
18
  s.licenses = ["GPL-2.0".freeze]
19
19
  s.rdoc_options = ["--title".freeze, "Utils - Some useful command line utilities".freeze, "--main".freeze, "README.md".freeze]
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
32
32
  s.add_runtime_dependency(%q<mize>.freeze, ["~> 0.6".freeze])
33
33
  s.add_runtime_dependency(%q<search_ui>.freeze, ["~> 0.0".freeze])
34
34
  s.add_runtime_dependency(%q<all_images>.freeze, ["~> 0.5.0".freeze])
35
- s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 0.3.0".freeze])
35
+ s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 0.4.0".freeze])
36
36
  s.add_runtime_dependency(%q<simplecov>.freeze, [">= 0".freeze])
37
37
  s.add_runtime_dependency(%q<debug>.freeze, [">= 0".freeze])
38
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.52.0
4
+ version: 0.53.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-22 00:00:00.000000000 Z
11
+ date: 2024-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -156,14 +156,14 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 0.3.0
159
+ version: 0.4.0
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 0.3.0
166
+ version: 0.4.0
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: simplecov
169
169
  requirement: !ruby/object:Gem::Requirement
@@ -208,6 +208,7 @@ executables:
208
208
  - edit_wait
209
209
  - enum
210
210
  - git-empty
211
+ - git-md
211
212
  - git-versions
212
213
  - json_check
213
214
  - long_lines
@@ -266,6 +267,7 @@ files:
266
267
  - bin/edit_wait
267
268
  - bin/enum
268
269
  - bin/git-empty
270
+ - bin/git-md
269
271
  - bin/git-versions
270
272
  - bin/json_check
271
273
  - bin/long_lines