scout-essentials 1.6.3 → 1.6.4
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/.vimproject +5 -0
- data/VERSION +1 -1
- data/lib/scout/annotation/annotation_module.rb +5 -1
- data/lib/scout/annotation/array.rb +9 -1
- data/lib/scout/indiferent_hash.rb +7 -0
- data/lib/scout/log.rb +10 -5
- data/lib/scout/misc/format.rb +3 -3
- data/lib/scout/named_array.rb +4 -0
- data/lib/scout/open.rb +2 -2
- data/lib/scout/resource/produce.rb +1 -0
- data/lib/scout/tmpfile.rb +1 -0
- data/scout-essentials.gemspec +4 -4
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 733fb62cfc8f1119cc35567f30bec3f569856a2c10e7fa4ab8dcb54fb39cf737
|
4
|
+
data.tar.gz: abc7a2a0ffa9c524da167c1f2132efb557a6ebd7debe267e014bba1269a31661
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cdd5c50d28fa8ffac0c5f1660ab5ff8b0e63c3df7d27966cb98c78928161c78270b3bab72732c5eeb5c37a1824fc101fdb2b569567b3af977404f540fb5912de
|
7
|
+
data.tar.gz: c4f4e5f5f7b276d20ea65ef22d8447c0499606a3b9c590768517808f6f226c137361b38f1dc56c5e90f2a7652d8519f9cfc591438f939ed2345de2c999f05139
|
data/.vimproject
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.6.
|
1
|
+
1.6.4
|
@@ -34,7 +34,11 @@ module Annotation
|
|
34
34
|
end
|
35
35
|
obj = block if obj.nil?
|
36
36
|
return nil if obj.nil?
|
37
|
-
|
37
|
+
begin
|
38
|
+
obj.extend self unless self === obj
|
39
|
+
rescue TypeError
|
40
|
+
return obj
|
41
|
+
end
|
38
42
|
attrs = self.instance_variable_get("@annotations")
|
39
43
|
|
40
44
|
return obj if attrs.nil? || attrs.empty?
|
@@ -34,7 +34,7 @@ module AnnotatedArray
|
|
34
34
|
|
35
35
|
def each_with_index(&block)
|
36
36
|
super do |item,i|
|
37
|
-
block.call annotate_item(item, i)
|
37
|
+
block.call annotate_item(item, i), i
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
@@ -70,6 +70,14 @@ module AnnotatedArray
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
+
def subset(list)
|
74
|
+
self.annotate(self & list)
|
75
|
+
end
|
76
|
+
|
77
|
+
def remove(list)
|
78
|
+
self.annotate(self - list)
|
79
|
+
end
|
80
|
+
|
73
81
|
%w(compact uniq flatten reverse sort_by).each do |method|
|
74
82
|
|
75
83
|
self.define_method(method) do |*args,&block|
|
data/lib/scout/log.rb
CHANGED
@@ -252,14 +252,18 @@ module Log
|
|
252
252
|
end
|
253
253
|
|
254
254
|
def self.exception(e)
|
255
|
-
|
255
|
+
return if e.message.include?("NOLOG")
|
256
|
+
last_caller = last_caller caller
|
257
|
+
message = e.message
|
258
|
+
message = Log.fingerprint(message) if String === message && message.length > 1000
|
256
259
|
backtrace = e.backtrace || []
|
260
|
+
backtrace = [] if message.include?("NOSTACK")
|
257
261
|
if ENV["SCOUT_ORIGINAL_STACK"] == 'true'
|
258
|
-
error([e.class.to_s,
|
259
|
-
error("BACKTRACE [#{Process.pid}]: " <<
|
262
|
+
error([e.class.to_s, message].compact * ": " )
|
263
|
+
error("BACKTRACE [#{Process.pid}]: " << last_caller << "\n" + color_stack(backtrace)*"\n")
|
260
264
|
else
|
261
|
-
error("BACKTRACE [#{Process.pid}]: " <<
|
262
|
-
error([e.class.to_s,
|
265
|
+
error("BACKTRACE [#{Process.pid}]: " << last_caller << "\n" + color_stack(backtrace.reverse)*"\n")
|
266
|
+
error([e.class.to_s, message].compact * ": " )
|
263
267
|
end
|
264
268
|
end
|
265
269
|
|
@@ -355,6 +359,7 @@ def ppp(message)
|
|
355
359
|
stack = caller
|
356
360
|
puts "#{Log.color :cyan, "PRINT:"} " << stack.first
|
357
361
|
puts ""
|
362
|
+
message = message.prety_print if message.respond_to?(:prety_print)
|
358
363
|
if message.length > 200 or message.include? "\n"
|
359
364
|
puts Log.color(:cyan, "=>|") << "\n" << message.to_s
|
360
365
|
else
|
data/lib/scout/misc/format.rb
CHANGED
@@ -72,7 +72,7 @@ module Misc
|
|
72
72
|
end*""
|
73
73
|
end
|
74
74
|
|
75
|
-
def self.format_definition_list_item(dt, dd, indent = nil, size = nil, color
|
75
|
+
def self.format_definition_list_item(dt, dd, indent = nil, size = nil, color: :yellow)
|
76
76
|
if size.nil?
|
77
77
|
base_size = MAX_TTY_LINE_WIDTH
|
78
78
|
base_indent = indent || (base_size / 3)
|
@@ -98,12 +98,12 @@ module Misc
|
|
98
98
|
text
|
99
99
|
end
|
100
100
|
|
101
|
-
def self.format_definition_list(defs, indent = nil, size = nil, color
|
101
|
+
def self.format_definition_list(defs, indent = nil, size = nil, color: :yellow, sep: "\n\n")
|
102
102
|
indent ||= 30
|
103
103
|
size ||= (Log.tty_size || MAX_TTY_LINE_WIDTH) - indent
|
104
104
|
entries = []
|
105
105
|
defs.each do |dt,dd|
|
106
|
-
text = format_definition_list_item(dt,dd,indent, size,color)
|
106
|
+
text = format_definition_list_item(dt,dd,indent, size, color: color)
|
107
107
|
entries << text
|
108
108
|
end
|
109
109
|
entries * sep
|
data/lib/scout/named_array.rb
CHANGED
data/lib/scout/open.rb
CHANGED
@@ -68,11 +68,11 @@ module Open
|
|
68
68
|
|
69
69
|
options = IndiferentHash.add_defaults options, :noz => false, :mode => 'r'
|
70
70
|
|
71
|
-
mode = IndiferentHash.process_options options, :mode
|
71
|
+
mode, grep, invert_grep, fixed_grep = IndiferentHash.process_options options, :mode, :grep, :invert_grep, :fixed_grep
|
72
72
|
|
73
73
|
options[:noz] = true if mode.include? "w"
|
74
74
|
|
75
|
-
io = file_open(file,
|
75
|
+
io = file_open(file, grep, mode, invert_grep, fixed_grep, options)
|
76
76
|
|
77
77
|
io = unzip(io) if ((String === file and zip?(file)) and not options[:noz]) or options[:zip]
|
78
78
|
io = gunzip(io) if ((String === file and gzip?(file)) and not options[:noz]) or options[:gzip]
|
data/lib/scout/tmpfile.rb
CHANGED
@@ -31,6 +31,7 @@ module TmpFile
|
|
31
31
|
# Creates a random filename in the temporary directory
|
32
32
|
def self.tmp_file(prefix = 'tmp-', max = 1_000_000_000, dir = nil)
|
33
33
|
dir ||= TmpFile.tmpdir
|
34
|
+
dir = dir.find if Path === dir
|
34
35
|
File.expand_path(File.join(dir, random_name(prefix, max)))
|
35
36
|
end
|
36
37
|
|
data/scout-essentials.gemspec
CHANGED
@@ -2,16 +2,16 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: scout-essentials 1.6.
|
5
|
+
# stub: scout-essentials 1.6.4 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "scout-essentials".freeze
|
9
|
-
s.version = "1.6.
|
9
|
+
s.version = "1.6.4".freeze
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
13
13
|
s.authors = ["Miguel Vazquez".freeze]
|
14
|
-
s.date = "2024-10
|
14
|
+
s.date = "2024-12-10"
|
15
15
|
s.description = "Things a scout can use anywhere".freeze
|
16
16
|
s.email = "mikisvaz@gmail.com".freeze
|
17
17
|
s.extra_rdoc_files = [
|
@@ -138,7 +138,7 @@ Gem::Specification.new do |s|
|
|
138
138
|
]
|
139
139
|
s.homepage = "http://github.com/mikisvaz/scout-essentials".freeze
|
140
140
|
s.licenses = ["MIT".freeze]
|
141
|
-
s.rubygems_version = "3.5.
|
141
|
+
s.rubygems_version = "3.5.23".freeze
|
142
142
|
s.summary = "Scout essential tools".freeze
|
143
143
|
|
144
144
|
s.specification_version = 4
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scout-essentials
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.6.
|
4
|
+
version: 1.6.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Miguel Vazquez
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10
|
11
|
+
date: 2024-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shoulda
|
@@ -251,7 +251,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
251
251
|
- !ruby/object:Gem::Version
|
252
252
|
version: '0'
|
253
253
|
requirements: []
|
254
|
-
rubygems_version: 3.5.
|
254
|
+
rubygems_version: 3.5.23
|
255
255
|
signing_key:
|
256
256
|
specification_version: 4
|
257
257
|
summary: Scout essential tools
|