utils 0.57.0 → 0.58.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: 4abd94fcd2224832c93dc8a3b96be8d4e453595a8dc3c9a49054f26410949e06
4
- data.tar.gz: 181d44c9af9e8ca2c85522b8acea9e37e829ae99e14160037e32485a349de21c
3
+ metadata.gz: 9e6752e1ca730c5f10c631266c8bfff9f7a0e2b0992441352e0e46f345f0fda9
4
+ data.tar.gz: 8b0b060dc91580dbfd025ea00542b2f0534d564b4aee6af31371732c48cbc562
5
5
  SHA512:
6
- metadata.gz: acf4408a0f237e3a48d652e4868e1491ed7b59c294c3e6da4dd70ba17669061865f3ddc9b04f7f7762d0d2e3df7201afc377e1ec450239a2f8edef15f8c2d0ed
7
- data.tar.gz: 2ce6999f1c07e0524d7f0ec82fdd1a3340a7bae99fa340bdb6790be6382c87a3f86e99004e6989982d4db1fca924fd93e03a1cdc4f93ca3606d9d34c09534f25
6
+ metadata.gz: de648eaf2513ec70e337dcf16d0b4d9050027237806397f37cca4b8c8d4966b4a0dd35375f56f9cdb70c74a6ae1a4b4b5005d973db003f30797c08ffe4d68127
7
+ data.tar.gz: 64d54caa0581972f9b85ba81299283dd0e7d3f02ca7333bea539867f8519f2921b04bd2e0099a5799e6fec91044fca542d0546ba3c5b07b6357048a680785513
data/bin/changes CHANGED
@@ -80,7 +80,8 @@ def compute_change(range_from, range_to)
80
80
  )
81
81
 
82
82
  ollama = Client.new(base_url:, read_timeout: 120)
83
- changes = ollama.generate(model:, system:, prompt:, options:, stream: false).response
83
+ changes = ollama.generate(model:, system:, prompt:, options:, stream: false)
84
+ changes = changes.response.gsub(/\t/, ' ')
84
85
 
85
86
  return <<~EOT
86
87
 
data/bin/git-md CHANGED
@@ -3,9 +3,11 @@
3
3
  require 'utils/markdown'
4
4
  include Utils::Markdown
5
5
  require 'utils/pager'
6
+ require 'term/ansicolor'
7
+ include Term::ANSIColor
6
8
  require 'shellwords'
7
9
 
8
- 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%b%nMARKDOWN%n"}
10
+ cmd = %{git log --color=always --pretty=format:"commit %H%C(auto)%d%nDate: %Cgreen%cD (%cr)%Creset%nAuthor: %Cblue%an <%ae>%Creset%n%nMARKUP%n%s%n%n%b%nMARKDOWN%n"}
9
11
 
10
12
  core_pager = `git config get core.pager`.chomp.full?
11
13
  git_pager = ENV['GIT_PAGER'].full?
@@ -15,6 +17,14 @@ if fallback_pager = `which less`.chomp.full? || `which more`.chomp.full?
15
17
  end
16
18
  my_pager = git_pager || core_pager || default_pager || fallback_pager
17
19
 
20
+ repo_url = case git_origin_url = `git remote get-url origin`.chomp
21
+ when %r(\Ahttps://)
22
+ u = git_origin_url.sub(%r(\.git\z), '')
23
+ u << '/commit/'
24
+ when %r(\Agit@github.com:([^.]+))
25
+ "https://github.com/#$1/commit/"
26
+ end
27
+
18
28
  Utils::Pager.pager(command: my_pager) do |output|
19
29
  IO.popen("#{cmd} #{Shellwords.join(ARGV)}") do |log|
20
30
  until log.eof?
@@ -30,7 +40,9 @@ Utils::Pager.pager(command: my_pager) do |output|
30
40
  if message
31
41
  message << line
32
42
  else
33
- output.puts line
43
+ output.puts line.sub(/(?<=^commit )(\h{40})/) {
44
+ yellow { repo_url ? hyperlink(repo_url + $1) { $1 } : $1 }
45
+ }
34
46
  end
35
47
  end
36
48
  end
data/lib/utils/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.57.0'
3
+ VERSION = '0.58.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.57.0 ruby lib
2
+ # stub: utils 0.58.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "utils".freeze
6
- s.version = "0.57.0".freeze
6
+ s.version = "0.58.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-10-03"
11
+ s.date = "2024-10-04"
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-md".freeze, "git-versions".freeze, "json_check".freeze, "long_lines".freeze, "md".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]
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.57.0
4
+ version: 0.58.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-10-03 00:00:00.000000000 Z
11
+ date: 2024-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar