utils 0.60.0 → 0.60.2

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: 5d5a13dd0dc3c72e4110c54d7b218275b8ffe0aaffb79d1ad14d0e8c4de2201f
4
- data.tar.gz: e35c204313debe613cbe39e915f986d84faf6ff0ef9c0a7d3529eeabcab8f628
3
+ metadata.gz: 6248e316412b8927ac4a15ed491fdbe83d86db6f121d96de85eed9a6aa1cd400
4
+ data.tar.gz: 2845d382afc8c0a597a947c2213ba1043548a19031865db0f57a087e72a9c044
5
5
  SHA512:
6
- metadata.gz: f2755da93986eb39d4c2736578fa26acba7b8a3a4d8a56baaf30c509eb008260eb30281ad26dfba430ab5d031381f5f84ae8a0f4e2fdacc635e96aa105f0ec72
7
- data.tar.gz: 8169b9827f29e237e589e76cc98a732a0bda047f524eeccdeaf2e1a0aadc18accdc879fecdbb00c1b19fdb318b52dac193c795bba4cfddf4043db7ebaedd90fc
6
+ metadata.gz: 438e3e13d461aeb22ffbccac934906b98b52bcc1e31af6cb2eaf9006631f7ea11ddfe76ba78cb3bee85ba980eb4190c1db99b4e0b342ca046283cd47e6360830
7
+ data.tar.gz: 6643afbc8922f6711939cb91371e5b56310147ffcb7774ee4e950eeae0b041c52ac927f9a6b061ff7aa4ca19bdeece11a4fa42d05a8d9e4f76fd09677a3eda32
data/Rakefile CHANGED
@@ -29,7 +29,7 @@ GemHadar do
29
29
  dependency 'search_ui', '~> 0.0'
30
30
  dependency 'all_images', '~> 0.5.0'
31
31
  dependency 'ollama-ruby'
32
- dependency 'kramdown-ansi'
32
+ dependency 'kramdown-ansi', '~> 0.0.1'
33
33
  dependency 'simplecov'
34
34
  dependency 'debug'
35
35
 
data/bin/git-versions CHANGED
@@ -1,25 +1,25 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require 'tins/xt'
3
+ require 'tins'
4
4
  require 'term/ansicolor'
5
- include Tins::GO
6
-
7
- $opts = go 'r:v'
8
-
9
5
  class String
10
6
  include Term::ANSIColor
7
+ include Tins::StringVersion
11
8
  end
9
+ require 'shellwords'
12
10
 
13
- regexp = $opts[?r] && Regexp.new($opts[?r]) || /^v((?:\d+\.)*\d+)/
11
+ args = ARGV.dup
12
+ args.empty? and args.concat %w[ --color --stat ]
13
+
14
+ regexp = ENV['GIT_VERSIONS_REGEXP']
15
+ regexp = regexp ? Regexp.new(regexp) : /^v((?:\d+\.)*\d+)/
14
16
 
15
17
  versions = `git tag`.lines.map(&:chomp).grep(regexp).sort_by { |x|
16
18
  x[regexp, 1].version
17
19
  }.reverse
20
+
21
+ git_options = args.empty? ? ' ' : " #{Shellwords.join(args)} "
18
22
  versions.each_cons(2) do |new, old|
19
23
  puts "Version #{new}".red.bold
20
- if $opts[?v]
21
- puts `git log --color --stat -u #{old}..#{new}`
22
- else
23
- puts `git log --color --stat #{old}..#{new}`
24
- end
24
+ puts `git log #{git_options}#{old}..#{new}`
25
25
  end
data/bin/strip_spaces CHANGED
@@ -6,12 +6,9 @@ require 'tins/secure_write'
6
6
  include Tins::SecureWrite
7
7
  require 'tins/find'
8
8
  include Tins::Find
9
+ require 'tins/xt/file_binary'
9
10
  require 'utils'
10
11
 
11
- class ::File
12
- include Utils::FileXt
13
- end
14
-
15
12
  def usage
16
13
  puts <<-EOT
17
14
  Usage: #{File.basename($0)} [OPTS] [PATHS]
data/lib/utils/finder.rb CHANGED
@@ -5,10 +5,6 @@ require 'digest/md5'
5
5
  require 'fileutils'
6
6
  require 'mize'
7
7
 
8
- class ::File
9
- include Utils::FileXt
10
- end
11
-
12
8
  class Utils::Finder
13
9
  include Tins::Find
14
10
  include Utils::Patterns
data/lib/utils/grepper.rb CHANGED
@@ -1,10 +1,6 @@
1
1
  require 'term/ansicolor'
2
2
  require 'tins/xt'
3
3
 
4
- class ::File
5
- include Utils::FileXt
6
- end
7
-
8
4
  class Utils::Grepper
9
5
  include Tins::Find
10
6
  include Utils::Patterns
data/lib/utils/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Utils
2
2
  # Utils version
3
- VERSION = '0.60.0'
3
+ VERSION = '0.60.2'
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/lib/utils.rb CHANGED
@@ -1,6 +1,5 @@
1
1
  module Utils
2
2
  require 'utils/version'
3
- require 'utils/file_xt'
4
3
  require 'utils/md5'
5
4
  require 'utils/patterns'
6
5
  require 'utils/config_file'
data/utils.gemspec CHANGED
@@ -1,23 +1,23 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: utils 0.60.0 ruby lib
2
+ # stub: utils 0.60.2 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "utils".freeze
6
- s.version = "0.60.0".freeze
6
+ s.version = "0.60.2".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-31"
11
+ s.date = "2024-12-13"
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]
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]
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/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/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]
20
- s.rubygems_version = "3.5.22".freeze
20
+ s.rubygems_version = "3.5.23".freeze
21
21
  s.summary = "Some useful command line utilities".freeze
22
22
 
23
23
  s.specification_version = 4
@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
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
35
  s.add_runtime_dependency(%q<ollama-ruby>.freeze, [">= 0".freeze])
36
- s.add_runtime_dependency(%q<kramdown-ansi>.freeze, [">= 0".freeze])
36
+ s.add_runtime_dependency(%q<kramdown-ansi>.freeze, ["~> 0.0.1".freeze])
37
37
  s.add_runtime_dependency(%q<simplecov>.freeze, [">= 0".freeze])
38
38
  s.add_runtime_dependency(%q<debug>.freeze, [">= 0".freeze])
39
39
  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.60.0
4
+ version: 0.60.2
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-31 00:00:00.000000000 Z
11
+ date: 2024-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gem_hadar
@@ -168,16 +168,16 @@ dependencies:
168
168
  name: kramdown-ansi
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">="
171
+ - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '0'
173
+ version: 0.0.1
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '0'
180
+ version: 0.0.1
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: simplecov
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -248,7 +248,6 @@ extra_rdoc_files:
248
248
  - lib/utils.rb
249
249
  - lib/utils/config_file.rb
250
250
  - lib/utils/editor.rb
251
- - lib/utils/file_xt.rb
252
251
  - lib/utils/finder.rb
253
252
  - lib/utils/grepper.rb
254
253
  - lib/utils/irb.rb
@@ -303,7 +302,6 @@ files:
303
302
  - lib/utils.rb
304
303
  - lib/utils/config_file.rb
305
304
  - lib/utils/editor.rb
306
- - lib/utils/file_xt.rb
307
305
  - lib/utils/finder.rb
308
306
  - lib/utils/grepper.rb
309
307
  - lib/utils/irb.rb
@@ -339,7 +337,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
339
337
  - !ruby/object:Gem::Version
340
338
  version: '0'
341
339
  requirements: []
342
- rubygems_version: 3.5.22
340
+ rubygems_version: 3.5.23
343
341
  signing_key:
344
342
  specification_version: 4
345
343
  summary: Some useful command line utilities
data/lib/utils/file_xt.rb DELETED
@@ -1,46 +0,0 @@
1
- require 'tins'
2
-
3
- module Utils
4
- module FileXt
5
- extend DSLKit::Concern
6
- include File::Constants
7
-
8
- SEEK_SET = File::SEEK_SET
9
-
10
- ZERO = "\x00"
11
- BINARY = "\x01-\x1f\x7f-\xff"
12
-
13
- if defined?(::Encoding)
14
- ZERO.force_encoding(Encoding::ASCII_8BIT)
15
- BINARY.force_encoding(Encoding::ASCII_8BIT)
16
- end
17
-
18
- def binary?
19
- old_pos = tell
20
- seek 0, SEEK_SET
21
- data = read 2 ** 13
22
- !data or data.empty? and return nil
23
- data.count(ZERO) > 0 and return true
24
- data.count(BINARY).to_f / data.size > 0.3
25
- ensure
26
- seek old_pos, SEEK_SET
27
- end
28
-
29
- def ascii?
30
- case binary?
31
- when true then false
32
- when false then true
33
- end
34
- end
35
-
36
- module ClassMethods
37
- def binary?(name)
38
- File.open(name, 'rb') { |f| f.binary? }
39
- end
40
-
41
- def ascii?(name)
42
- File.open(name, 'rb') { |f| f.ascii? }
43
- end
44
- end
45
- end
46
- end