openhab-scripting 3.2.0 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0be2b09569b3f3e96c5a79dbec4c6b0be6616a46d013831650c1e5d60cee374f
4
- data.tar.gz: f71890c321e188f6322191e0c40099a6de22bc086d89085743b0c20f6b211649
3
+ metadata.gz: 90af7470bbd47fa813a1a4a5a9083f178a36225ab6f9cfbd2ff1852cc0eb4c92
4
+ data.tar.gz: 789d9c72ce03d498416bf53c86d6b7f895df8296d849f702b59398e831aad6f1
5
5
  SHA512:
6
- metadata.gz: ff1e955329247a70b39158dff4a3694f51e2974fb11ce18260ff7048b686ac1181a99c7e941299def6f77697cacdaabf8f67e72d5c8bc0193f3b4334df761f94
7
- data.tar.gz: db0fb2c35af26aaa963107b7971e83bfbfdd43c42d951cc470dec1192e8f743978ed91e04859953b5970e076516c275f7133784d12545a842e856181e76ef5af
6
+ metadata.gz: 9066fe74d2d508e06ce9a62244a19a75470fcffb85bdbcaa2c899b5220a15da351ae4f55be08fb80d3c3222a1a26d16471420049b8621a60d143f16b867d7180
7
+ data.tar.gz: 53d1df31662e7552566d6dd92237b862b32f988e4edf42bc95b44fff3af425e5a038771c2372e2fe71928867c41962907825a24e05fbf3e91ed31f5ff6ee2778
@@ -22,9 +22,21 @@ module OpenHAB
22
22
  #
23
23
  # Regex for matching internal calls in a stack trace
24
24
  #
25
- INTERNAL_CALL_REGEX = %r{(openhab-scripting-.*/lib)|(org/jruby/)}.freeze
25
+ INTERNAL_CALL_REGEX = %r{(openhab-scripting-.*/lib)|org[./]jruby}.freeze
26
26
  private_constant :INTERNAL_CALL_REGEX
27
27
 
28
+ #
29
+ # Regex for matching internal calls in a java stack trace
30
+ #
31
+ EXCLUDED_JAVA_PACKAGES = /jdk\.internal\.reflect|java\.lang\.reflect|org\.openhab|java\.lang\.Thread\.run/.freeze
32
+ private_constant :EXCLUDED_JAVA_PACKAGES
33
+
34
+ #
35
+ # Regex for matching internal calls in a java stack trace
36
+ #
37
+ JAVA_INTERNAL_CALL_REGEX = Regexp.union(INTERNAL_CALL_REGEX, EXCLUDED_JAVA_PACKAGES).freeze
38
+ private_constant :JAVA_INTERNAL_CALL_REGEX
39
+
28
40
  #
29
41
  # Create a new logger
30
42
  #
@@ -60,8 +72,13 @@ module OpenHAB
60
72
  def clean_backtrace(error)
61
73
  return error if debug_enabled?
62
74
 
63
- backtrace = error.backtrace_locations.reject { |line| INTERNAL_CALL_REGEX.match? line.to_s }
64
- error.set_backtrace(backtrace.map(&:to_s))
75
+ if error.respond_to? :backtrace_locations
76
+ backtrace = error.backtrace_locations.map(&:to_s).reject { |line| INTERNAL_CALL_REGEX.match? line }
77
+ error.set_backtrace(backtrace)
78
+ elsif error.respond_to? :stack_trace
79
+ backtrace = error.stack_trace.reject { |line| JAVA_INTERNAL_CALL_REGEX.match? line.to_s }
80
+ error.set_stack_trace(backtrace)
81
+ end
65
82
  error
66
83
  end
67
84
 
@@ -5,5 +5,5 @@
5
5
  #
6
6
  module OpenHAB
7
7
  # @return [String] Version of OpenHAB helper libraries
8
- VERSION = '3.2.0'
8
+ VERSION = '3.2.1'
9
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openhab-scripting
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.0
4
+ version: 3.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian O'Connell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-10 00:00:00.000000000 Z
11
+ date: 2021-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler