-
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 #17 from BurdetteLamar/classes
Dir
- Loading branch information
Showing
16 changed files
with
156 additions
and
13 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,26 @@ | ||
class DebugHelper | ||
|
||
class DirHandler < Handler | ||
|
||
def show | ||
# Instance methods. | ||
[ | ||
:path, | ||
].each do |method| | ||
self.content.store(method.to_s, obj.send(method)) | ||
end | ||
# Class methods. | ||
{ | ||
:entries => [obj.path], | ||
:exist? => [obj.path], | ||
}.each_pair do |method, args| | ||
self.content.store(method.to_s, Dir.send(method, *args)) | ||
end | ||
self.attrs = { | ||
:message => message, | ||
} | ||
show_item | ||
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
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 |
---|---|---|
|
@@ -4,5 +4,6 @@ | |
- [String](#string) | ||
- [Symbol](#symbol) | ||
- [File](#file) | ||
- [Dir](#dir) | ||
- [Set](#set) | ||
- [OpenStruct](#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#### Simple Dir | ||
|
||
This example shows a simple ```Dir ``. | ||
|
||
```show.rb```: | ||
```ruby | ||
require 'debug_helper' | ||
|
||
dir = Dir.new(File.dirname(__FILE__)) | ||
DebugHelper.show(dir, 'My simple dir') | ||
``` | ||
|
||
The output shows details of the ```Dir```. | ||
|
||
```show.yaml```: | ||
```yaml | ||
--- | ||
Dir (message='My simple dir'): | ||
path: "." | ||
entries: | ||
- "." | ||
- ".." | ||
- show.md | ||
- show.rb | ||
- show.yaml | ||
- template.md | ||
exist?: true | ||
``` |
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 @@ | ||
require 'debug_helper' | ||
|
||
dir = Dir.new(File.dirname(__FILE__)) | ||
DebugHelper.show(dir, 'My simple dir') |
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,11 @@ | ||
--- | ||
Dir (message='My simple dir'): | ||
path: "." | ||
entries: | ||
- "." | ||
- ".." | ||
- show.md | ||
- show.rb | ||
- show.yaml | ||
- template.md | ||
exist?: true |
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 Dir | ||
|
||
This example shows a simple ```Dir ``. | ||
|
||
@[ruby](show.rb) | ||
|
||
The output shows details of the ```Dir```. | ||
|
||
@[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 @@ | ||
### Dir | ||
|
||
@[: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-17T10:06:48-05:00 ((2458317j,54408s,181332000n),-18000s,2299161j)>' | ||
--- 'DateTime (message=''My datetime'') #<DateTime: 2018-07-17T14:30:03-05:00 ((2458317j,70203s,764562000n),-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,11 @@ | ||
--- | ||
Dir (message='test_dir'): | ||
path: C:/Users/Burdette/Documents/GitHub/debug_helper/test | ||
entries: | ||
- "." | ||
- ".." | ||
- debug_helper_test.rb | ||
- show | ||
- show_hash | ||
- test_helper.rb | ||
exist?: true |
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,11 @@ | ||
--- | ||
Dir (message='test_dir'): | ||
path: C:/Users/Burdette/Documents/GitHub/debug_helper/test | ||
entries: | ||
- "." | ||
- ".." | ||
- debug_helper_test.rb | ||
- show | ||
- show_hash | ||
- test_helper.rb | ||
exist?: true |