Class: Errordeck::Backtrace::Line
- Inherits:
-
Struct
- Object
- Struct
- Errordeck::Backtrace::Line
- Defined in:
- lib/errordeck/errordeck/backtrace.rb
Constant Summary collapse
- RB_EXTENSION =
".rb"- RUBY_INPUT_FORMAT =
/ ^ \s* (?: [a-zA-Z]: | uri:classloader: )? ([^:]+ | <.*>): (\d+) (?: :in \s `([^']+)')?$ /x.freeze
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#in_app ⇒ Object
Returns the value of attribute in_app.
-
#line ⇒ Object
Returns the value of attribute line.
-
#method ⇒ Object
Returns the value of attribute method.
-
#module_name ⇒ Object
Returns the value of attribute module_name.
Class Method Summary collapse
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file
7 8 9 |
# File 'lib/errordeck/errordeck/backtrace.rb', line 7 def file @file end |
#in_app ⇒ Object
Returns the value of attribute in_app
7 8 9 |
# File 'lib/errordeck/errordeck/backtrace.rb', line 7 def in_app @in_app end |
#line ⇒ Object
Returns the value of attribute line
7 8 9 |
# File 'lib/errordeck/errordeck/backtrace.rb', line 7 def line @line end |
#method ⇒ Object
Returns the value of attribute method
7 8 9 |
# File 'lib/errordeck/errordeck/backtrace.rb', line 7 def method @method end |
#module_name ⇒ Object
Returns the value of attribute module_name
7 8 9 |
# File 'lib/errordeck/errordeck/backtrace.rb', line 7 def module_name @module_name end |
Class Method Details
.parse(unparsed_line) ⇒ Object
15 16 17 18 19 20 21 22 23 |
# File 'lib/errordeck/errordeck/backtrace.rb', line 15 def self.parse(unparsed_line) file, line, method = unparsed_line.match(RUBY_INPUT_FORMAT).captures file.sub!(/\.class$/, RB_EXTENSION) module_name = File.basename(file, ".*") + RB_EXTENSION in_app = %w[bin exe app config lib test].any? { |dir| file.include?(dir) } new(file, line.to_i, method, module_name, in_app) end |