utils 0.60.1 → 0.60.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 88ba0780f681bd2eda0c0540db25a4aa5ca26a01f2147ded80e70f4536106438
4
- data.tar.gz: 054cec3fd556ab33f2c5458f0e7ce43e78cd1b86aac31ac031ce52452b320ea5
3
+ metadata.gz: 6248e316412b8927ac4a15ed491fdbe83d86db6f121d96de85eed9a6aa1cd400
4
+ data.tar.gz: 2845d382afc8c0a597a947c2213ba1043548a19031865db0f57a087e72a9c044
5
5
  SHA512:
6
- metadata.gz: 3421e11798a097f7d8342919e1e8dfe66d83d17981d1fe23257bbaa9f8ae1c1ac8feeccc9623577b73c6d1f106d794d397e5cd99ad254dcef4bc2dafefdd575c
7
- data.tar.gz: 14008c6d12939b0247679e285e45638bbc6abff83d14071babf9d3fb624284d7737eabd4311bf3e889f6655c2bd68cf84b08da41158a71d589b9fbe4bb19d990
6
+ metadata.gz: 438e3e13d461aeb22ffbccac934906b98b52bcc1e31af6cb2eaf9006631f7ea11ddfe76ba78cb3bee85ba980eb4190c1db99b4e0b342ca046283cd47e6360830
7
+ data.tar.gz: 6643afbc8922f6711939cb91371e5b56310147ffcb7774ee4e950eeae0b041c52ac927f9a6b061ff7aa4ca19bdeece11a4fa42d05a8d9e4f76fd09677a3eda32
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.1'
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.1 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.1".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
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.1
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
@@ -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