debug_helper 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +22 -22
  3. data/README.md +848 -218
  4. data/lib/debug_helper.rb +79 -160
  5. data/lib/debug_helper/array_handler.rb +12 -0
  6. data/lib/debug_helper/dir_handler.rb +19 -0
  7. data/lib/debug_helper/each_pair_handler.rb +13 -0
  8. data/lib/debug_helper/each_with_index_handler.rb +11 -0
  9. data/lib/debug_helper/exception_handler.rb +14 -0
  10. data/lib/debug_helper/file_handler.rb +29 -0
  11. data/lib/debug_helper/generic_handler.rb +12 -0
  12. data/lib/debug_helper/handler.rb +102 -0
  13. data/lib/debug_helper/hash_handler.rb +19 -0
  14. data/lib/debug_helper/io_handler.rb +15 -0
  15. data/lib/debug_helper/match_data_handler.rb +17 -0
  16. data/lib/debug_helper/object_handler.rb +13 -0
  17. data/lib/debug_helper/open_struct_handler.rb +16 -0
  18. data/lib/debug_helper/range_handler.rb +14 -0
  19. data/lib/debug_helper/regexp_handler.rb +16 -0
  20. data/lib/debug_helper/set_handler.rb +12 -0
  21. data/lib/debug_helper/string_handler.rb +17 -0
  22. data/lib/debug_helper/struct_handler.rb +18 -0
  23. data/lib/debug_helper/symbol_handler.rb +15 -0
  24. data/lib/debug_helper/version.rb +3 -3
  25. data/markdown/readme/Rakefile +36 -6
  26. data/markdown/readme/class_inclusions.md +10 -3
  27. data/markdown/readme/class_links.md +10 -3
  28. data/markdown/readme/classes/array/circular/show.md +4 -2
  29. data/markdown/readme/classes/array/circular/show.yaml +4 -2
  30. data/markdown/readme/classes/array/mixed/show.md +6 -3
  31. data/markdown/readme/classes/array/mixed/show.yaml +6 -3
  32. data/markdown/readme/classes/array/nested/show.md +6 -3
  33. data/markdown/readme/classes/array/nested/show.yaml +6 -3
  34. data/markdown/readme/classes/array/simple/show.md +2 -1
  35. data/markdown/readme/classes/array/simple/show.yaml +2 -1
  36. data/markdown/readme/classes/dir/simple/show.md +28 -0
  37. data/markdown/readme/classes/dir/simple/show.rb +4 -0
  38. data/markdown/readme/classes/dir/simple/show.yaml +11 -0
  39. data/markdown/readme/classes/dir/simple/template.md +9 -0
  40. data/markdown/readme/classes/dir/template.md +3 -0
  41. data/markdown/readme/classes/exception/simple/show.md +44 -0
  42. data/markdown/readme/classes/exception/simple/show.rb +22 -0
  43. data/markdown/readme/classes/exception/simple/show.yaml +9 -0
  44. data/markdown/readme/classes/exception/simple/template.md +9 -0
  45. data/markdown/readme/classes/exception/template.md +3 -0
  46. data/markdown/readme/classes/file/simple/show.md +3 -3
  47. data/markdown/readme/classes/file/simple/show.yaml +3 -3
  48. data/markdown/readme/classes/hash/circular/show.md +12 -4
  49. data/markdown/readme/classes/hash/circular/show.yaml +12 -4
  50. data/markdown/readme/classes/hash/mixed/show.md +14 -6
  51. data/markdown/readme/classes/hash/mixed/show.yaml +14 -6
  52. data/markdown/readme/classes/hash/nested/show.md +24 -9
  53. data/markdown/readme/classes/hash/nested/show.yaml +24 -9
  54. data/markdown/readme/classes/hash/simple/show.md +10 -4
  55. data/markdown/readme/classes/hash/simple/show.yaml +10 -4
  56. data/markdown/readme/classes/io/simple/show.md +23 -0
  57. data/markdown/readme/classes/io/simple/show.rb +4 -0
  58. data/markdown/readme/classes/io/simple/show.yaml +6 -0
  59. data/markdown/readme/classes/io/simple/template.md +9 -0
  60. data/markdown/readme/classes/io/template.md +3 -0
  61. data/markdown/readme/classes/match_data/multiple_captures/show.md +33 -0
  62. data/markdown/readme/classes/match_data/multiple_captures/show.rb +4 -0
  63. data/markdown/readme/classes/match_data/multiple_captures/show.yaml +16 -0
  64. data/markdown/readme/classes/match_data/multiple_captures/template.md +9 -0
  65. data/markdown/readme/classes/match_data/named_captures/show.md +31 -0
  66. data/markdown/readme/classes/match_data/named_captures/show.rb +4 -0
  67. data/markdown/readme/classes/match_data/named_captures/show.yaml +14 -0
  68. data/markdown/readme/classes/match_data/named_captures/template.md +9 -0
  69. data/markdown/readme/classes/match_data/simple/show.md +25 -0
  70. data/markdown/readme/classes/match_data/simple/show.rb +4 -0
  71. data/markdown/readme/classes/match_data/simple/show.yaml +8 -0
  72. data/markdown/readme/classes/match_data/simple/template.md +9 -0
  73. data/markdown/readme/classes/match_data/template.md +7 -0
  74. data/markdown/readme/classes/object/object/show.md +23 -0
  75. data/markdown/readme/classes/object/object/show.rb +8 -0
  76. data/markdown/readme/classes/object/object/show.yaml +2 -0
  77. data/markdown/readme/classes/object/object/template.md +9 -0
  78. data/markdown/readme/classes/object/template.md +1 -7
  79. data/markdown/readme/classes/open_struct/circular/show.md +40 -0
  80. data/markdown/readme/classes/open_struct/circular/show.rb +8 -0
  81. data/markdown/readme/classes/open_struct/circular/show.yaml +17 -0
  82. data/markdown/readme/classes/open_struct/circular/template.md +11 -0
  83. data/markdown/readme/classes/open_struct/mixed/show.md +51 -0
  84. data/markdown/readme/classes/open_struct/mixed/show.rb +5 -0
  85. data/markdown/readme/classes/open_struct/mixed/show.yaml +33 -0
  86. data/markdown/readme/classes/open_struct/mixed/template.md +9 -0
  87. data/markdown/readme/classes/open_struct/nested/show.md +73 -0
  88. data/markdown/readme/classes/open_struct/nested/show.rb +14 -0
  89. data/markdown/readme/classes/open_struct/nested/show.yaml +46 -0
  90. data/markdown/readme/classes/open_struct/nested/template.md +9 -0
  91. data/markdown/readme/classes/open_struct/simple/show.md +41 -0
  92. data/markdown/readme/classes/open_struct/simple/show.rb +5 -0
  93. data/markdown/readme/classes/open_struct/simple/show.yaml +23 -0
  94. data/markdown/readme/classes/open_struct/simple/template.md +9 -0
  95. data/markdown/readme/classes/open_struct/template.md +9 -0
  96. data/markdown/readme/classes/range/exclude_end/show.md +22 -0
  97. data/markdown/readme/classes/range/exclude_end/show.rb +4 -0
  98. data/markdown/readme/classes/range/exclude_end/show.yaml +5 -0
  99. data/markdown/readme/classes/range/exclude_end/template.md +9 -0
  100. data/markdown/readme/classes/range/include_end/show.md +22 -0
  101. data/markdown/readme/classes/range/include_end/show.rb +4 -0
  102. data/markdown/readme/classes/range/include_end/show.yaml +5 -0
  103. data/markdown/readme/classes/range/include_end/template.md +9 -0
  104. data/markdown/readme/classes/range/template.md +5 -0
  105. data/markdown/readme/classes/regexp/named_captures/show.md +28 -0
  106. data/markdown/readme/classes/regexp/named_captures/show.rb +4 -0
  107. data/markdown/readme/classes/regexp/named_captures/show.yaml +11 -0
  108. data/markdown/readme/classes/regexp/named_captures/template.md +9 -0
  109. data/markdown/readme/classes/regexp/simple/show.md +24 -0
  110. data/markdown/readme/classes/regexp/simple/show.rb +4 -0
  111. data/markdown/readme/classes/regexp/simple/show.yaml +7 -0
  112. data/markdown/readme/classes/regexp/simple/template.md +9 -0
  113. data/markdown/readme/classes/regexp/template.md +5 -0
  114. data/markdown/readme/classes/set/circular/show.md +4 -2
  115. data/markdown/readme/classes/set/circular/show.yaml +4 -2
  116. data/markdown/readme/classes/set/mixed/show.md +6 -3
  117. data/markdown/readme/classes/set/mixed/show.yaml +6 -3
  118. data/markdown/readme/classes/set/nested/show.md +6 -3
  119. data/markdown/readme/classes/set/nested/show.yaml +6 -3
  120. data/markdown/readme/classes/set/simple/show.md +2 -1
  121. data/markdown/readme/classes/set/simple/show.yaml +2 -1
  122. data/markdown/readme/classes/string/multiline/show.md +2 -1
  123. data/markdown/readme/classes/string/multiline/show.yaml +2 -1
  124. data/markdown/readme/classes/string/simple/show.md +2 -1
  125. data/markdown/readme/classes/string/simple/show.yaml +2 -1
  126. data/markdown/readme/classes/struct/circular/show.md +34 -8
  127. data/markdown/readme/classes/struct/circular/show.yaml +34 -8
  128. data/markdown/readme/classes/struct/mixed/show.md +21 -6
  129. data/markdown/readme/classes/struct/mixed/show.yaml +21 -6
  130. data/markdown/readme/classes/struct/nested/show.md +36 -9
  131. data/markdown/readme/classes/struct/nested/show.yaml +36 -9
  132. data/markdown/readme/classes/struct/simple/show.md +17 -4
  133. data/markdown/readme/classes/struct/simple/show.yaml +17 -4
  134. data/markdown/readme/classes/symbol/simple/show.md +2 -1
  135. data/markdown/readme/classes/symbol/simple/show.yaml +2 -1
  136. data/markdown/readme/options/depth/show.md +30 -15
  137. data/markdown/readme/options/depth/show.yaml +30 -15
  138. data/markdown/readme/template.md +8 -8
  139. metadata +88 -14
  140. data/markdown/readme/classes/object/datetime/show.md +0 -18
  141. data/markdown/readme/classes/object/datetime/show.rb +0 -4
  142. data/markdown/readme/classes/object/datetime/show.yaml +0 -1
  143. data/markdown/readme/classes/object/datetime/template.md +0 -9
  144. data/markdown/readme/classes/object/range/show.md +0 -19
  145. data/markdown/readme/classes/object/range/show.rb +0 -4
  146. data/markdown/readme/classes/object/range/show.yaml +0 -2
  147. data/markdown/readme/classes/object/range/template.md +0 -9
  148. data/markdown/readme/classes/object/regexp/show.md +0 -19
  149. data/markdown/readme/classes/object/regexp/show.rb +0 -4
  150. data/markdown/readme/classes/object/regexp/show.yaml +0 -2
  151. data/markdown/readme/classes/object/regexp/template.md +0 -9
@@ -0,0 +1,4 @@
1
+ require 'debug_helper'
2
+
3
+ dir = Dir.new(File.dirname(__FILE__))
4
+ DebugHelper.show(dir, 'My simple dir')
@@ -0,0 +1,11 @@
1
+ ---
2
+ Dir (message='My simple dir'):
3
+ path: "."
4
+ entries:
5
+ - "."
6
+ - ".."
7
+ - show.md
8
+ - show.rb
9
+ - show.yaml
10
+ - template.md
11
+ exist?: true
@@ -0,0 +1,9 @@
1
+ #### Simple Dir
2
+
3
+ This example shows a simple ```Dir```.
4
+
5
+ @[ruby](show.rb)
6
+
7
+ The output shows details of the ```Dir```.
8
+
9
+ @[yaml](show.yaml)
@@ -0,0 +1,3 @@
1
+ ### Dir
2
+
3
+ @[:markdown](simple/show.md)
@@ -0,0 +1,44 @@
1
+ #### Simple Exception
2
+
3
+ This example shows a simple ```Exception```.
4
+
5
+ ```show.rb```:
6
+ ```ruby
7
+ require 'debug_helper'
8
+
9
+ def foo
10
+ exception = nil
11
+ begin
12
+ raise Exception.new('Boo!')
13
+ rescue Exception => exception
14
+ # Already saved.
15
+ end
16
+ DebugHelper.show(exception, 'My simple exception')
17
+ end
18
+
19
+ def bar
20
+ foo
21
+ end
22
+
23
+ def baz
24
+ bar
25
+ end
26
+
27
+ baz
28
+
29
+ ```
30
+
31
+ The output shows details of the ```Exception```.
32
+
33
+ ```show.yaml```:
34
+ ```yaml
35
+ ---
36
+ Exception (message='My simple exception'):
37
+ message: Boo!
38
+ cause:
39
+ backtrace:
40
+ - show.rb:6:in `foo'
41
+ - show.rb:14:in `bar'
42
+ - show.rb:18:in `baz'
43
+ - show.rb:21:in `<main>'
44
+ ```
@@ -0,0 +1,22 @@
1
+ require 'debug_helper'
2
+
3
+ def foo
4
+ exception = nil
5
+ begin
6
+ raise Exception.new('Boo!')
7
+ rescue Exception => exception
8
+ # Already saved.
9
+ end
10
+ DebugHelper.show(exception, 'My simple exception')
11
+ end
12
+
13
+ def bar
14
+ foo
15
+ end
16
+
17
+ def baz
18
+ bar
19
+ end
20
+
21
+ baz
22
+
@@ -0,0 +1,9 @@
1
+ ---
2
+ Exception (message='My simple exception'):
3
+ message: Boo!
4
+ cause:
5
+ backtrace:
6
+ - show.rb:6:in `foo'
7
+ - show.rb:14:in `bar'
8
+ - show.rb:18:in `baz'
9
+ - show.rb:21:in `<main>'
@@ -0,0 +1,9 @@
1
+ #### Simple Exception
2
+
3
+ This example shows a simple ```Exception```.
4
+
5
+ @[ruby](show.rb)
6
+
7
+ The output shows details of the ```Exception```.
8
+
9
+ @[yaml](show.yaml)
@@ -0,0 +1,3 @@
1
+ ### Exception
2
+
3
+ @[:markdown](simple/show.md)
@@ -17,12 +17,12 @@ The output shows details of the file.
17
17
  ---
18
18
  File (message='My simple file'):
19
19
  absolute_path: C:/Users/Burdette/Documents/GitHub/debug_helper/markdown/readme/classes/file/simple/show.rb
20
- atime: 2018-07-13 11:44:18.000000000 -05:00
21
- ctime: 2018-07-13 11:41:01.000000000 -05:00
20
+ atime: 2018-07-14 12:45:32.000000000 -05:00
21
+ ctime: 2018-07-14 12:45:32.000000000 -05:00
22
22
  executable?: false
23
23
  exist?: true
24
24
  ftype: file
25
- mtime: 2018-07-13 11:44:18.000000000 -05:00
25
+ mtime: 2018-07-14 12:45:32.000000000 -05:00
26
26
  path: show.rb
27
27
  pipe?: false
28
28
  readable?: true
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  File (message='My simple file'):
3
3
  absolute_path: C:/Users/Burdette/Documents/GitHub/debug_helper/markdown/readme/classes/file/simple/show.rb
4
- atime: 2018-07-13 11:44:18.000000000 -05:00
5
- ctime: 2018-07-13 11:41:01.000000000 -05:00
4
+ atime: 2018-07-14 12:45:32.000000000 -05:00
5
+ ctime: 2018-07-14 12:45:32.000000000 -05:00
6
6
  executable?: false
7
7
  exist?: true
8
8
  ftype: file
9
- mtime: 2018-07-13 11:44:18.000000000 -05:00
9
+ mtime: 2018-07-14 12:45:32.000000000 -05:00
10
10
  path: show.rb
11
11
  pipe?: false
12
12
  readable?: true
@@ -20,18 +20,26 @@ The circular reference is not followed.
20
20
  ```show.yaml```:
21
21
  ```yaml
22
22
  ---
23
- Hash (size=1 message='My circular hashes'):
23
+ Hash (message='My circular hashes'):
24
+ size: 1
25
+ default:
26
+ default_proc:
24
27
  Pair 0:
25
28
  Key:
26
- Symbol (size=3):
29
+ Symbol:
27
30
  to_s: foo
31
+ size: 3
28
32
  encoding: !ruby/encoding US-ASCII
29
33
  Value:
30
- Hash (size=1):
34
+ Hash:
35
+ size: 1
36
+ default:
37
+ default_proc:
31
38
  Pair 0:
32
39
  Key:
33
- Symbol (size=3):
40
+ Symbol:
34
41
  to_s: bar
42
+ size: 3
35
43
  encoding: !ruby/encoding US-ASCII
36
44
  Value: Hash {:foo=>{:bar=>{...}}}
37
45
  ```
@@ -1,15 +1,23 @@
1
1
  ---
2
- Hash (size=1 message='My circular hashes'):
2
+ Hash (message='My circular hashes'):
3
+ size: 1
4
+ default:
5
+ default_proc:
3
6
  Pair 0:
4
7
  Key:
5
- Symbol (size=3):
8
+ Symbol:
6
9
  to_s: foo
10
+ size: 3
7
11
  encoding: !ruby/encoding US-ASCII
8
12
  Value:
9
- Hash (size=1):
13
+ Hash:
14
+ size: 1
15
+ default:
16
+ default_proc:
10
17
  Pair 0:
11
18
  Key:
12
- Symbol (size=3):
19
+ Symbol:
13
20
  to_s: bar
21
+ size: 3
14
22
  encoding: !ruby/encoding US-ASCII
15
23
  Value: Hash {:foo=>{:bar=>{...}}}
@@ -19,31 +19,39 @@ The output shows details of the hash.
19
19
  ```show.yaml```:
20
20
  ```yaml
21
21
  ---
22
- Hash (size=3 message='My mixed hash'):
22
+ Hash (message='My mixed hash'):
23
+ size: 3
24
+ default:
25
+ default_proc:
23
26
  Pair 0:
24
27
  Key:
25
- Symbol (size=1):
28
+ Symbol:
26
29
  to_s: a
30
+ size: 1
27
31
  encoding: !ruby/encoding US-ASCII
28
32
  Value: Fixnum 0
29
33
  Pair 1:
30
34
  Key:
31
- Symbol (size=1):
35
+ Symbol:
32
36
  to_s: b
37
+ size: 1
33
38
  encoding: !ruby/encoding US-ASCII
34
39
  Value:
35
- String (size=3):
40
+ String:
36
41
  to_s: one
42
+ size: 3
37
43
  encoding: !ruby/encoding UTF-8
38
44
  ascii_only?: true
39
45
  bytesize: 3
40
46
  Pair 2:
41
47
  Key:
42
- Symbol (size=1):
48
+ Symbol:
43
49
  to_s: c
50
+ size: 1
44
51
  encoding: !ruby/encoding US-ASCII
45
52
  Value:
46
- Symbol (size=3):
53
+ Symbol:
47
54
  to_s: two
55
+ size: 3
48
56
  encoding: !ruby/encoding US-ASCII
49
57
  ```
@@ -1,28 +1,36 @@
1
1
  ---
2
- Hash (size=3 message='My mixed hash'):
2
+ Hash (message='My mixed hash'):
3
+ size: 3
4
+ default:
5
+ default_proc:
3
6
  Pair 0:
4
7
  Key:
5
- Symbol (size=1):
8
+ Symbol:
6
9
  to_s: a
10
+ size: 1
7
11
  encoding: !ruby/encoding US-ASCII
8
12
  Value: Fixnum 0
9
13
  Pair 1:
10
14
  Key:
11
- Symbol (size=1):
15
+ Symbol:
12
16
  to_s: b
17
+ size: 1
13
18
  encoding: !ruby/encoding US-ASCII
14
19
  Value:
15
- String (size=3):
20
+ String:
16
21
  to_s: one
22
+ size: 3
17
23
  encoding: !ruby/encoding UTF-8
18
24
  ascii_only?: true
19
25
  bytesize: 3
20
26
  Pair 2:
21
27
  Key:
22
- Symbol (size=1):
28
+ Symbol:
23
29
  to_s: c
30
+ size: 1
24
31
  encoding: !ruby/encoding US-ASCII
25
32
  Value:
26
- Symbol (size=3):
33
+ Symbol:
27
34
  to_s: two
35
+ size: 3
28
36
  encoding: !ruby/encoding US-ASCII
@@ -24,43 +24,58 @@ The output shows details of the hashes.
24
24
  ```show.yaml```:
25
25
  ```yaml
26
26
  ---
27
- Hash (size=2 message='My nested hash'):
27
+ Hash (message='My nested hash'):
28
+ size: 2
29
+ default:
30
+ default_proc:
28
31
  Pair 0:
29
32
  Key:
30
- Symbol (size=1):
33
+ Symbol:
31
34
  to_s: a
35
+ size: 1
32
36
  encoding: !ruby/encoding US-ASCII
33
37
  Value:
34
- Hash (size=2):
38
+ Hash:
39
+ size: 2
40
+ default:
41
+ default_proc:
35
42
  Pair 0:
36
43
  Key:
37
- Symbol (size=1):
44
+ Symbol:
38
45
  to_s: b
46
+ size: 1
39
47
  encoding: !ruby/encoding US-ASCII
40
48
  Value: Fixnum 0
41
49
  Pair 1:
42
50
  Key:
43
- Symbol (size=1):
51
+ Symbol:
44
52
  to_s: c
53
+ size: 1
45
54
  encoding: !ruby/encoding US-ASCII
46
55
  Value: Fixnum 1
47
56
  Pair 1:
48
57
  Key:
49
- Symbol (size=1):
58
+ Symbol:
50
59
  to_s: d
60
+ size: 1
51
61
  encoding: !ruby/encoding US-ASCII
52
62
  Value:
53
- Hash (size=2):
63
+ Hash:
64
+ size: 2
65
+ default:
66
+ default_proc:
54
67
  Pair 0:
55
68
  Key:
56
- Symbol (size=1):
69
+ Symbol:
57
70
  to_s: e
71
+ size: 1
58
72
  encoding: !ruby/encoding US-ASCII
59
73
  Value: Fixnum 2
60
74
  Pair 1:
61
75
  Key:
62
- Symbol (size=1):
76
+ Symbol:
63
77
  to_s: f
78
+ size: 1
64
79
  encoding: !ruby/encoding US-ASCII
65
80
  Value: Fixnum 3
66
81
  ```
@@ -1,40 +1,55 @@
1
1
  ---
2
- Hash (size=2 message='My nested hash'):
2
+ Hash (message='My nested hash'):
3
+ size: 2
4
+ default:
5
+ default_proc:
3
6
  Pair 0:
4
7
  Key:
5
- Symbol (size=1):
8
+ Symbol:
6
9
  to_s: a
10
+ size: 1
7
11
  encoding: !ruby/encoding US-ASCII
8
12
  Value:
9
- Hash (size=2):
13
+ Hash:
14
+ size: 2
15
+ default:
16
+ default_proc:
10
17
  Pair 0:
11
18
  Key:
12
- Symbol (size=1):
19
+ Symbol:
13
20
  to_s: b
21
+ size: 1
14
22
  encoding: !ruby/encoding US-ASCII
15
23
  Value: Fixnum 0
16
24
  Pair 1:
17
25
  Key:
18
- Symbol (size=1):
26
+ Symbol:
19
27
  to_s: c
28
+ size: 1
20
29
  encoding: !ruby/encoding US-ASCII
21
30
  Value: Fixnum 1
22
31
  Pair 1:
23
32
  Key:
24
- Symbol (size=1):
33
+ Symbol:
25
34
  to_s: d
35
+ size: 1
26
36
  encoding: !ruby/encoding US-ASCII
27
37
  Value:
28
- Hash (size=2):
38
+ Hash:
39
+ size: 2
40
+ default:
41
+ default_proc:
29
42
  Pair 0:
30
43
  Key:
31
- Symbol (size=1):
44
+ Symbol:
32
45
  to_s: e
46
+ size: 1
33
47
  encoding: !ruby/encoding US-ASCII
34
48
  Value: Fixnum 2
35
49
  Pair 1:
36
50
  Key:
37
- Symbol (size=1):
51
+ Symbol:
38
52
  to_s: f
53
+ size: 1
39
54
  encoding: !ruby/encoding US-ASCII
40
55
  Value: Fixnum 3