eturem 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/eturem.rb +17 -0
- data/lib/eturem/base.rb +5 -6
- data/lib/eturem/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: a8a5047f8abece1142eb4b66a8f82a0dc4cb0beec433d6927754282f2921b51a
|
4
|
+
data.tar.gz: 49fbfaa759957bc31b949dbdf2cb82eab9b27359089a1f183b0bd7831ced62c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e5cace0860ff7e4390a2fcdc824933a0370290dc3e905166908c868984a823a31134ee8a5bf2d6e7feb5694ef763234e28b8c91c1a4c5bdcbfaf3cf3e97bfe2c
|
7
|
+
data.tar.gz: 428ec5fbea0f432c6df6224127448a2db87e8fbf15a5b8f0f2cbebdfe210763661acd96d7048a65ec27358966f85b3735b3b2b380b8f650348f964cce348d902
|
data/lib/eturem.rb
CHANGED
@@ -36,6 +36,23 @@ if enable
|
|
36
36
|
Eturem::Base.before_line_num = before_line_num
|
37
37
|
Eturem::Base.after_line_num = after_line_num
|
38
38
|
|
39
|
+
if File.exist?($PROGRAM_NAME)
|
40
|
+
program_file = File.open($PROGRAM_NAME, "rb")
|
41
|
+
script = program_file.read
|
42
|
+
if script.match(/^__END__\R/)
|
43
|
+
program_file.pos = Regexp.last_match.end(0)
|
44
|
+
encoding = "utf-8"
|
45
|
+
if script.match(/\A(?:#!.*\R)?#.*coding *[:=] *(?<encoding>[^\s:]+)/)
|
46
|
+
encoding = Regexp.last_match(:encoding)
|
47
|
+
end
|
48
|
+
program_file.set_encoding(encoding)
|
49
|
+
Object.const_set(:DATA, program_file)
|
50
|
+
program_file
|
51
|
+
else
|
52
|
+
program_file.close
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
39
56
|
eturem_path = File.expand_path("..", __FILE__)
|
40
57
|
last_binding = nil
|
41
58
|
tracepoint = TracePoint.trace(:raise) do |tp|
|
data/lib/eturem/base.rb
CHANGED
@@ -115,12 +115,11 @@ module Eturem
|
|
115
115
|
|
116
116
|
|
117
117
|
def eturem_prepare
|
118
|
-
|
119
|
-
@eturem_backtrace_locations = self.backtrace_locations || []
|
120
|
-
|
121
|
-
|
118
|
+
this_dirpath = File.dirname(File.expand_path(__FILE__))
|
119
|
+
@eturem_backtrace_locations = (self.backtrace_locations || []).reject do |location|
|
120
|
+
File.expand_path(location.path).start_with?(this_dirpath) ||
|
121
|
+
location.path.end_with?("/rubygems/core_ext/kernel_require.rb")
|
122
122
|
end
|
123
|
-
@eturem_backtrace_locations = @eturem_backtrace_locations[0...index] if index
|
124
123
|
|
125
124
|
program_filepath = File.expand_path(Eturem.program_name)
|
126
125
|
@eturem_backtrace_locations.each do |location|
|
@@ -266,7 +265,7 @@ module Eturem
|
|
266
265
|
|
267
266
|
def eturem_prepare()
|
268
267
|
@eturem_corrections = self.respond_to?(:corrections) ? self.corrections : []
|
269
|
-
@eturem_corrections += Object.constants.select do |const|
|
268
|
+
@eturem_corrections += Object.constants.map(&:to_s).select do |const|
|
270
269
|
const.casecmp?(self.name)
|
271
270
|
end
|
272
271
|
@eturem_corrections.uniq!
|
data/lib/eturem/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: eturem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nodai2hITC
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Easy To Understand Ruby Error Message.
|
14
14
|
email:
|