-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21 from BurdetteLamar/classes
Classes
- Loading branch information
Showing
16 changed files
with
197 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class DebugHelper | ||
|
||
class ExceptionHandler < Handler | ||
|
||
def calls_for_instance | ||
[ | ||
[:message], | ||
[:cause], | ||
[:backtrace], | ||
] | ||
end | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ namespace :build do | |
File | ||
Dir | ||
IO | ||
Exception | ||
Range | ||
Set | ||
OpenStruct | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#### Simple Exception | ||
|
||
This example shows a simple ```Exception```. | ||
|
||
```show.rb```: | ||
```ruby | ||
require 'debug_helper' | ||
|
||
def foo | ||
exception = nil | ||
begin | ||
raise Exception.new('Boo!') | ||
rescue Exception => exception | ||
# Already saved. | ||
end | ||
DebugHelper.show(exception, 'My simple exception') | ||
end | ||
|
||
def bar | ||
foo | ||
end | ||
|
||
def baz | ||
bar | ||
end | ||
|
||
baz | ||
|
||
``` | ||
|
||
The output shows details of the ```Exception```. | ||
|
||
```show.yaml```: | ||
```yaml | ||
--- | ||
Exception (message='My simple exception'): | ||
message: Boo! | ||
cause: | ||
backtrace: | ||
- show.rb:6:in `foo' | ||
- show.rb:14:in `bar' | ||
- show.rb:18:in `baz' | ||
- show.rb:21:in `<main>' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require 'debug_helper' | ||
|
||
def foo | ||
exception = nil | ||
begin | ||
raise Exception.new('Boo!') | ||
rescue Exception => exception | ||
# Already saved. | ||
end | ||
DebugHelper.show(exception, 'My simple exception') | ||
end | ||
|
||
def bar | ||
foo | ||
end | ||
|
||
def baz | ||
bar | ||
end | ||
|
||
baz | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
Exception (message='My simple exception'): | ||
message: Boo! | ||
cause: | ||
backtrace: | ||
- show.rb:6:in `foo' | ||
- show.rb:14:in `bar' | ||
- show.rb:18:in `baz' | ||
- show.rb:21:in `<main>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#### Simple Exception | ||
|
||
This example shows a simple ```Exception```. | ||
|
||
@[ruby](show.rb) | ||
|
||
The output shows details of the ```Exception```. | ||
|
||
@[yaml](show.yaml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### Exception | ||
|
||
@[:markdown](simple/show.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
--- 'DateTime (message=''My datetime'') #<DateTime: 2018-07-25T15:20:00-05:00 ((2458325j,73200s,564492000n),-18000s,2299161j)>' | ||
--- 'DateTime (message=''My datetime'') #<DateTime: 2018-07-25T18:07:41-05:00 ((2458325j,83261s,119718000n),-18000s,2299161j)>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
Exception (message='test_exception'): | ||
message: Boo! | ||
cause: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
Exception (message='test_exception'): | ||
message: Boo! | ||
cause: |