eturem 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +9 -1
- data/lib/eturem/base.rb +93 -85
- data/lib/eturem/en.rb +187 -187
- data/lib/eturem/ja.rb +184 -183
- data/lib/eturem/version.rb +1 -1
- data/lib/eturem.rb +9 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 576f00d449f7d2bbdfd731be46f6c34658ef08c2
|
4
|
+
data.tar.gz: '09c639e1bb12cc7d7fd141b7e4cdb4dbf22a8948'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 964fc0bbb906d80888a5ea02c71abd60ed824da8db7a2746bb4dc2ef1c2959b46e7bf3760de76d4ca7abb74e4c37f64af7c0f4de2d0324dfa3af90caf511425d
|
7
|
+
data.tar.gz: 0d035c6a03cc333a49db59788845ff972069c628badc0348f1634ea937075a82fe245869b53f3c8fb6412280547f1104a4b2aa0ea00d397a465f052de1572e3e
|
data/Rakefile
CHANGED
data/lib/eturem/base.rb
CHANGED
@@ -1,14 +1,10 @@
|
|
1
1
|
require "eturem/version"
|
2
2
|
|
3
3
|
module Eturem
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
def self.eturem_class=(klass)
|
9
|
-
@eturem_class = klass
|
10
|
-
end
|
11
|
-
|
4
|
+
# load script and return eturem_exception if exception raised
|
5
|
+
# @param [String] file script file
|
6
|
+
# @return [Eturem::Base] if exception raised
|
7
|
+
# @return [nil] if exception did not raise
|
12
8
|
def self.load(file)
|
13
9
|
begin
|
14
10
|
Kernel.load file
|
@@ -27,12 +23,21 @@ module Eturem
|
|
27
23
|
return nil
|
28
24
|
end
|
29
25
|
|
26
|
+
def self.eturem_class
|
27
|
+
@eturem_class
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.eturem_class=(klass)
|
31
|
+
@eturem_class = klass
|
32
|
+
end
|
33
|
+
|
30
34
|
class Base
|
31
35
|
attr_reader :exception
|
32
36
|
|
33
37
|
@@output_backtrace = true
|
34
38
|
@@output_original = true
|
35
39
|
@@output_script = true
|
40
|
+
@@use_coderay = false
|
36
41
|
@@max_backtrace = 16
|
37
42
|
@@before_line_num = 2
|
38
43
|
@@after_line_num = 2
|
@@ -55,6 +60,10 @@ module Eturem
|
|
55
60
|
@@output_script = value
|
56
61
|
end
|
57
62
|
|
63
|
+
def self.use_coderay=(value)
|
64
|
+
@@use_coderay = value
|
65
|
+
end
|
66
|
+
|
58
67
|
def self.max_backtrace=(value)
|
59
68
|
@@max_backtrace = value
|
60
69
|
end
|
@@ -67,7 +76,6 @@ module Eturem
|
|
67
76
|
@@after_line_num = value
|
68
77
|
end
|
69
78
|
|
70
|
-
# prepare
|
71
79
|
def initialize(exception)
|
72
80
|
@exception = exception
|
73
81
|
@exception_s = exception.to_s
|
@@ -96,21 +104,72 @@ module Eturem
|
|
96
104
|
prepare
|
97
105
|
end
|
98
106
|
|
99
|
-
|
100
|
-
|
101
|
-
if
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
107
|
+
# output backtrace + error message + script
|
108
|
+
def output
|
109
|
+
output_backtrace if @@output_backtrace
|
110
|
+
error_message = exception_inspect
|
111
|
+
if error_message.to_s.empty?
|
112
|
+
puts original_exception_inspect
|
113
|
+
else
|
114
|
+
puts original_exception_inspect if @@output_original
|
115
|
+
puts error_message
|
116
|
+
end
|
117
|
+
output_script if @@output_script
|
118
|
+
end
|
119
|
+
|
120
|
+
def output_backtrace
|
121
|
+
return if @backtrace_locations.empty?
|
122
|
+
|
123
|
+
puts traceback_most_recent_call_last
|
124
|
+
@backtrace_locations[0, @@max_backtrace].reverse.each_with_index do |location, i|
|
125
|
+
puts sprintf("%9d: %s", @backtrace_locations.size - i, location_inspect(location))
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
def exception_inspect
|
130
|
+
inspect_methods = self.class.inspect_methods
|
131
|
+
inspect_methods.keys.reverse_each do |key|
|
132
|
+
case key
|
133
|
+
when Class
|
134
|
+
return public_send(inspect_methods[key]) if @exception.is_a? key
|
135
|
+
when String
|
136
|
+
return public_send(inspect_methods[key]) if @exception.class.to_s == key
|
106
137
|
end
|
107
|
-
@script.force_encoding(encoding)
|
108
138
|
end
|
109
|
-
|
110
|
-
@script_lines.unshift("")
|
111
|
-
@output_lines = default_output_lines
|
139
|
+
return nil
|
112
140
|
end
|
113
141
|
|
142
|
+
def original_exception_inspect
|
143
|
+
if @exception.is_a? SyntaxError
|
144
|
+
return @exception_s
|
145
|
+
else
|
146
|
+
location_str = "#{@path}:#{@lineno}:in `#{@label}'"
|
147
|
+
if @exception_s.match(/\A(?<first_line>.*?)\n/)
|
148
|
+
return "#{location_str}: #{Regexp.last_match(:first_line)} (#{@exception.class})\n" +
|
149
|
+
"#{Regexp.last_match.post_match}"
|
150
|
+
else
|
151
|
+
return "#{location_str}: #{@exception_s} (#{@exception.class})"
|
152
|
+
end
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
def output_script
|
157
|
+
return if @script.empty?
|
158
|
+
|
159
|
+
max_lineno_length = @output_lines.compact.max.to_s.length
|
160
|
+
@output_lines.each do |i|
|
161
|
+
if @lineno == i
|
162
|
+
puts sprintf("\e[0m => \e[1;34m%#{max_lineno_length}d\e[0m: %s", i, @script_lines[i])
|
163
|
+
elsif i
|
164
|
+
puts sprintf("\e[0m \e[1;34m%#{max_lineno_length}d\e[0m: %s", i, @script_lines[i])
|
165
|
+
else
|
166
|
+
puts "\e[0m #{" " * max_lineno_length} :"
|
167
|
+
end
|
168
|
+
end
|
169
|
+
end
|
170
|
+
|
171
|
+
private
|
172
|
+
|
114
173
|
def prepare
|
115
174
|
case @exception
|
116
175
|
when SyntaxError then prepare_syntax_error
|
@@ -128,7 +187,7 @@ module Eturem
|
|
128
187
|
end
|
129
188
|
|
130
189
|
def prepare_name_error
|
131
|
-
highlight!(@script_lines[@lineno], @exception.name.to_s, "\e[31m\e[4m")
|
190
|
+
highlight!(@script_lines[@lineno], @exception.name.to_s, "\e[1;31m\e[4m")
|
132
191
|
return unless @exception_s.match(/Did you mean\?/)
|
133
192
|
@did_you_mean = Regexp.last_match.post_match.strip.scan(/\S+/)
|
134
193
|
return if @script.empty?
|
@@ -137,7 +196,7 @@ module Eturem
|
|
137
196
|
@did_you_mean.each do |name|
|
138
197
|
index = @script_lines.index { |line| line.include?(name) }
|
139
198
|
next unless index
|
140
|
-
highlight!(@script_lines[index], name, "\e[33m")
|
199
|
+
highlight!(@script_lines[index], name, "\e[1;33m")
|
141
200
|
new_range.push(index)
|
142
201
|
end
|
143
202
|
new_range.sort!
|
@@ -169,29 +228,6 @@ module Eturem
|
|
169
228
|
@method = @label
|
170
229
|
end
|
171
230
|
|
172
|
-
# main
|
173
|
-
def output_error
|
174
|
-
output_backtrace if @@output_backtrace
|
175
|
-
error_message = exception_inspect
|
176
|
-
if error_message.to_s.empty?
|
177
|
-
puts original_exception_inspect
|
178
|
-
else
|
179
|
-
puts original_exception_inspect if @@output_original
|
180
|
-
puts error_message
|
181
|
-
end
|
182
|
-
output_script if @@output_script
|
183
|
-
end
|
184
|
-
|
185
|
-
# backtrace
|
186
|
-
def output_backtrace
|
187
|
-
return if @backtrace_locations.empty?
|
188
|
-
|
189
|
-
puts traceback_most_recent_call_last
|
190
|
-
@backtrace_locations[0, @@max_backtrace].reverse.each_with_index do |location, i|
|
191
|
-
puts sprintf("%9d: %s", @backtrace_locations.size - i, location_inspect(location))
|
192
|
-
end
|
193
|
-
end
|
194
|
-
|
195
231
|
def backtrace_locations_shift
|
196
232
|
@label = @backtrace_locations.first.label
|
197
233
|
@path = @backtrace_locations.first.path
|
@@ -207,48 +243,20 @@ module Eturem
|
|
207
243
|
"from #{location.path}:#{location.lineno}:in `#{location.label}'"
|
208
244
|
end
|
209
245
|
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
when String
|
218
|
-
return public_send(inspect_methods[key]) if @exception.class.to_s == key
|
219
|
-
end
|
220
|
-
end
|
221
|
-
return nil
|
222
|
-
end
|
223
|
-
|
224
|
-
def original_exception_inspect
|
225
|
-
if @exception.is_a? SyntaxError
|
226
|
-
return @exception_s
|
227
|
-
else
|
228
|
-
location_str = "#{@path}:#{@lineno}:in `#{@label}'"
|
229
|
-
if @exception_s.match(/\A(?<first_line>.*?)\n/)
|
230
|
-
return "#{location_str}: #{Regexp.last_match(:first_line)} (#{@exception.class})\n" +
|
231
|
-
"#{Regexp.last_match.post_match}"
|
232
|
-
else
|
233
|
-
return "#{location_str}: #{@exception_s} (#{@exception.class})"
|
234
|
-
end
|
235
|
-
end
|
236
|
-
end
|
237
|
-
|
238
|
-
# script
|
239
|
-
def output_script
|
240
|
-
return if @script.empty?
|
241
|
-
|
242
|
-
max_lineno_length = @output_lines.compact.max.to_s.length
|
243
|
-
@output_lines.each do |i|
|
244
|
-
if @lineno == i
|
245
|
-
puts sprintf(" => \e[34m%#{max_lineno_length}d:\e[0m %s", i, @script_lines[i])
|
246
|
-
elsif i
|
247
|
-
puts sprintf(" \e[34m%#{max_lineno_length}d:\e[0m %s", i, @script_lines[i])
|
248
|
-
else
|
249
|
-
puts " \e[34m#{" " * max_lineno_length} :\e[0m"
|
246
|
+
def load_script
|
247
|
+
@script = ""
|
248
|
+
if @path && File.exist?(@path)
|
249
|
+
@script = File.binread(@path)
|
250
|
+
encoding = "utf-8"
|
251
|
+
if @script.match(/\A(?:#!.*\R)?#.*coding *[:=] *(?<encoding>[^\s:]+)/)
|
252
|
+
encoding = Regexp.last_match(:encoding)
|
250
253
|
end
|
254
|
+
@script.force_encoding(encoding)
|
251
255
|
end
|
256
|
+
@script = CodeRay.scan(@script, :ruby).terminal if @@use_coderay
|
257
|
+
@script_lines = @script.lines
|
258
|
+
@script_lines.unshift("")
|
259
|
+
@output_lines = default_output_lines
|
252
260
|
end
|
253
261
|
|
254
262
|
def highlight(str, keyword, color)
|
data/lib/eturem/en.rb
CHANGED
@@ -3,193 +3,193 @@ require "eturem/base"
|
|
3
3
|
module Eturem
|
4
4
|
class En < Base
|
5
5
|
@inspect_methods = {
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
18
|
-
#
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#
|
103
|
-
#
|
104
|
-
#
|
105
|
-
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
114
|
-
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
#
|
118
|
-
#
|
119
|
-
#
|
120
|
-
#
|
121
|
-
#
|
122
|
-
#
|
123
|
-
#
|
124
|
-
#
|
125
|
-
#
|
126
|
-
#
|
127
|
-
#
|
128
|
-
#
|
129
|
-
#
|
130
|
-
#
|
131
|
-
#
|
132
|
-
#
|
133
|
-
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
#
|
137
|
-
#
|
138
|
-
#
|
139
|
-
#
|
140
|
-
#
|
141
|
-
#
|
142
|
-
#
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
#
|
147
|
-
#
|
148
|
-
#
|
149
|
-
#
|
150
|
-
#
|
151
|
-
#
|
152
|
-
#
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
#
|
157
|
-
#
|
158
|
-
#
|
159
|
-
#
|
160
|
-
#
|
161
|
-
#
|
162
|
-
#
|
163
|
-
#
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
#
|
173
|
-
#
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
#
|
178
|
-
#
|
179
|
-
#
|
180
|
-
#
|
181
|
-
#
|
182
|
-
#
|
183
|
-
#
|
184
|
-
#
|
185
|
-
#
|
186
|
-
#
|
187
|
-
#
|
188
|
-
#
|
189
|
-
#
|
190
|
-
#
|
191
|
-
#
|
192
|
-
#
|
6
|
+
#NoMemoryError => :no_memory_error_inspect,
|
7
|
+
#ScriptError => :script_error_inspect,
|
8
|
+
#LoadError => :load_error_inspect,
|
9
|
+
#NotImplementedError => :not_implemented_error_inspect,
|
10
|
+
#SyntaxError => :syntax_error_inspect,
|
11
|
+
#SecurityError => :security_error_inspect,
|
12
|
+
#SignalException => :signal_exception_inspect,
|
13
|
+
#Interrupt => :interrupt_inspect,
|
14
|
+
#StandardError => :standard_error_inspect,
|
15
|
+
#ArgumentError => :argument_error_inspect,
|
16
|
+
#UncaughtThrowError => :uncaught_throw_error_inspect,
|
17
|
+
#EncodingError => :encoding_error_inspect,
|
18
|
+
#Encoding::CompatibilityError => :encoding_compatibility_error_inspect,
|
19
|
+
#Encoding::ConverterNotFoundError => :encoding_converter_not_found_error_inspect,
|
20
|
+
#Encoding::InvalidByteSequenceError => :encoding_invalid_byte_sequence_error_inspect,
|
21
|
+
#Encoding::UndefinedConversionError => :encoding_undefined_conversion_error_inspect,
|
22
|
+
#FiberError => :fiber_error_inspect,
|
23
|
+
#IOError => :io_error_inspect,
|
24
|
+
#EOFError => :eof_error_inspect,
|
25
|
+
#IndexError => :index_error_inspect,
|
26
|
+
#KeyError => :key_error_inspect,
|
27
|
+
#StopIteration => :stop_iteration_inspect,
|
28
|
+
#ClosedQueueError => :closed_queue_error_inspect,
|
29
|
+
#LocalJumpError => :local_jump_error_inspect,
|
30
|
+
#Math::DomainError => :math_domain_error_inspect,
|
31
|
+
#NameError => :name_error_inspect,
|
32
|
+
#NoMethodError => :no_method_error_inspect,
|
33
|
+
#RangeError => :range_error_inspect,
|
34
|
+
#FloatDomainError => :float_domain_error_inspect,
|
35
|
+
#RegexpError => :regexp_error_inspect,
|
36
|
+
#RuntimeError => :runtime_error_inspect,
|
37
|
+
#FrozenError => :frozen_error_inspect,
|
38
|
+
#SystemCallError => :system_call_error_inspect,
|
39
|
+
#Errno::E2BIG => :errno_e2big_inspect,
|
40
|
+
#Errno::EACCES => :errno_eacces_inspect,
|
41
|
+
#Errno::EADDRINUSE => :errno_eaddrinuse_inspect,
|
42
|
+
#Errno::EADDRNOTAVAIL => :errno_eaddrnotavail_inspect,
|
43
|
+
#Errno::EADV => :errno_eadv_inspect,
|
44
|
+
#Errno::EAFNOSUPPORT => :errno_eafnosupport_inspect,
|
45
|
+
#Errno::EAGAIN => :errno_eagain_inspect,
|
46
|
+
#Errno::EALREADY => :errno_ealready_inspect,
|
47
|
+
#Errno::EAUTH => :errno_eauth_inspect,
|
48
|
+
#Errno::EBADE => :errno_ebade_inspect,
|
49
|
+
#Errno::EBADF => :errno_ebadf_inspect,
|
50
|
+
#Errno::EBADFD => :errno_ebadfd_inspect,
|
51
|
+
#Errno::EBADMSG => :errno_ebadmsg_inspect,
|
52
|
+
#Errno::EBADR => :errno_ebadr_inspect,
|
53
|
+
#Errno::EBADRPC => :errno_ebadrpc_inspect,
|
54
|
+
#Errno::EBADRQC => :errno_ebadrqc_inspect,
|
55
|
+
#Errno::EBADSLT => :errno_ebadslt_inspect,
|
56
|
+
#Errno::EBFONT => :errno_ebfont_inspect,
|
57
|
+
#Errno::EBUSY => :errno_ebusy_inspect,
|
58
|
+
#Errno::ECANCELED => :errno_ecanceled_inspect,
|
59
|
+
#Errno::ECAPMODE => :errno_ecapmode_inspect,
|
60
|
+
#Errno::ECHILD => :errno_echild_inspect,
|
61
|
+
#Errno::ECHRNG => :errno_echrng_inspect,
|
62
|
+
#Errno::ECOMM => :errno_ecomm_inspect,
|
63
|
+
#Errno::ECONNABORTED => :errno_econnaborted_inspect,
|
64
|
+
#Errno::ECONNREFUSED => :errno_econnrefused_inspect,
|
65
|
+
#Errno::ECONNRESET => :errno_econnreset_inspect,
|
66
|
+
#Errno::EDEADLK => :errno_edeadlk_inspect,
|
67
|
+
#Errno::EDEADLOCK => :errno_edeadlock_inspect,
|
68
|
+
#Errno::EDESTADDRREQ => :errno_edestaddrreq_inspect,
|
69
|
+
#Errno::EDOM => :errno_edom_inspect,
|
70
|
+
#Errno::EDOOFUS => :errno_edoofus_inspect,
|
71
|
+
#Errno::EDOTDOT => :errno_edotdot_inspect,
|
72
|
+
#Errno::EDQUOT => :errno_edquot_inspect,
|
73
|
+
#Errno::EEXIST => :errno_eexist_inspect,
|
74
|
+
#Errno::EFAULT => :errno_efault_inspect,
|
75
|
+
#Errno::EFBIG => :errno_efbig_inspect,
|
76
|
+
#Errno::EFTYPE => :errno_eftype_inspect,
|
77
|
+
#Errno::EHOSTDOWN => :errno_ehostdown_inspect,
|
78
|
+
#Errno::EHOSTUNREACH => :errno_ehostunreach_inspect,
|
79
|
+
#Errno::EHWPOISON => :errno_ehwpoison_inspect,
|
80
|
+
#Errno::EIDRM => :errno_eidrm_inspect,
|
81
|
+
#Errno::EILSEQ => :errno_eilseq_inspect,
|
82
|
+
#Errno::EINPROGRESS => :errno_einprogress_inspect,
|
83
|
+
#Errno::EINTR => :errno_eintr_inspect,
|
84
|
+
#Errno::EINVAL => :errno_einval_inspect,
|
85
|
+
#Errno::EIO => :errno_Eio_inspect,
|
86
|
+
#Errno::EIPSEC => :errno_eipsec_inspect,
|
87
|
+
#Errno::EISCONN => :errno_eisconn_inspect,
|
88
|
+
#Errno::EISDIR => :errno_eisdir_inspect,
|
89
|
+
#Errno::EISNAM => :errno_eisnam_inspect,
|
90
|
+
#Errno::EKEYEXPIRED => :errno_ekeyexpired_inspect,
|
91
|
+
#Errno::EKEYREJECTED => :errno_ekeyrejected_inspect,
|
92
|
+
#Errno::EKEYREVOKED => :errno_ekeyrevoked_inspect,
|
93
|
+
#Errno::EL2HLT => :errno_el2hlt_inspect,
|
94
|
+
#Errno::EL2NSYNC => :errno_el2nsync_inspect,
|
95
|
+
#Errno::EL3HLT => :errno_el3hlt_inspect,
|
96
|
+
#Errno::EL3RST => :errno_el3rst_inspect,
|
97
|
+
#Errno::ELIBACC => :errno_elibacc_inspect,
|
98
|
+
#Errno::ELIBBAD => :errno_elibbad_inspect,
|
99
|
+
#Errno::ELIBEXEC => :errno_elibexec_inspect,
|
100
|
+
#Errno::ELIBMAX => :errno_elibmax_inspect,
|
101
|
+
#Errno::ELIBSCN => :errno_elibscn_inspect,
|
102
|
+
#Errno::ELNRNG => :errno_elnrng_inspect,
|
103
|
+
#Errno::ELOOP => :errno_eloop_inspect,
|
104
|
+
#Errno::EMEDIUMTYPE => :errno_emediumtype_inspect,
|
105
|
+
#Errno::EMFILE => :errno_emfile_inspect,
|
106
|
+
#Errno::EMLINK => :errno_emlink_inspect,
|
107
|
+
#Errno::EMSGSIZE => :errno_emsgsize_inspect,
|
108
|
+
#Errno::EMULTIHOP => :errno_emultihop_inspect,
|
109
|
+
#Errno::ENAMETOOLONG => :errno_enametoolong_inspect,
|
110
|
+
#Errno::ENAVAIL => :errno_enavail_inspect,
|
111
|
+
#Errno::ENEEDAUTH => :errno_eneedauth_inspect,
|
112
|
+
#Errno::ENETDOWN => :errno_enetdown_inspect,
|
113
|
+
#Errno::ENETRESET => :errno_enetreset_inspect,
|
114
|
+
#Errno::ENETUNREACH => :errno_enetunreach_inspect,
|
115
|
+
#Errno::ENFILE => :errno_enfile_inspect,
|
116
|
+
#Errno::ENOANO => :errno_enoano_inspect,
|
117
|
+
#Errno::ENOATTR => :errno_enoattr_inspect,
|
118
|
+
#Errno::ENOBUFS => :errno_enobufs_inspect,
|
119
|
+
#Errno::ENOCSI => :errno_enocsi_inspect,
|
120
|
+
#Errno::ENODATA => :errno_enodata_inspect,
|
121
|
+
#Errno::ENODEV => :errno_enodev_inspect,
|
122
|
+
#Errno::ENOENT => :errno_enoent_inspect,
|
123
|
+
#Errno::ENOEXEC => :errno_enoexec_inspect,
|
124
|
+
#Errno::ENOKEY => :errno_enokey_inspect,
|
125
|
+
#Errno::ENOLCK => :errno_enolck_inspect,
|
126
|
+
#Errno::ENOLINK => :errno_enolink_inspect,
|
127
|
+
#Errno::ENOMEDIUM => :errno_enomedium_inspect,
|
128
|
+
#Errno::ENOMEM => :errno_enomem_inspect,
|
129
|
+
#Errno::ENOMSG => :errno_enomsg_inspect,
|
130
|
+
#Errno::ENONET => :errno_enonet_inspect,
|
131
|
+
#Errno::ENOPKG => :errno_enopkg_inspect,
|
132
|
+
#Errno::ENOPROTOOPT => :errno_enoprotoopt_inspect,
|
133
|
+
#Errno::ENOSPC => :errno_enospc_inspect,
|
134
|
+
#Errno::ENOSR => :errno_enosr_inspect,
|
135
|
+
#Errno::ENOSTR => :errno_enostr_inspect,
|
136
|
+
#Errno::ENOSYS => :errno_enosys_inspect,
|
137
|
+
#Errno::ENOTBLK => :errno_enotblk_inspect,
|
138
|
+
#Errno::ENOTCAPABLE => :errno_enotcapable_inspect,
|
139
|
+
#Errno::ENOTCONN => :errno_enotconn_inspect,
|
140
|
+
#Errno::ENOTDIR => :errno_enotdir_inspect,
|
141
|
+
#Errno::ENOTEMPTY => :errno_enotempty_inspect,
|
142
|
+
#Errno::ENOTNAM => :errno_enotnam_inspect,
|
143
|
+
#Errno::ENOTRECOVERABLE => :errno_enotrecoverable_inspect,
|
144
|
+
#Errno::ENOTSOCK => :errno_enotsock_inspect,
|
145
|
+
#Errno::ENOTSUP => :errno_enotsup_inspect,
|
146
|
+
#Errno::ENOTTY => :errno_enotty_inspect,
|
147
|
+
#Errno::ENOTUNIQ => :errno_enotuniq_inspect,
|
148
|
+
#Errno::ENXIO => :errno_enxio_inspect,
|
149
|
+
#Errno::EOPNOTSUPP => :errno_eopnotsupp_inspect,
|
150
|
+
#Errno::EOVERFLOW => :errno_eoverflow_inspect,
|
151
|
+
#Errno::EOWNERDEAD => :errno_eownerdead_inspect,
|
152
|
+
#Errno::EPERM => :errno_eperm_inspect,
|
153
|
+
#Errno::EPFNOSUPPORT => :errno_epfnosupport_inspect,
|
154
|
+
#Errno::EPIPE => :errno_epipe_inspect,
|
155
|
+
#Errno::EPROCLIM => :errno_eproclim_inspect,
|
156
|
+
#Errno::EPROCUNAVAIL => :errno_eprocunavail_inspect,
|
157
|
+
#Errno::EPROGMISMATCH => :errno_eprogmismatch_inspect,
|
158
|
+
#Errno::EPROGUNAVAIL => :errno_eprogunavail_inspect,
|
159
|
+
#Errno::EPROTO => :errno_eproto_inspect,
|
160
|
+
#Errno::EPROTONOSUPPORT => :errno_eprotonosupport_inspect,
|
161
|
+
#Errno::EPROTOTYPE => :errno_eprototype_inspect,
|
162
|
+
#Errno::ERANGE => :errno_erange_inspect,
|
163
|
+
#Errno::EREMCHG => :errno_eremchg_inspect,
|
164
|
+
#Errno::EREMOTE => :errno_eremote_inspect,
|
165
|
+
#Errno::EREMOTEIO => :errno_eremoteio_inspect,
|
166
|
+
#Errno::ERESTART => :errno_erestart_inspect,
|
167
|
+
#Errno::ERFKILL => :errno_erfkill_inspect,
|
168
|
+
#Errno::EROFS => :errno_erofs_inspect,
|
169
|
+
#Errno::ERPCMISMATCH => :errno_erpcmismatch_inspect,
|
170
|
+
#Errno::ESHUTDOWN => :errno_eshutdown_inspect,
|
171
|
+
#Errno::ESOCKTNOSUPPORT => :errno_esocktnosupport_inspect,
|
172
|
+
#Errno::ESPIPE => :errno_espipe_inspect,
|
173
|
+
#Errno::ESRCH => :errno_esrch_inspect,
|
174
|
+
#Errno::ESRMNT => :errno_esrmnt_inspect,
|
175
|
+
#Errno::ESTALE => :errno_estale_inspect,
|
176
|
+
#Errno::ESTRPIPE => :errno_estrpipe_inspect,
|
177
|
+
#Errno::ETIME => :errno_etime_inspect,
|
178
|
+
#Errno::ETIMEDOUT => :errno_etimedout_inspect,
|
179
|
+
#Errno::ETOOMANYREFS => :errno_etoomanyrefs_inspect,
|
180
|
+
#Errno::ETXTBSY => :errno_etxtbsy_inspect,
|
181
|
+
#Errno::EUCLEAN => :errno_euclean_inspect,
|
182
|
+
#Errno::EUNATCH => :errno_eunatch_inspect,
|
183
|
+
#Errno::EUSERS => :errno_eusers_inspect,
|
184
|
+
#Errno::EWOULDBLOCK => :errno_ewouldblock_inspect,
|
185
|
+
#Errno::EXDEV => :errno_exdev_inspect,
|
186
|
+
#Errno::EXFULL => :errno_exfull_inspect,
|
187
|
+
#Errno::EXXX => :errno_exxx_inspect,
|
188
|
+
#Errno::NOERROR => :errno_noerror_inspect,
|
189
|
+
#ThreadError => :thread_error_inspect,
|
190
|
+
#TypeError => :type_error_inspect,
|
191
|
+
#ZeroDivisionError => :zero_division_error_inspect,
|
192
|
+
#SystemStackError => :system_stack_error_inspect,
|
193
193
|
"sentinel" => nil
|
194
194
|
}
|
195
195
|
|
data/lib/eturem/ja.rb
CHANGED
@@ -7,189 +7,189 @@ module Eturem
|
|
7
7
|
|
8
8
|
@inspect_methods = {
|
9
9
|
NoMemoryError => :no_memory_error_inspect,
|
10
|
-
#
|
10
|
+
#ScriptError => :script_error_inspect,
|
11
11
|
LoadError => :load_error_inspect,
|
12
|
-
#
|
12
|
+
#NotImplementedError => :not_implemented_error_inspect,
|
13
13
|
SyntaxError => :syntax_error_inspect,
|
14
|
-
#
|
15
|
-
#
|
16
|
-
#
|
17
|
-
#
|
14
|
+
#SecurityError => :security_error_inspect,
|
15
|
+
#SignalException => :signal_exception_inspect,
|
16
|
+
#Interrupt => :interrupt_inspect,
|
17
|
+
#StandardError => :standard_error_inspect,
|
18
18
|
ArgumentError => :argument_error_inspect,
|
19
|
-
#
|
20
|
-
#
|
21
|
-
#
|
22
|
-
#
|
23
|
-
#
|
24
|
-
#
|
25
|
-
#
|
26
|
-
#
|
27
|
-
#
|
28
|
-
#
|
29
|
-
#
|
30
|
-
#
|
31
|
-
#
|
32
|
-
#
|
33
|
-
#
|
19
|
+
#UncaughtThrowError => :uncaught_throw_error_inspect,
|
20
|
+
#EncodingError => :encoding_error_inspect,
|
21
|
+
#Encoding::CompatibilityError => :encoding_compatibility_error_inspect,
|
22
|
+
#Encoding::ConverterNotFoundError => :encoding_converter_not_found_error_inspect,
|
23
|
+
#Encoding::InvalidByteSequenceError => :encoding_invalid_byte_sequence_error_inspect,
|
24
|
+
#Encoding::UndefinedConversionError => :encoding_undefined_conversion_error_inspect,
|
25
|
+
#FiberError => :fiber_error_inspect,
|
26
|
+
#IOError => :io_error_inspect,
|
27
|
+
#EOFError => :eof_error_inspect,
|
28
|
+
#IndexError => :index_error_inspect,
|
29
|
+
#KeyError => :key_error_inspect,
|
30
|
+
#StopIteration => :stop_iteration_inspect,
|
31
|
+
#ClosedQueueError => :closed_queue_error_inspect,
|
32
|
+
#LocalJumpError => :local_jump_error_inspect,
|
33
|
+
#Math::DomainError => :math_domain_error_inspect,
|
34
34
|
NameError => :name_error_inspect,
|
35
|
-
#
|
36
|
-
#
|
37
|
-
#
|
38
|
-
#
|
39
|
-
#
|
40
|
-
#
|
41
|
-
#
|
42
|
-
#
|
43
|
-
#
|
44
|
-
#
|
45
|
-
#
|
46
|
-
#
|
47
|
-
#
|
48
|
-
#
|
49
|
-
#
|
50
|
-
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
#
|
54
|
-
#
|
55
|
-
#
|
56
|
-
#
|
57
|
-
#
|
58
|
-
#
|
59
|
-
#
|
60
|
-
#
|
61
|
-
#
|
62
|
-
#
|
63
|
-
#
|
64
|
-
#
|
65
|
-
#
|
66
|
-
#
|
67
|
-
#
|
68
|
-
#
|
69
|
-
#
|
70
|
-
#
|
71
|
-
#
|
72
|
-
#
|
73
|
-
#
|
74
|
-
#
|
75
|
-
#
|
76
|
-
#
|
77
|
-
#
|
78
|
-
#
|
79
|
-
#
|
80
|
-
#
|
81
|
-
#
|
82
|
-
#
|
83
|
-
#
|
84
|
-
#
|
85
|
-
#
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
94
|
-
#
|
95
|
-
#
|
96
|
-
#
|
97
|
-
#
|
98
|
-
#
|
99
|
-
#
|
100
|
-
#
|
101
|
-
#
|
102
|
-
#
|
103
|
-
#
|
104
|
-
#
|
105
|
-
#
|
106
|
-
#
|
107
|
-
#
|
108
|
-
#
|
109
|
-
#
|
110
|
-
#
|
111
|
-
#
|
112
|
-
#
|
113
|
-
#
|
114
|
-
#
|
115
|
-
#
|
116
|
-
#
|
117
|
-
#
|
118
|
-
#
|
119
|
-
#
|
120
|
-
#
|
121
|
-
#
|
122
|
-
#
|
123
|
-
#
|
124
|
-
#
|
35
|
+
#NoMethodError => :no_method_error_inspect,
|
36
|
+
#RangeError => :range_error_inspect,
|
37
|
+
#FloatDomainError => :float_domain_error_inspect,
|
38
|
+
#RegexpError => :regexp_error_inspect,
|
39
|
+
#RuntimeError => :runtime_error_inspect,
|
40
|
+
#FrozenError => :frozen_error_inspect,
|
41
|
+
#SystemCallError => :system_call_error_inspect,
|
42
|
+
#Errno::E2BIG => :errno_e2big_inspect,
|
43
|
+
#Errno::EACCES => :errno_eacces_inspect,
|
44
|
+
#Errno::EADDRINUSE => :errno_eaddrinuse_inspect,
|
45
|
+
#Errno::EADDRNOTAVAIL => :errno_eaddrnotavail_inspect,
|
46
|
+
#Errno::EADV => :errno_eadv_inspect,
|
47
|
+
#Errno::EAFNOSUPPORT => :errno_eafnosupport_inspect,
|
48
|
+
#Errno::EAGAIN => :errno_eagain_inspect,
|
49
|
+
#Errno::EALREADY => :errno_ealready_inspect,
|
50
|
+
#Errno::EAUTH => :errno_eauth_inspect,
|
51
|
+
#Errno::EBADE => :errno_ebade_inspect,
|
52
|
+
#Errno::EBADF => :errno_ebadf_inspect,
|
53
|
+
#Errno::EBADFD => :errno_ebadfd_inspect,
|
54
|
+
#Errno::EBADMSG => :errno_ebadmsg_inspect,
|
55
|
+
#Errno::EBADR => :errno_ebadr_inspect,
|
56
|
+
#Errno::EBADRPC => :errno_ebadrpc_inspect,
|
57
|
+
#Errno::EBADRQC => :errno_ebadrqc_inspect,
|
58
|
+
#Errno::EBADSLT => :errno_ebadslt_inspect,
|
59
|
+
#Errno::EBFONT => :errno_ebfont_inspect,
|
60
|
+
#Errno::EBUSY => :errno_ebusy_inspect,
|
61
|
+
#Errno::ECANCELED => :errno_ecanceled_inspect,
|
62
|
+
#Errno::ECAPMODE => :errno_ecapmode_inspect,
|
63
|
+
#Errno::ECHILD => :errno_echild_inspect,
|
64
|
+
#Errno::ECHRNG => :errno_echrng_inspect,
|
65
|
+
#Errno::ECOMM => :errno_ecomm_inspect,
|
66
|
+
#Errno::ECONNABORTED => :errno_econnaborted_inspect,
|
67
|
+
#Errno::ECONNREFUSED => :errno_econnrefused_inspect,
|
68
|
+
#Errno::ECONNRESET => :errno_econnreset_inspect,
|
69
|
+
#Errno::EDEADLK => :errno_edeadlk_inspect,
|
70
|
+
#Errno::EDEADLOCK => :errno_edeadlock_inspect,
|
71
|
+
#Errno::EDESTADDRREQ => :errno_edestaddrreq_inspect,
|
72
|
+
#Errno::EDOM => :errno_edom_inspect,
|
73
|
+
#Errno::EDOOFUS => :errno_edoofus_inspect,
|
74
|
+
#Errno::EDOTDOT => :errno_edotdot_inspect,
|
75
|
+
#Errno::EDQUOT => :errno_edquot_inspect,
|
76
|
+
#Errno::EEXIST => :errno_eexist_inspect,
|
77
|
+
#Errno::EFAULT => :errno_efault_inspect,
|
78
|
+
#Errno::EFBIG => :errno_efbig_inspect,
|
79
|
+
#Errno::EFTYPE => :errno_eftype_inspect,
|
80
|
+
#Errno::EHOSTDOWN => :errno_ehostdown_inspect,
|
81
|
+
#Errno::EHOSTUNREACH => :errno_ehostunreach_inspect,
|
82
|
+
#Errno::EHWPOISON => :errno_ehwpoison_inspect,
|
83
|
+
#Errno::EIDRM => :errno_eidrm_inspect,
|
84
|
+
#Errno::EILSEQ => :errno_eilseq_inspect,
|
85
|
+
#Errno::EINPROGRESS => :errno_einprogress_inspect,
|
86
|
+
#Errno::EINTR => :errno_eintr_inspect,
|
87
|
+
#Errno::EINVAL => :errno_einval_inspect,
|
88
|
+
#Errno::EIO => :errno_Eio_inspect,
|
89
|
+
#Errno::EIPSEC => :errno_eipsec_inspect,
|
90
|
+
#Errno::EISCONN => :errno_eisconn_inspect,
|
91
|
+
#Errno::EISDIR => :errno_eisdir_inspect,
|
92
|
+
#Errno::EISNAM => :errno_eisnam_inspect,
|
93
|
+
#Errno::EKEYEXPIRED => :errno_ekeyexpired_inspect,
|
94
|
+
#Errno::EKEYREJECTED => :errno_ekeyrejected_inspect,
|
95
|
+
#Errno::EKEYREVOKED => :errno_ekeyrevoked_inspect,
|
96
|
+
#Errno::EL2HLT => :errno_el2hlt_inspect,
|
97
|
+
#Errno::EL2NSYNC => :errno_el2nsync_inspect,
|
98
|
+
#Errno::EL3HLT => :errno_el3hlt_inspect,
|
99
|
+
#Errno::EL3RST => :errno_el3rst_inspect,
|
100
|
+
#Errno::ELIBACC => :errno_elibacc_inspect,
|
101
|
+
#Errno::ELIBBAD => :errno_elibbad_inspect,
|
102
|
+
#Errno::ELIBEXEC => :errno_elibexec_inspect,
|
103
|
+
#Errno::ELIBMAX => :errno_elibmax_inspect,
|
104
|
+
#Errno::ELIBSCN => :errno_elibscn_inspect,
|
105
|
+
#Errno::ELNRNG => :errno_elnrng_inspect,
|
106
|
+
#Errno::ELOOP => :errno_eloop_inspect,
|
107
|
+
#Errno::EMEDIUMTYPE => :errno_emediumtype_inspect,
|
108
|
+
#Errno::EMFILE => :errno_emfile_inspect,
|
109
|
+
#Errno::EMLINK => :errno_emlink_inspect,
|
110
|
+
#Errno::EMSGSIZE => :errno_emsgsize_inspect,
|
111
|
+
#Errno::EMULTIHOP => :errno_emultihop_inspect,
|
112
|
+
#Errno::ENAMETOOLONG => :errno_enametoolong_inspect,
|
113
|
+
#Errno::ENAVAIL => :errno_enavail_inspect,
|
114
|
+
#Errno::ENEEDAUTH => :errno_eneedauth_inspect,
|
115
|
+
#Errno::ENETDOWN => :errno_enetdown_inspect,
|
116
|
+
#Errno::ENETRESET => :errno_enetreset_inspect,
|
117
|
+
#Errno::ENETUNREACH => :errno_enetunreach_inspect,
|
118
|
+
#Errno::ENFILE => :errno_enfile_inspect,
|
119
|
+
#Errno::ENOANO => :errno_enoano_inspect,
|
120
|
+
#Errno::ENOATTR => :errno_enoattr_inspect,
|
121
|
+
#Errno::ENOBUFS => :errno_enobufs_inspect,
|
122
|
+
#Errno::ENOCSI => :errno_enocsi_inspect,
|
123
|
+
#Errno::ENODATA => :errno_enodata_inspect,
|
124
|
+
#Errno::ENODEV => :errno_enodev_inspect,
|
125
125
|
Errno::ENOENT => :errno_enoent_inspect,
|
126
|
-
#
|
127
|
-
#
|
128
|
-
#
|
129
|
-
#
|
130
|
-
#
|
131
|
-
#
|
132
|
-
#
|
133
|
-
#
|
134
|
-
#
|
135
|
-
#
|
136
|
-
#
|
137
|
-
#
|
138
|
-
#
|
139
|
-
#
|
140
|
-
#
|
141
|
-
#
|
142
|
-
#
|
143
|
-
#
|
144
|
-
#
|
145
|
-
#
|
146
|
-
#
|
147
|
-
#
|
148
|
-
#
|
149
|
-
#
|
150
|
-
#
|
151
|
-
#
|
152
|
-
#
|
153
|
-
#
|
154
|
-
#
|
155
|
-
#
|
156
|
-
#
|
157
|
-
#
|
158
|
-
#
|
159
|
-
#
|
160
|
-
#
|
161
|
-
#
|
162
|
-
#
|
163
|
-
#
|
164
|
-
#
|
165
|
-
#
|
166
|
-
#
|
167
|
-
#
|
168
|
-
#
|
169
|
-
#
|
170
|
-
#
|
171
|
-
#
|
172
|
-
#
|
173
|
-
#
|
174
|
-
#
|
175
|
-
#
|
176
|
-
#
|
177
|
-
#
|
178
|
-
#
|
179
|
-
#
|
180
|
-
#
|
181
|
-
#
|
182
|
-
#
|
183
|
-
#
|
184
|
-
#
|
185
|
-
#
|
186
|
-
#
|
187
|
-
#
|
188
|
-
#
|
189
|
-
#
|
190
|
-
#
|
191
|
-
#
|
192
|
-
#
|
126
|
+
#Errno::ENOEXEC => :errno_enoexec_inspect,
|
127
|
+
#Errno::ENOKEY => :errno_enokey_inspect,
|
128
|
+
#Errno::ENOLCK => :errno_enolck_inspect,
|
129
|
+
#Errno::ENOLINK => :errno_enolink_inspect,
|
130
|
+
#Errno::ENOMEDIUM => :errno_enomedium_inspect,
|
131
|
+
#Errno::ENOMEM => :errno_enomem_inspect,
|
132
|
+
#Errno::ENOMSG => :errno_enomsg_inspect,
|
133
|
+
#Errno::ENONET => :errno_enonet_inspect,
|
134
|
+
#Errno::ENOPKG => :errno_enopkg_inspect,
|
135
|
+
#Errno::ENOPROTOOPT => :errno_enoprotoopt_inspect,
|
136
|
+
#Errno::ENOSPC => :errno_enospc_inspect,
|
137
|
+
#Errno::ENOSR => :errno_enosr_inspect,
|
138
|
+
#Errno::ENOSTR => :errno_enostr_inspect,
|
139
|
+
#Errno::ENOSYS => :errno_enosys_inspect,
|
140
|
+
#Errno::ENOTBLK => :errno_enotblk_inspect,
|
141
|
+
#Errno::ENOTCAPABLE => :errno_enotcapable_inspect,
|
142
|
+
#Errno::ENOTCONN => :errno_enotconn_inspect,
|
143
|
+
#Errno::ENOTDIR => :errno_enotdir_inspect,
|
144
|
+
#Errno::ENOTEMPTY => :errno_enotempty_inspect,
|
145
|
+
#Errno::ENOTNAM => :errno_enotnam_inspect,
|
146
|
+
#Errno::ENOTRECOVERABLE => :errno_enotrecoverable_inspect,
|
147
|
+
#Errno::ENOTSOCK => :errno_enotsock_inspect,
|
148
|
+
#Errno::ENOTSUP => :errno_enotsup_inspect,
|
149
|
+
#Errno::ENOTTY => :errno_enotty_inspect,
|
150
|
+
#Errno::ENOTUNIQ => :errno_enotuniq_inspect,
|
151
|
+
#Errno::ENXIO => :errno_enxio_inspect,
|
152
|
+
#Errno::EOPNOTSUPP => :errno_eopnotsupp_inspect,
|
153
|
+
#Errno::EOVERFLOW => :errno_eoverflow_inspect,
|
154
|
+
#Errno::EOWNERDEAD => :errno_eownerdead_inspect,
|
155
|
+
#Errno::EPERM => :errno_eperm_inspect,
|
156
|
+
#Errno::EPFNOSUPPORT => :errno_epfnosupport_inspect,
|
157
|
+
#Errno::EPIPE => :errno_epipe_inspect,
|
158
|
+
#Errno::EPROCLIM => :errno_eproclim_inspect,
|
159
|
+
#Errno::EPROCUNAVAIL => :errno_eprocunavail_inspect,
|
160
|
+
#Errno::EPROGMISMATCH => :errno_eprogmismatch_inspect,
|
161
|
+
#Errno::EPROGUNAVAIL => :errno_eprogunavail_inspect,
|
162
|
+
#Errno::EPROTO => :errno_eproto_inspect,
|
163
|
+
#Errno::EPROTONOSUPPORT => :errno_eprotonosupport_inspect,
|
164
|
+
#Errno::EPROTOTYPE => :errno_eprototype_inspect,
|
165
|
+
#Errno::ERANGE => :errno_erange_inspect,
|
166
|
+
#Errno::EREMCHG => :errno_eremchg_inspect,
|
167
|
+
#Errno::EREMOTE => :errno_eremote_inspect,
|
168
|
+
#Errno::EREMOTEIO => :errno_eremoteio_inspect,
|
169
|
+
#Errno::ERESTART => :errno_erestart_inspect,
|
170
|
+
#Errno::ERFKILL => :errno_erfkill_inspect,
|
171
|
+
#Errno::EROFS => :errno_erofs_inspect,
|
172
|
+
#Errno::ERPCMISMATCH => :errno_erpcmismatch_inspect,
|
173
|
+
#Errno::ESHUTDOWN => :errno_eshutdown_inspect,
|
174
|
+
#Errno::ESOCKTNOSUPPORT => :errno_esocktnosupport_inspect,
|
175
|
+
#Errno::ESPIPE => :errno_espipe_inspect,
|
176
|
+
#Errno::ESRCH => :errno_esrch_inspect,
|
177
|
+
#Errno::ESRMNT => :errno_esrmnt_inspect,
|
178
|
+
#Errno::ESTALE => :errno_estale_inspect,
|
179
|
+
#Errno::ESTRPIPE => :errno_estrpipe_inspect,
|
180
|
+
#Errno::ETIME => :errno_etime_inspect,
|
181
|
+
#Errno::ETIMEDOUT => :errno_etimedout_inspect,
|
182
|
+
#Errno::ETOOMANYREFS => :errno_etoomanyrefs_inspect,
|
183
|
+
#Errno::ETXTBSY => :errno_etxtbsy_inspect,
|
184
|
+
#Errno::EUCLEAN => :errno_euclean_inspect,
|
185
|
+
#Errno::EUNATCH => :errno_eunatch_inspect,
|
186
|
+
#Errno::EUSERS => :errno_eusers_inspect,
|
187
|
+
#Errno::EWOULDBLOCK => :errno_ewouldblock_inspect,
|
188
|
+
#Errno::EXDEV => :errno_exdev_inspect,
|
189
|
+
#Errno::EXFULL => :errno_exfull_inspect,
|
190
|
+
#Errno::EXXX => :errno_exxx_inspect,
|
191
|
+
#Errno::NOERROR => :errno_noerror_inspect,
|
192
|
+
#ThreadError => :thread_error_inspect,
|
193
193
|
TypeError => :type_error_inspect,
|
194
194
|
ZeroDivisionError => :zero_division_error_inspect,
|
195
195
|
SystemStackError => :system_stack_error_inspect,
|
@@ -228,9 +228,9 @@ module Eturem
|
|
228
228
|
|
229
229
|
def syntax_error_inspect
|
230
230
|
if @unexpected.match(/^'(.)'$/)
|
231
|
-
highlight!(@script_lines[@lineno], Regexp.last_match(1), "\e[31m\e[4m")
|
231
|
+
highlight!(@script_lines[@lineno], Regexp.last_match(1), "\e[1;31m\e[4m")
|
232
232
|
elsif @unexpected.match(/^(?:keyword|modifier)_/)
|
233
|
-
highlight!(@script_lines[@lineno], Regexp.last_match.post_match, "\e[31m\e[4m")
|
233
|
+
highlight!(@script_lines[@lineno], Regexp.last_match.post_match, "\e[1;31m\e[4m")
|
234
234
|
end
|
235
235
|
unexpected = transform_syntax_error_keyword(@unexpected)
|
236
236
|
expected = @expected.split(/\s+or\s+/).map{ |ex| transform_syntax_error_keyword(ex) }
|
@@ -294,14 +294,15 @@ module Eturem
|
|
294
294
|
|
295
295
|
def name_error_inspect
|
296
296
|
if @exception.name.to_s.encode("UTF-8").include?(" ")
|
297
|
-
|
297
|
+
load_script
|
298
|
+
highlight!(@script_lines[@lineno], @exception.name.to_s, "\e[1;31m\e[4m")
|
298
299
|
return "スクリプト中に全角空白が混じっています。"
|
299
300
|
end
|
300
301
|
|
301
302
|
ret = "#{@exception.is_a?(NoMethodError) ? "" : "変数/"}メソッド" +
|
302
|
-
"「\e[31m\e[4m#{@exception.name}\e[0m」は存在しません。"
|
303
|
+
"「\e[1;31m\e[4m#{@exception.name}\e[0m」は存在しません。"
|
303
304
|
if @did_you_mean
|
304
|
-
did_you_mean = @did_you_mean.map{ |d| "\e[33m#{d}\e[0m" }.join(" / ")
|
305
|
+
did_you_mean = @did_you_mean.map{ |d| "\e[1;33m#{d}\e[0m" }.join(" / ")
|
305
306
|
ret += "「#{did_you_mean}」の入力ミスではありませんか?"
|
306
307
|
end
|
307
308
|
return ret
|
data/lib/eturem/version.rb
CHANGED
data/lib/eturem.rb
CHANGED
@@ -3,6 +3,7 @@ lang = "en"
|
|
3
3
|
output_backtrace = true
|
4
4
|
output_original = true
|
5
5
|
output_script = true
|
6
|
+
use_coderay = false
|
6
7
|
max_backtrace = 16
|
7
8
|
before_line_num = 2
|
8
9
|
after_line_num = 2
|
@@ -10,11 +11,12 @@ after_line_num = 2
|
|
10
11
|
config_file = File.join(Dir.home, ".eturem")
|
11
12
|
if File.exist?(config_file)
|
12
13
|
config = File.read(config_file)
|
13
|
-
enable = false if config.match(/^enable\s*\:\s*false/i)
|
14
|
+
enable = false if config.match(/^enable\s*\:\s*(?:false|off|0)/i)
|
14
15
|
lang = Regexp.last_match(:lang) if config.match(/^lang\s*\:\s*(?<lang>\S+)/i)
|
15
|
-
output_backtrace = false if config.match(/^output_backtrace\s*\:\s*false/i)
|
16
|
-
output_original = false if config.match( /^output_original\s*\:\s*false/i)
|
17
|
-
output_script = false if config.match( /^output_script\s*\:\s*false/i)
|
16
|
+
output_backtrace = false if config.match(/^output_backtrace\s*\:\s*(?:false|off|0)/i)
|
17
|
+
output_original = false if config.match( /^output_original\s*\:\s*(?:false|off|0)/i)
|
18
|
+
output_script = false if config.match( /^output_script\s*\:\s*(?:false|off|0)/i)
|
19
|
+
use_coderay = true if config.match( /^use_coderay\s*\:\s*(?:true|on|1)/i)
|
18
20
|
max_backtrace = Regexp.last_match(:num).to_i if config.match( /^max_backtrace\s*\:\s*(?<num>\d+)/i)
|
19
21
|
before_line_num = Regexp.last_match(:num).to_i if config.match(/^before_line_num\s*\:\s*(?<num>\d+)/i)
|
20
22
|
after_line_num = Regexp.last_match(:num).to_i if config.match( /^after_line_num\s*\:\s*(?<num>\d+)/i)
|
@@ -25,11 +27,13 @@ if defined? Eturem
|
|
25
27
|
Eturem.eturem_class.output_backtrace = output_backtrace
|
26
28
|
Eturem.eturem_class.output_original = output_original
|
27
29
|
Eturem.eturem_class.output_script = output_script
|
30
|
+
Eturem.eturem_class.use_coderay = use_coderay
|
28
31
|
Eturem.eturem_class.max_backtrace = max_backtrace
|
29
32
|
Eturem.eturem_class.before_line_num = before_line_num
|
30
33
|
Eturem.eturem_class.after_line_num = after_line_num
|
31
34
|
|
35
|
+
require "coderay" if use_coderay
|
32
36
|
exception = Eturem.load($0)
|
33
|
-
exception.
|
37
|
+
exception.output if exception
|
34
38
|
exit
|
35
39
|
end
|
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.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nodai2hITC
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|