utils 0.75.0 → 0.77.0
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 +4 -4
- data/.utilsrc +35 -0
- data/Rakefile +1 -1
- data/bin/long_lines +8 -3
- data/lib/utils/config_file.rb +29 -1
- data/lib/utils/irb.rb +6 -6
- data/lib/utils/version.rb +1 -1
- data/utils.gemspec +4 -4
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0559c787238a9e2345ac57f20e7e52e49a57c4f5fe170bea660a3826100dbeb8'
|
4
|
+
data.tar.gz: 4c7b194483b5a03072fd9cd8a38507e9dbc53a07a2fefc8cc9c113753ef86758
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d63b8970d4247725e380ee19e741787cbce2650a3492063e9e9e54fbfec8a60fe2660cf4a1df30f2f56e8b30787093f5a8feb84794d81b88b5596d6db22a3bb4
|
7
|
+
data.tar.gz: d5fea9b9c91c9cb81c9415119ad862d505daa0bd6f5503bc0bbc8c2288a93fe9cb27ce101445da2e48ac738f21e5385a8373a80d597d7cf50f7eac20a2946b4d
|
data/.utilsrc
CHANGED
@@ -34,4 +34,39 @@ end
|
|
34
34
|
|
35
35
|
code_indexer do
|
36
36
|
verbose true
|
37
|
+
gems = %w[
|
38
|
+
all_images
|
39
|
+
amatch
|
40
|
+
base64
|
41
|
+
bigdecimal
|
42
|
+
complex_config
|
43
|
+
context_spook
|
44
|
+
date
|
45
|
+
debug
|
46
|
+
excon
|
47
|
+
gem_hader
|
48
|
+
infobar
|
49
|
+
json
|
50
|
+
kramdown-ansi
|
51
|
+
logger
|
52
|
+
mize
|
53
|
+
ollama-ruby
|
54
|
+
ostruct
|
55
|
+
parser
|
56
|
+
pstree
|
57
|
+
rake
|
58
|
+
search_ui
|
59
|
+
simplecov
|
60
|
+
stringio
|
61
|
+
sync
|
62
|
+
term-ansicolor
|
63
|
+
tins
|
64
|
+
unix_socks
|
65
|
+
utils
|
66
|
+
webrick
|
67
|
+
yard
|
68
|
+
]
|
69
|
+
paths {
|
70
|
+
%w[ lib ] + gems.map { `bundle show #{it}` }.map(&:chomp)
|
71
|
+
}
|
37
72
|
end
|
data/Rakefile
CHANGED
data/bin/long_lines
CHANGED
@@ -14,16 +14,21 @@ include Tins::GO
|
|
14
14
|
require 'utils'
|
15
15
|
require 'term/ansicolor'
|
16
16
|
|
17
|
-
$opts = go 'm:h'
|
17
|
+
$opts = go 'm:h', defaults: { ?m => default_m = 80 }
|
18
18
|
|
19
19
|
if $opts[?h]
|
20
20
|
puts <<~USAGE
|
21
21
|
#{File.basename($0)} [OPTIONS] [FILES]
|
22
|
+
|
23
|
+
Options:
|
24
|
+
-m NUM Maximum line length (default: #{default_m})
|
25
|
+
-h Show this help message
|
26
|
+
|
22
27
|
USAGE
|
23
28
|
exit
|
24
29
|
end
|
25
|
-
max = ($opts[?m] || 80).to_i
|
26
30
|
|
31
|
+
max = $opts[?m].to_i
|
27
32
|
files = ARGV
|
28
33
|
|
29
34
|
files.each do |file|
|
@@ -34,7 +39,7 @@ files.each do |file|
|
|
34
39
|
lineno = f.lineno
|
35
40
|
blamer = Utils::LineBlamer.new(file, lineno) or next
|
36
41
|
blame = blamer.perform or next
|
37
|
-
author = blame[/\((.*?)\d{4}/, 1]
|
42
|
+
author = (blame[/\((.*?)\d{4}/, 1] || 'unknown').strip
|
38
43
|
puts [ author, size, "#{file}:#{lineno}" ] * ?\t
|
39
44
|
end
|
40
45
|
end
|
data/lib/utils/config_file.rb
CHANGED
@@ -8,6 +8,11 @@ require 'tins'
|
|
8
8
|
# provide centralized configuration management.
|
9
9
|
class Utils::ConfigFile
|
10
10
|
class << self
|
11
|
+
|
12
|
+
# The config_file_paths accessor method provides read and write access to
|
13
|
+
# the config_file_paths instance variable.
|
14
|
+
#
|
15
|
+
# @return [ Array<String> ] the array of configuration file paths
|
11
16
|
attr_accessor :config_file_paths
|
12
17
|
end
|
13
18
|
self.config_file_paths = [
|
@@ -126,6 +131,27 @@ class Utils::ConfigFile
|
|
126
131
|
self
|
127
132
|
end
|
128
133
|
|
134
|
+
# The lazy_config method configures a lazy-loaded configuration option
|
135
|
+
# with a default value.
|
136
|
+
#
|
137
|
+
# This method registers a new configuration setting that will be
|
138
|
+
# initialized lazily, meaning the default value or the set value is only
|
139
|
+
# computed when the configuration is actually accessed. It adds the
|
140
|
+
# setting to the list of configuration settings and creates a lazy
|
141
|
+
# accessor for it.
|
142
|
+
#
|
143
|
+
# @param name [ Object ] the name of the configuration setting to define
|
144
|
+
# @yield [ default ] optional block that provides the default value for
|
145
|
+
# the configuration
|
146
|
+
#
|
147
|
+
# @return [ Object ] returns self to allow for method chaining
|
148
|
+
def lazy_config(name, &default)
|
149
|
+
self.config_settings ||= []
|
150
|
+
config_settings << name.to_sym
|
151
|
+
dsl_lazy_accessor(name, &default)
|
152
|
+
self
|
153
|
+
end
|
154
|
+
|
129
155
|
# The config_settings method provides access to the configuration
|
130
156
|
# settings.
|
131
157
|
#
|
@@ -426,7 +452,9 @@ class Utils::ConfigFile
|
|
426
452
|
class CodeIndexer < BlockConfig
|
427
453
|
config :verbose, false
|
428
454
|
|
429
|
-
|
455
|
+
lazy_config :paths do
|
456
|
+
%w[ bin lib spec tests ]
|
457
|
+
end
|
430
458
|
|
431
459
|
config :formats, {
|
432
460
|
'ctags' => 'tags',
|
data/lib/utils/irb.rb
CHANGED
@@ -333,13 +333,13 @@ module Utils
|
|
333
333
|
# @param modul [ TrueClass, FalseClass ] flag indicating whether to retrieve an instance method
|
334
334
|
def initialize(obj, name, modul)
|
335
335
|
super(name)
|
336
|
-
@
|
337
|
-
@description = @
|
336
|
+
@wrapped_method = modul ? obj.instance_method(name) : obj.method(name)
|
337
|
+
@description = @wrapped_method.description(style: :namespace)
|
338
338
|
end
|
339
339
|
|
340
340
|
# The method reader returns the method object associated with the
|
341
341
|
# instance.
|
342
|
-
attr_reader :
|
342
|
+
attr_reader :wrapped_method
|
343
343
|
|
344
344
|
# The owner method retrieves the owner of the method object.
|
345
345
|
#
|
@@ -348,14 +348,14 @@ module Utils
|
|
348
348
|
#
|
349
349
|
# @return [ Object, nil ] the owner of the method or nil if not applicable
|
350
350
|
def owner
|
351
|
-
|
351
|
+
@wrapped_method.respond_to?(:owner) ? @wrapped_method.owner : nil
|
352
352
|
end
|
353
353
|
|
354
354
|
# The arity method returns the number of parameters expected by the method.
|
355
355
|
#
|
356
356
|
# @return [ Integer ] the number of required parameters for the method
|
357
357
|
def arity
|
358
|
-
|
358
|
+
@wrapped_method.arity
|
359
359
|
end
|
360
360
|
|
361
361
|
# The source_location method retrieves the file path and line number
|
@@ -368,7 +368,7 @@ module Utils
|
|
368
368
|
# @return [ Array<String, Integer> ] an array containing the filename and line number
|
369
369
|
# where the method is defined, or nil if the location cannot be determined
|
370
370
|
def source_location
|
371
|
-
|
371
|
+
@wrapped_method.source_location
|
372
372
|
end
|
373
373
|
|
374
374
|
# The <=> method compares the descriptions of two objects for ordering
|
data/lib/utils/version.rb
CHANGED
data/utils.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: utils 0.
|
2
|
+
# stub: utils 0.77.0 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "utils".freeze
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.77.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]
|
@@ -23,11 +23,11 @@ Gem::Specification.new do |s|
|
|
23
23
|
|
24
24
|
s.specification_version = 4
|
25
25
|
|
26
|
-
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 2.
|
26
|
+
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 2.5".freeze])
|
27
27
|
s.add_development_dependency(%q<test-unit>.freeze, [">= 0".freeze])
|
28
28
|
s.add_runtime_dependency(%q<unix_socks>.freeze, [">= 0".freeze])
|
29
29
|
s.add_runtime_dependency(%q<webrick>.freeze, [">= 0".freeze])
|
30
|
-
s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.
|
30
|
+
s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.43".freeze])
|
31
31
|
s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.11".freeze])
|
32
32
|
s.add_runtime_dependency(%q<pstree>.freeze, ["~> 0.3".freeze])
|
33
33
|
s.add_runtime_dependency(%q<infobar>.freeze, ["~> 0.8".freeze])
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.77.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
@@ -15,14 +15,14 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: '2.
|
18
|
+
version: '2.5'
|
19
19
|
type: :development
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - "~>"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: '2.
|
25
|
+
version: '2.5'
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: test-unit
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -71,14 +71,14 @@ dependencies:
|
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '1.
|
74
|
+
version: '1.43'
|
75
75
|
type: :runtime
|
76
76
|
prerelease: false
|
77
77
|
version_requirements: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '1.
|
81
|
+
version: '1.43'
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
83
|
name: term-ansicolor
|
84
84
|
requirement: !ruby/object:Gem::Requirement
|