dsl_evaluator 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/dsl_evaluator/app.rb +1 -0
- data/lib/dsl_evaluator/printer.rb +31 -12
- data/lib/dsl_evaluator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d712162a49ab0151d9acb686bc7613b11f242a0187f95628b5617a2fe88de58
|
4
|
+
data.tar.gz: 481d6aea0a1800ad8efc46af97771b99925d69bc81231ff4673c02f01d3e0d52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0854ffb84d518b498c2c32ddc16cfa0f6306645be452574cf22e878a002959be6792bd4f7dd0ef4e1af20460ea5443f74164bdf5cbef58a8f0a6fd48429d0062'
|
7
|
+
data.tar.gz: d66dd8eaf3d9317e74227d9fef78cdfae27f6db990587b7c80a0be29ab1b2f47c2f87c83a408fccb9b59728ca55887121798473ffcefef92af2bffead1df6e38
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
4
4
|
This project *loosely tries* to adhere to [Semantic Versioning](http://semver.org/).
|
5
5
|
|
6
|
+
## [0.2.1] - 2022-02-25
|
7
|
+
- [#4](https://github.com/tongueroo/dsl_evaluator/pull/4) add config.select_pattern option
|
8
|
+
|
6
9
|
## [0.2.0] - 2022-02-24
|
7
10
|
- [#3](https://github.com/tongueroo/dsl_evaluator/pull/3) major improvements: configure ability
|
8
11
|
|
data/lib/dsl_evaluator/app.rb
CHANGED
@@ -54,18 +54,8 @@ module DslEvaluator
|
|
54
54
|
logger.error lines.join("\n")
|
55
55
|
end
|
56
56
|
|
57
|
-
|
58
|
-
|
59
|
-
if backtrace_reject
|
60
|
-
lines = lines.reject do |l|
|
61
|
-
if backtrace_reject.is_a?(String)
|
62
|
-
l.include?(backtrace_reject)
|
63
|
-
else
|
64
|
-
l.match(backtrace_reject)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
end
|
68
|
-
lines = lines.reject { |l| l.include?("lib/dsl_evaluator") } # ignore internal lib/dsl_evaluator backtrace lines
|
57
|
+
lines = reject(lines)
|
58
|
+
lines = select(lines)
|
69
59
|
|
70
60
|
error_info = lines.first
|
71
61
|
parts = error_info.split(':')
|
@@ -77,6 +67,35 @@ module DslEvaluator
|
|
77
67
|
{path: path, line_number: line_number}
|
78
68
|
end
|
79
69
|
|
70
|
+
def reject(lines)
|
71
|
+
# Keep DslEvaluator.backtrace_reject for backwards compatibility
|
72
|
+
pattern = config.backtrace.reject_pattern || DslEvaluator.backtrace_reject
|
73
|
+
return lines unless pattern
|
74
|
+
|
75
|
+
lines.reject! do |l|
|
76
|
+
if pattern.is_a?(String)
|
77
|
+
l.include?(pattern)
|
78
|
+
else
|
79
|
+
l.match(pattern)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
# Always ignore internal lib/dsl_evaluator backtrace lines
|
83
|
+
lines.reject { |l| l.include?("lib/dsl_evaluator") }
|
84
|
+
end
|
85
|
+
|
86
|
+
def select(lines)
|
87
|
+
pattern = config.backtrace.select_pattern
|
88
|
+
return unless pattern
|
89
|
+
|
90
|
+
lines.select do |l|
|
91
|
+
if pattern.is_a?(String)
|
92
|
+
l.include?(pattern)
|
93
|
+
else
|
94
|
+
l.match(pattern)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
98
|
+
|
80
99
|
def pretty_path(path)
|
81
100
|
path.sub("#{config.root}/",'')
|
82
101
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dsl_evaluator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tung Nguyen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-02-
|
11
|
+
date: 2022-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|