low_type 0.7.2 → 0.7.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/lib/error_types.rb +5 -0
- data/lib/proxies/local_proxy.rb +1 -1
- data/lib/proxies/param_proxy.rb +1 -1
- data/lib/proxies/return_proxy.rb +1 -1
- data/lib/type_expression.rb +10 -5
- data/lib/version.rb +1 -1
- metadata +2 -2
- data/lib/errors.rb +0 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c5873e2b3ecceaa3a28a589739addeb22c0914c808b0e7edcfbad5b3194c8bc9
|
|
4
|
+
data.tar.gz: 6a5f1d91ee6307859d743fe0a0958c498d253ea2665aae10d966682019ed7e2b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 391d16f40bbaad2191ab9bbe1d98b3a2607af954c57b03d7000af5a94b232a2b43695a344846676725b571e122adce0ca68ee123a809633a4107adbc14aa49ab
|
|
7
|
+
data.tar.gz: 4bf9a082a30330a929b9190009da152755d45cb8e213203d206305f8a8fcd16fa19b9a893f40de05078cc73bc37809609b7bd9f2cdd1d5224ca1ebb079df9c13
|
data/lib/error_types.rb
ADDED
data/lib/proxies/local_proxy.rb
CHANGED
data/lib/proxies/param_proxy.rb
CHANGED
data/lib/proxies/return_proxy.rb
CHANGED
data/lib/type_expression.rb
CHANGED
|
@@ -46,15 +46,20 @@ module LowType
|
|
|
46
46
|
|
|
47
47
|
raise proxy.error_type, proxy.error_message(value:)
|
|
48
48
|
rescue proxy.error_type => e
|
|
49
|
+
file_paths = [FILE_PATH, LowType::Redefiner::FILE_PATH]
|
|
50
|
+
raise proxy.error_type, e.message, backtrace_with_proxy(file_paths:, backtrace: e.backtrace, proxy:)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def backtrace_with_proxy(file_paths:, proxy:, backtrace:)
|
|
49
54
|
# Remove LowType file paths from the backtrace.
|
|
50
|
-
|
|
51
|
-
external_backtrace = e.backtrace.reject { |line| internal_file_paths.include?(line.split(':').first) }
|
|
55
|
+
filtered_backtrace = backtrace.reject { |line| file_paths.find { |file_path| line.include?(file_path) } }
|
|
52
56
|
|
|
53
57
|
# Add the proxied file to the backtrace.
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
proxy_file_backtrace = "#{proxy.file.path}:#{proxy.file.line}:in '#{proxy.file.scope}'"
|
|
59
|
+
from_prefix = filtered_backtrace.first.match(/\s+from /)
|
|
60
|
+
proxy_file_backtrace = "#{from_prefix}#{proxy_file_backtrace}" if from_prefix
|
|
56
61
|
|
|
57
|
-
|
|
62
|
+
[proxy_file_backtrace, *filtered_backtrace]
|
|
58
63
|
end
|
|
59
64
|
|
|
60
65
|
def valid_types
|
data/lib/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: low_type
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.7.
|
|
4
|
+
version: 0.7.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- maedi
|
|
@@ -17,7 +17,7 @@ executables: []
|
|
|
17
17
|
extensions: []
|
|
18
18
|
extra_rdoc_files: []
|
|
19
19
|
files:
|
|
20
|
-
- lib/
|
|
20
|
+
- lib/error_types.rb
|
|
21
21
|
- lib/interfaces/error_interface.rb
|
|
22
22
|
- lib/low_type.rb
|
|
23
23
|
- lib/parser.rb
|
data/lib/errors.rb
DELETED