debug_helper 1.0.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 (100) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -0
  3. data/.travis.yml +5 -0
  4. data/CODE_OF_CONDUCT.md +74 -0
  5. data/Gemfile +6 -0
  6. data/Gemfile.lock +22 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +593 -0
  9. data/Rakefile +10 -0
  10. data/bin/console +14 -0
  11. data/bin/setup +8 -0
  12. data/debug_helper.gemspec +37 -0
  13. data/lib/debug_helper.rb +154 -0
  14. data/lib/debug_helper/version.rb +3 -0
  15. data/markdown/readme/Rakefile +53 -0
  16. data/markdown/readme/class_inclusions.md +6 -0
  17. data/markdown/readme/class_links.md +5 -0
  18. data/markdown/readme/classes/array/circular/show.md +27 -0
  19. data/markdown/readme/classes/array/circular/show.rb +7 -0
  20. data/markdown/readme/classes/array/circular/show.yaml +5 -0
  21. data/markdown/readme/classes/array/circular/template.md +11 -0
  22. data/markdown/readme/classes/array/mixed/show.md +25 -0
  23. data/markdown/readme/classes/array/mixed/show.rb +4 -0
  24. data/markdown/readme/classes/array/mixed/show.yaml +8 -0
  25. data/markdown/readme/classes/array/mixed/template.md +9 -0
  26. data/markdown/readme/classes/array/nested/show.md +28 -0
  27. data/markdown/readme/classes/array/nested/show.rb +4 -0
  28. data/markdown/readme/classes/array/nested/show.yaml +11 -0
  29. data/markdown/readme/classes/array/nested/template.md +9 -0
  30. data/markdown/readme/classes/array/simple/show.md +22 -0
  31. data/markdown/readme/classes/array/simple/show.rb +4 -0
  32. data/markdown/readme/classes/array/simple/show.yaml +5 -0
  33. data/markdown/readme/classes/array/simple/template.md +9 -0
  34. data/markdown/readme/classes/array/template.md +9 -0
  35. data/markdown/readme/classes/hash/circular/show.md +33 -0
  36. data/markdown/readme/classes/hash/circular/show.rb +7 -0
  37. data/markdown/readme/classes/hash/circular/show.yaml +11 -0
  38. data/markdown/readme/classes/hash/circular/template.md +11 -0
  39. data/markdown/readme/classes/hash/mixed/show.md +38 -0
  40. data/markdown/readme/classes/hash/mixed/show.rb +8 -0
  41. data/markdown/readme/classes/hash/mixed/show.yaml +17 -0
  42. data/markdown/readme/classes/hash/mixed/template.md +9 -0
  43. data/markdown/readme/classes/hash/nested/show.md +54 -0
  44. data/markdown/readme/classes/hash/nested/show.rb +13 -0
  45. data/markdown/readme/classes/hash/nested/show.yaml +28 -0
  46. data/markdown/readme/classes/hash/nested/template.md +9 -0
  47. data/markdown/readme/classes/hash/simple/show.md +31 -0
  48. data/markdown/readme/classes/hash/simple/show.rb +4 -0
  49. data/markdown/readme/classes/hash/simple/show.yaml +14 -0
  50. data/markdown/readme/classes/hash/simple/template.md +9 -0
  51. data/markdown/readme/classes/hash/template.md +9 -0
  52. data/markdown/readme/classes/object/datetime/show.md +19 -0
  53. data/markdown/readme/classes/object/datetime/show.rb +4 -0
  54. data/markdown/readme/classes/object/datetime/show.yaml +2 -0
  55. data/markdown/readme/classes/object/datetime/template.md +9 -0
  56. data/markdown/readme/classes/object/range/show.md +19 -0
  57. data/markdown/readme/classes/object/range/show.rb +4 -0
  58. data/markdown/readme/classes/object/range/show.yaml +2 -0
  59. data/markdown/readme/classes/object/range/template.md +9 -0
  60. data/markdown/readme/classes/object/regexp/show.md +19 -0
  61. data/markdown/readme/classes/object/regexp/show.rb +4 -0
  62. data/markdown/readme/classes/object/regexp/show.yaml +2 -0
  63. data/markdown/readme/classes/object/regexp/template.md +9 -0
  64. data/markdown/readme/classes/object/template.md +11 -0
  65. data/markdown/readme/classes/string/multiline/show.md +25 -0
  66. data/markdown/readme/classes/string/multiline/show.rb +7 -0
  67. data/markdown/readme/classes/string/multiline/show.yaml +5 -0
  68. data/markdown/readme/classes/string/multiline/template.md +9 -0
  69. data/markdown/readme/classes/string/simple/show.md +20 -0
  70. data/markdown/readme/classes/string/simple/show.rb +4 -0
  71. data/markdown/readme/classes/string/simple/show.yaml +3 -0
  72. data/markdown/readme/classes/string/simple/template.md +9 -0
  73. data/markdown/readme/classes/string/template.md +5 -0
  74. data/markdown/readme/classes/struct/circular/show.md +45 -0
  75. data/markdown/readme/classes/struct/circular/show.rb +8 -0
  76. data/markdown/readme/classes/struct/circular/show.yaml +22 -0
  77. data/markdown/readme/classes/struct/circular/template.md +11 -0
  78. data/markdown/readme/classes/struct/mixed/show.md +32 -0
  79. data/markdown/readme/classes/struct/mixed/show.rb +5 -0
  80. data/markdown/readme/classes/struct/mixed/show.yaml +14 -0
  81. data/markdown/readme/classes/struct/mixed/template.md +9 -0
  82. data/markdown/readme/classes/struct/nested/show.md +43 -0
  83. data/markdown/readme/classes/struct/nested/show.rb +8 -0
  84. data/markdown/readme/classes/struct/nested/show.yaml +22 -0
  85. data/markdown/readme/classes/struct/nested/template.md +9 -0
  86. data/markdown/readme/classes/struct/simple/show.md +29 -0
  87. data/markdown/readme/classes/struct/simple/show.rb +5 -0
  88. data/markdown/readme/classes/struct/simple/show.yaml +11 -0
  89. data/markdown/readme/classes/struct/simple/template.md +9 -0
  90. data/markdown/readme/classes/struct/template.md +9 -0
  91. data/markdown/readme/classes/symbol/simple/show.md +18 -0
  92. data/markdown/readme/classes/symbol/simple/show.rb +3 -0
  93. data/markdown/readme/classes/symbol/simple/show.yaml +2 -0
  94. data/markdown/readme/classes/symbol/simple/template.md +9 -0
  95. data/markdown/readme/classes/symbol/template.md +3 -0
  96. data/markdown/readme/classes/template.md +12 -0
  97. data/markdown/readme/show_array.rb +3 -0
  98. data/markdown/readme/show_hash.rb +3 -0
  99. data/markdown/readme/template.md +25 -0
  100. metadata +186 -0
@@ -0,0 +1,4 @@
1
+ require 'debug_helper'
2
+
3
+ ary = [0, [1, 2], [3, 4]]
4
+ DebugHelper.show(ary, 'My nested arrays')
@@ -0,0 +1,11 @@
1
+ ---
2
+ Array (name='My nested arrays' size=3):
3
+ Element 0: Fixnum 0
4
+ Element 1:
5
+ Array (size=2):
6
+ Element 0: Fixnum 1
7
+ Element 1: Fixnum 2
8
+ Element 2:
9
+ Array (size=2):
10
+ Element 0: Fixnum 3
11
+ Element 1: Fixnum 4
@@ -0,0 +1,9 @@
1
+ #### Nested Arrays
2
+
3
+ This example shows nested arrays.
4
+
5
+ @[ruby](show.rb)
6
+
7
+ The output shows details of the arrays.
8
+
9
+ @[yaml](show.yaml)
@@ -0,0 +1,22 @@
1
+ #### Simple Array
2
+
3
+ This example shows a simple array of integers.
4
+
5
+ ```show.rb```:
6
+ ```ruby
7
+ require 'debug_helper'
8
+
9
+ ary = [5, 10, 15]
10
+ DebugHelper.show(ary, 'My simple array')
11
+ ```
12
+
13
+ The output shows details of the array.
14
+
15
+ ```show.yaml```:
16
+ ```yaml
17
+ ---
18
+ Array (name='My simple array' size=3):
19
+ Element 0: Fixnum 5
20
+ Element 1: Fixnum 10
21
+ Element 2: Fixnum 15
22
+ ```
@@ -0,0 +1,4 @@
1
+ require 'debug_helper'
2
+
3
+ ary = [5, 10, 15]
4
+ DebugHelper.show(ary, 'My simple array')
@@ -0,0 +1,5 @@
1
+ ---
2
+ Array (name='My simple array' size=3):
3
+ Element 0: Fixnum 5
4
+ Element 1: Fixnum 10
5
+ Element 2: Fixnum 15
@@ -0,0 +1,9 @@
1
+ #### Simple Array
2
+
3
+ This example shows a simple array of integers.
4
+
5
+ @[ruby](show.rb)
6
+
7
+ The output shows details of the array.
8
+
9
+ @[yaml](show.yaml)
@@ -0,0 +1,9 @@
1
+ ### Array
2
+
3
+ @[:markdown](simple/show.md)
4
+
5
+ @[:markdown](mixed/show.md)
6
+
7
+ @[:markdown](nested/show.md)
8
+
9
+ @[:markdown](circular/show.md)
@@ -0,0 +1,33 @@
1
+ #### Circular Hashes
2
+
3
+ This example shows hashes that make a circular reference.
4
+
5
+ ```show.rb```:
6
+ ```ruby
7
+ require 'debug_helper'
8
+
9
+ hash_0 = {}
10
+ hash_1 = {}
11
+ hash_0.store(:foo, hash_1)
12
+ hash_1.store(:bar, hash_0)
13
+ DebugHelper.show(hash_0, 'My circular hashes')
14
+ ```
15
+
16
+ The output shows details of the hashes.
17
+
18
+ The circular reference is not followed.
19
+
20
+ ```show.yaml```:
21
+ ```yaml
22
+ ---
23
+ Hash (size=1 name='My circular hashes'):
24
+ Pair 0:
25
+ Key:
26
+ Symbol (size=3 encoding=US-ASCII): :foo
27
+ Value:
28
+ Hash (size=1):
29
+ Pair 0:
30
+ Key:
31
+ Symbol (size=3 encoding=US-ASCII): :bar
32
+ Value: Hash {:foo=>{:bar=>{...}}}
33
+ ```
@@ -0,0 +1,7 @@
1
+ require 'debug_helper'
2
+
3
+ hash_0 = {}
4
+ hash_1 = {}
5
+ hash_0.store(:foo, hash_1)
6
+ hash_1.store(:bar, hash_0)
7
+ DebugHelper.show(hash_0, 'My circular hashes')
@@ -0,0 +1,11 @@
1
+ ---
2
+ Hash (size=1 name='My circular hashes'):
3
+ Pair 0:
4
+ Key:
5
+ Symbol (size=3 encoding=US-ASCII): :foo
6
+ Value:
7
+ Hash (size=1):
8
+ Pair 0:
9
+ Key:
10
+ Symbol (size=3 encoding=US-ASCII): :bar
11
+ Value: Hash {:foo=>{:bar=>{...}}}
@@ -0,0 +1,11 @@
1
+ #### Circular Hashes
2
+
3
+ This example shows hashes that make a circular reference.
4
+
5
+ @[ruby](show.rb)
6
+
7
+ The output shows details of the hashes.
8
+
9
+ The circular reference is not followed.
10
+
11
+ @[yaml](show.yaml)
@@ -0,0 +1,38 @@
1
+ #### Mixed Hash
2
+
3
+ This example shows a hash of mixed values.
4
+
5
+ ```show.rb```:
6
+ ```ruby
7
+ require 'debug_helper'
8
+
9
+ hash = {
10
+ :a => 0,
11
+ :b => 'one',
12
+ :c => :two,
13
+ }
14
+ DebugHelper.show(hash, 'My mixed hash')
15
+ ```
16
+
17
+ The output shows details of the hash.
18
+
19
+ ```show.yaml```:
20
+ ```yaml
21
+ ---
22
+ Hash (size=3 name='My mixed hash'):
23
+ Pair 0:
24
+ Key:
25
+ Symbol (size=1 encoding=US-ASCII): :a
26
+ Value: Fixnum 0
27
+ Pair 1:
28
+ Key:
29
+ Symbol (size=1 encoding=US-ASCII): :b
30
+ Value:
31
+ String (size=3 encoding=UTF-8 ascii_only=true bytesize=3):
32
+ - one
33
+ Pair 2:
34
+ Key:
35
+ Symbol (size=1 encoding=US-ASCII): :c
36
+ Value:
37
+ Symbol (size=3 encoding=US-ASCII): :two
38
+ ```
@@ -0,0 +1,8 @@
1
+ require 'debug_helper'
2
+
3
+ hash = {
4
+ :a => 0,
5
+ :b => 'one',
6
+ :c => :two,
7
+ }
8
+ DebugHelper.show(hash, 'My mixed hash')
@@ -0,0 +1,17 @@
1
+ ---
2
+ Hash (size=3 name='My mixed hash'):
3
+ Pair 0:
4
+ Key:
5
+ Symbol (size=1 encoding=US-ASCII): :a
6
+ Value: Fixnum 0
7
+ Pair 1:
8
+ Key:
9
+ Symbol (size=1 encoding=US-ASCII): :b
10
+ Value:
11
+ String (size=3 encoding=UTF-8 ascii_only=true bytesize=3):
12
+ - one
13
+ Pair 2:
14
+ Key:
15
+ Symbol (size=1 encoding=US-ASCII): :c
16
+ Value:
17
+ Symbol (size=3 encoding=US-ASCII): :two
@@ -0,0 +1,9 @@
1
+ #### Mixed Hash
2
+
3
+ This example shows a hash of mixed values.
4
+
5
+ @[ruby](show.rb)
6
+
7
+ The output shows details of the hash.
8
+
9
+ @[yaml](show.yaml)
@@ -0,0 +1,54 @@
1
+ #### Nested Hashes
2
+
3
+ This example shows nested hashes.
4
+
5
+ ```show.rb```:
6
+ ```ruby
7
+ require 'debug_helper'
8
+
9
+ hash = {
10
+ :a => {
11
+ :b => 0,
12
+ :c => 1,
13
+ },
14
+ :d => {
15
+ :e => 2,
16
+ :f => 3,
17
+ }
18
+ }
19
+ DebugHelper.show(hash, 'My nested hash')
20
+ ```
21
+
22
+ The output shows details of the hashes.
23
+
24
+ ```show.yaml```:
25
+ ```yaml
26
+ ---
27
+ Hash (size=2 name='My nested hash'):
28
+ Pair 0:
29
+ Key:
30
+ Symbol (size=1 encoding=US-ASCII): :a
31
+ Value:
32
+ Hash (size=2):
33
+ Pair 0:
34
+ Key:
35
+ Symbol (size=1 encoding=US-ASCII): :b
36
+ Value: Fixnum 0
37
+ Pair 1:
38
+ Key:
39
+ Symbol (size=1 encoding=US-ASCII): :c
40
+ Value: Fixnum 1
41
+ Pair 1:
42
+ Key:
43
+ Symbol (size=1 encoding=US-ASCII): :d
44
+ Value:
45
+ Hash (size=2):
46
+ Pair 0:
47
+ Key:
48
+ Symbol (size=1 encoding=US-ASCII): :e
49
+ Value: Fixnum 2
50
+ Pair 1:
51
+ Key:
52
+ Symbol (size=1 encoding=US-ASCII): :f
53
+ Value: Fixnum 3
54
+ ```
@@ -0,0 +1,13 @@
1
+ require 'debug_helper'
2
+
3
+ hash = {
4
+ :a => {
5
+ :b => 0,
6
+ :c => 1,
7
+ },
8
+ :d => {
9
+ :e => 2,
10
+ :f => 3,
11
+ }
12
+ }
13
+ DebugHelper.show(hash, 'My nested hash')
@@ -0,0 +1,28 @@
1
+ ---
2
+ Hash (size=2 name='My nested hash'):
3
+ Pair 0:
4
+ Key:
5
+ Symbol (size=1 encoding=US-ASCII): :a
6
+ Value:
7
+ Hash (size=2):
8
+ Pair 0:
9
+ Key:
10
+ Symbol (size=1 encoding=US-ASCII): :b
11
+ Value: Fixnum 0
12
+ Pair 1:
13
+ Key:
14
+ Symbol (size=1 encoding=US-ASCII): :c
15
+ Value: Fixnum 1
16
+ Pair 1:
17
+ Key:
18
+ Symbol (size=1 encoding=US-ASCII): :d
19
+ Value:
20
+ Hash (size=2):
21
+ Pair 0:
22
+ Key:
23
+ Symbol (size=1 encoding=US-ASCII): :e
24
+ Value: Fixnum 2
25
+ Pair 1:
26
+ Key:
27
+ Symbol (size=1 encoding=US-ASCII): :f
28
+ Value: Fixnum 3
@@ -0,0 +1,9 @@
1
+ #### Nested Hashes
2
+
3
+ This example shows nested hashes.
4
+
5
+ @[ruby](show.rb)
6
+
7
+ The output shows details of the hashes.
8
+
9
+ @[yaml](show.yaml)
@@ -0,0 +1,31 @@
1
+ #### Simple Hash
2
+
3
+ This example shows a simple hash.
4
+
5
+ ```show.rb```:
6
+ ```ruby
7
+ require 'debug_helper'
8
+
9
+ hash = {:a => 0, :b => 1, :c => 2}
10
+ DebugHelper.show(hash, 'My simple hash')
11
+ ```
12
+
13
+ The output shows details of the hash.
14
+
15
+ ```show.yaml```:
16
+ ```yaml
17
+ ---
18
+ Hash (size=3 name='My simple hash'):
19
+ Pair 0:
20
+ Key:
21
+ Symbol (size=1 encoding=US-ASCII): :a
22
+ Value: Fixnum 0
23
+ Pair 1:
24
+ Key:
25
+ Symbol (size=1 encoding=US-ASCII): :b
26
+ Value: Fixnum 1
27
+ Pair 2:
28
+ Key:
29
+ Symbol (size=1 encoding=US-ASCII): :c
30
+ Value: Fixnum 2
31
+ ```
@@ -0,0 +1,4 @@
1
+ require 'debug_helper'
2
+
3
+ hash = {:a => 0, :b => 1, :c => 2}
4
+ DebugHelper.show(hash, 'My simple hash')
@@ -0,0 +1,14 @@
1
+ ---
2
+ Hash (size=3 name='My simple hash'):
3
+ Pair 0:
4
+ Key:
5
+ Symbol (size=1 encoding=US-ASCII): :a
6
+ Value: Fixnum 0
7
+ Pair 1:
8
+ Key:
9
+ Symbol (size=1 encoding=US-ASCII): :b
10
+ Value: Fixnum 1
11
+ Pair 2:
12
+ Key:
13
+ Symbol (size=1 encoding=US-ASCII): :c
14
+ Value: Fixnum 2
@@ -0,0 +1,9 @@
1
+ #### Simple Hash
2
+
3
+ This example shows a simple hash.
4
+
5
+ @[ruby](show.rb)
6
+
7
+ The output shows details of the hash.
8
+
9
+ @[yaml](show.yaml)
@@ -0,0 +1,9 @@
1
+ ### Hash
2
+
3
+ @[:markdown](simple/show.md)
4
+
5
+ @[:markdown](mixed/show.md)
6
+
7
+ @[:markdown](nested/show.md)
8
+
9
+ @[:markdown](circular/show.md)
@@ -0,0 +1,19 @@
1
+ #### DateTime
2
+
3
+ This example shows a datetime.
4
+
5
+ ```show.rb```:
6
+ ```ruby
7
+ require 'debug_helper'
8
+
9
+ datetime = DateTime.now
10
+ DebugHelper.show(datetime, 'My datetime')
11
+ ```
12
+
13
+ The output shows details of the datetime.
14
+
15
+ ```show.yaml```:
16
+ ```yaml
17
+ --- DateTime (name='My datetime') 2018-06-29T17:20:16-05:00
18
+ ...
19
+ ```