enhanced_errors 3.0.2 → 3.0.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/README.md +4 -3
- data/benchmark/benchmark.rb +31 -29
- data/benchmark/memory_bench.rb +1 -1
- data/benchmark/result.txt +13 -0
- data/doc/Enhanced/Colors.html +2 -2
- data/doc/Enhanced/Context.html +283 -0
- data/doc/Enhanced/ExceptionBindingInfos.html +255 -0
- data/doc/Enhanced/ExceptionContext.html +397 -0
- data/doc/Enhanced.html +8 -4
- data/doc/EnhancedErrors.html +385 -269
- data/doc/EnhancedExceptionContext.html +15 -15
- data/doc/Exception.html +5 -5
- data/doc/ExceptionBindingInfos.html +2 -2
- data/doc/Minitest.html +3 -3
- data/doc/_index.html +12 -6
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +9 -4
- data/doc/index.html +9 -4
- data/doc/method_list.html +34 -18
- data/doc/top-level-namespace.html +18 -8
- data/enhanced_errors.gemspec +1 -1
- data/lib/enhanced/context.rb +7 -5
- data/lib/enhanced/exception.rb +35 -36
- data/lib/enhanced/exception_context.rb +49 -0
- data/lib/enhanced/minitest_patch.rb +1 -1
- data/lib/enhanced_errors.rb +170 -122
- metadata +8 -9
- data/.yardoc/checksums +0 -6
- data/.yardoc/complete +0 -0
- data/.yardoc/object_types +0 -0
- data/.yardoc/objects/root.dat +0 -0
- data/.yardoc/proxy_types +0 -0
- data/lib/enhanced/enhanced_exception_context.rb +0 -47
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enhanced_errors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Beland
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-12-
|
11
|
+
date: 2024-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: awesome_print
|
@@ -74,19 +74,18 @@ executables: []
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
-
- ".yardoc/checksums"
|
78
|
-
- ".yardoc/complete"
|
79
|
-
- ".yardoc/object_types"
|
80
|
-
- ".yardoc/objects/root.dat"
|
81
|
-
- ".yardoc/proxy_types"
|
82
77
|
- LICENSE
|
83
78
|
- README.md
|
84
79
|
- benchmark/benchmark.rb
|
85
80
|
- benchmark/memory_bench.rb
|
81
|
+
- benchmark/result.txt
|
86
82
|
- benchmark/stackprofile.rb
|
87
83
|
- doc/Context.html
|
88
84
|
- doc/Enhanced.html
|
89
85
|
- doc/Enhanced/Colors.html
|
86
|
+
- doc/Enhanced/Context.html
|
87
|
+
- doc/Enhanced/ExceptionBindingInfos.html
|
88
|
+
- doc/Enhanced/ExceptionContext.html
|
90
89
|
- doc/Enhanced/Integrations.html
|
91
90
|
- doc/Enhanced/Integrations/RSpecErrorFailureMessage.html
|
92
91
|
- doc/EnhancedErrors.html
|
@@ -117,8 +116,8 @@ files:
|
|
117
116
|
- examples/demo_rspec.rb
|
118
117
|
- lib/enhanced/colors.rb
|
119
118
|
- lib/enhanced/context.rb
|
120
|
-
- lib/enhanced/enhanced_exception_context.rb
|
121
119
|
- lib/enhanced/exception.rb
|
120
|
+
- lib/enhanced/exception_context.rb
|
122
121
|
- lib/enhanced/minitest_patch.rb
|
123
122
|
- lib/enhanced_errors.rb
|
124
123
|
homepage: https://github.com/ericbeland/enhanced_errors
|
@@ -141,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
140
|
- !ruby/object:Gem::Version
|
142
141
|
version: '0'
|
143
142
|
requirements: []
|
144
|
-
rubygems_version: 3.
|
143
|
+
rubygems_version: 3.3.26
|
145
144
|
signing_key:
|
146
145
|
specification_version: 4
|
147
146
|
summary: Automatically enhance your errors with messages containing variable values
|
data/.yardoc/checksums
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
lib/enhanced/colors.rb ed3b11d00ff9ceed089d4a65f0be5b3fca64bbe6
|
2
|
-
lib/enhanced_errors.rb f79331fea888262a0447d2fff4e5067fdf1418a9
|
3
|
-
lib/enhanced/context.rb 24ca2d1f4ee2ff48dd83c913ad1f1e7c1aa367c4
|
4
|
-
lib/enhanced/exception.rb 5572411e9e32bbe9ed01b98787e1a53a4ab61408
|
5
|
-
lib/enhanced/minitest_patch.rb 3e7fb88ddc37a1f966877735a43ae206ee396bbc
|
6
|
-
lib/enhanced/enhanced_exception_context.rb 23423dbdb33b7961a0b8a297e052ebb2fbe1c6ac
|
data/.yardoc/complete
DELETED
File without changes
|
data/.yardoc/object_types
DELETED
Binary file
|
data/.yardoc/objects/root.dat
DELETED
Binary file
|
data/.yardoc/proxy_types
DELETED
Binary file
|
@@ -1,47 +0,0 @@
|
|
1
|
-
require 'weakref'
|
2
|
-
|
3
|
-
require_relative 'context'
|
4
|
-
|
5
|
-
require 'weakref'
|
6
|
-
require 'monitor'
|
7
|
-
|
8
|
-
module EnhancedExceptionContext
|
9
|
-
extend self
|
10
|
-
|
11
|
-
REGISTRY = {}
|
12
|
-
MUTEX = Monitor.new
|
13
|
-
|
14
|
-
def store_context(exception, context)
|
15
|
-
MUTEX.synchronize do
|
16
|
-
REGISTRY[exception.object_id] = { weak_exc: WeakRef.new(exception), context: context }
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
def context_for(exception)
|
21
|
-
MUTEX.synchronize do
|
22
|
-
entry = REGISTRY[exception.object_id]
|
23
|
-
return nil unless entry
|
24
|
-
|
25
|
-
begin
|
26
|
-
_ = entry[:weak_exc].__getobj__ # ensure exception is still alive
|
27
|
-
entry[:context]
|
28
|
-
rescue RefError
|
29
|
-
# Exception no longer alive, clean up
|
30
|
-
REGISTRY.delete(exception.object_id)
|
31
|
-
nil
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def clear_context(exception)
|
37
|
-
MUTEX.synchronize do
|
38
|
-
REGISTRY.delete(exception.object_id)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def clear_all
|
43
|
-
MUTEX.synchronize do
|
44
|
-
REGISTRY.clear
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|