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,9 @@
1
+ #### Nested Structs
2
+
3
+ This example shows nested structs.
4
+
5
+ @[ruby](show.rb)
6
+
7
+ The output shows details of the structs.
8
+
9
+ @[yaml](show.yaml)
@@ -0,0 +1,29 @@
1
+ #### Simple Struct
2
+
3
+ This example shows a simple struct.
4
+
5
+ ```show.rb```:
6
+ ```ruby
7
+ require 'debug_helper'
8
+
9
+ MyStruct = Struct.new(:a, :b, :c)
10
+ struct = MyStruct.new(0, 1, 2)
11
+ DebugHelper.show(struct, 'My simple struct')
12
+ ```
13
+
14
+ The output shows details of the struct.
15
+
16
+ ```show.yaml```:
17
+ ```yaml
18
+ ---
19
+ MyStruct (name='My simple struct' size=3):
20
+ Member 0:
21
+ Name: :a
22
+ Value: Fixnum 0
23
+ Member 1:
24
+ Name: :b
25
+ Value: Fixnum 1
26
+ Member 2:
27
+ Name: :c
28
+ Value: Fixnum 2
29
+ ```
@@ -0,0 +1,5 @@
1
+ require 'debug_helper'
2
+
3
+ MyStruct = Struct.new(:a, :b, :c)
4
+ struct = MyStruct.new(0, 1, 2)
5
+ DebugHelper.show(struct, 'My simple struct')
@@ -0,0 +1,11 @@
1
+ ---
2
+ MyStruct (name='My simple struct' size=3):
3
+ Member 0:
4
+ Name: :a
5
+ Value: Fixnum 0
6
+ Member 1:
7
+ Name: :b
8
+ Value: Fixnum 1
9
+ Member 2:
10
+ Name: :c
11
+ Value: Fixnum 2
@@ -0,0 +1,9 @@
1
+ #### Simple Struct
2
+
3
+ This example shows a simple struct.
4
+
5
+ @[ruby](show.rb)
6
+
7
+ The output shows details of the struct.
8
+
9
+ @[yaml](show.yaml)
@@ -0,0 +1,9 @@
1
+ ### Struct
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,18 @@
1
+ #### Simple Symbol
2
+
3
+ This example shows a simple symbol.
4
+
5
+ ```show.rb```:
6
+ ```ruby
7
+ require 'debug_helper'
8
+
9
+ DebugHelper.show(:lorem_ipsum, 'My symbol')
10
+ ```
11
+
12
+ The output shows details of the symbol.
13
+
14
+ ```show.yaml```:
15
+ ```yaml
16
+ ---
17
+ Symbol (name='My symbol' size=11 encoding=US-ASCII): :lorem_ipsum
18
+ ```
@@ -0,0 +1,3 @@
1
+ require 'debug_helper'
2
+
3
+ DebugHelper.show(:lorem_ipsum, 'My symbol')
@@ -0,0 +1,2 @@
1
+ ---
2
+ Symbol (name='My symbol' size=11 encoding=US-ASCII): :lorem_ipsum
@@ -0,0 +1,9 @@
1
+ #### Simple Symbol
2
+
3
+ This example shows a simple symbol.
4
+
5
+ @[ruby](show.rb)
6
+
7
+ The output shows details of the symbol.
8
+
9
+ @[yaml](show.yaml)
@@ -0,0 +1,3 @@
1
+ ### Symbol
2
+
3
+ @[:markdown](simple/show.md)
@@ -0,0 +1,12 @@
1
+ ## Classes
2
+
3
+ @[:markdown](array/template.md)
4
+
5
+ @[:markdown](hash/template.md)
6
+
7
+ @[:markdown](struct/template.md)
8
+
9
+ @[:markdown](string/template.md)
10
+
11
+ @[:markdown](symbol/template.md)
12
+
@@ -0,0 +1,3 @@
1
+ array.each_with_index do |item, i|
2
+ p [i, item]
3
+ end
@@ -0,0 +1,3 @@
1
+ hash.each_pair do |key, value|
2
+ p [key, value]
3
+ end
@@ -0,0 +1,25 @@
1
+ # Debug Helper
2
+
3
+ If (like me), your debugging style is [printf debugging](https://en.wikipedia.org/wiki/Debugging#Techniques), you will have shoved this into your code many times:
4
+
5
+ @[ruby](show_hash.rb)
6
+
7
+ And this:
8
+
9
+ @[ruby](show_array.rb)
10
+
11
+ This helper assists in debugging by printing an analysis of a given object. The analysis is a ```yaml``` structure, and is written to ```stdout```.
12
+
13
+ For certain classes (see below), the analysis is very detailed.
14
+
15
+ For the collection classes ```Array```, ```Hash```, and ```Struct```, the analysis is also recursive; that is, the collection's values are themselves analyzed.
16
+
17
+ Classes treated in detail:
18
+
19
+ @[:markdown](class_links.md)
20
+
21
+ Others are treated as:
22
+
23
+ - [Object](#object)
24
+
25
+ @[:markdown](class_inclusions.md)
metadata ADDED
@@ -0,0 +1,186 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: debug_helper
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - burdettelamar
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-06-30 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.16'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.16'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: minitest
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '5.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '5.0'
55
+ description:
56
+ email:
57
+ - burdettelamar@yahoo.com
58
+ executables:
59
+ - console
60
+ - setup
61
+ extensions: []
62
+ extra_rdoc_files: []
63
+ files:
64
+ - ".gitignore"
65
+ - ".travis.yml"
66
+ - CODE_OF_CONDUCT.md
67
+ - Gemfile
68
+ - Gemfile.lock
69
+ - LICENSE.txt
70
+ - README.md
71
+ - Rakefile
72
+ - bin/console
73
+ - bin/setup
74
+ - debug_helper.gemspec
75
+ - lib/debug_helper.rb
76
+ - lib/debug_helper/version.rb
77
+ - markdown/readme/Rakefile
78
+ - markdown/readme/class_inclusions.md
79
+ - markdown/readme/class_links.md
80
+ - markdown/readme/classes/array/circular/show.md
81
+ - markdown/readme/classes/array/circular/show.rb
82
+ - markdown/readme/classes/array/circular/show.yaml
83
+ - markdown/readme/classes/array/circular/template.md
84
+ - markdown/readme/classes/array/mixed/show.md
85
+ - markdown/readme/classes/array/mixed/show.rb
86
+ - markdown/readme/classes/array/mixed/show.yaml
87
+ - markdown/readme/classes/array/mixed/template.md
88
+ - markdown/readme/classes/array/nested/show.md
89
+ - markdown/readme/classes/array/nested/show.rb
90
+ - markdown/readme/classes/array/nested/show.yaml
91
+ - markdown/readme/classes/array/nested/template.md
92
+ - markdown/readme/classes/array/simple/show.md
93
+ - markdown/readme/classes/array/simple/show.rb
94
+ - markdown/readme/classes/array/simple/show.yaml
95
+ - markdown/readme/classes/array/simple/template.md
96
+ - markdown/readme/classes/array/template.md
97
+ - markdown/readme/classes/hash/circular/show.md
98
+ - markdown/readme/classes/hash/circular/show.rb
99
+ - markdown/readme/classes/hash/circular/show.yaml
100
+ - markdown/readme/classes/hash/circular/template.md
101
+ - markdown/readme/classes/hash/mixed/show.md
102
+ - markdown/readme/classes/hash/mixed/show.rb
103
+ - markdown/readme/classes/hash/mixed/show.yaml
104
+ - markdown/readme/classes/hash/mixed/template.md
105
+ - markdown/readme/classes/hash/nested/show.md
106
+ - markdown/readme/classes/hash/nested/show.rb
107
+ - markdown/readme/classes/hash/nested/show.yaml
108
+ - markdown/readme/classes/hash/nested/template.md
109
+ - markdown/readme/classes/hash/simple/show.md
110
+ - markdown/readme/classes/hash/simple/show.rb
111
+ - markdown/readme/classes/hash/simple/show.yaml
112
+ - markdown/readme/classes/hash/simple/template.md
113
+ - markdown/readme/classes/hash/template.md
114
+ - markdown/readme/classes/object/datetime/show.md
115
+ - markdown/readme/classes/object/datetime/show.rb
116
+ - markdown/readme/classes/object/datetime/show.yaml
117
+ - markdown/readme/classes/object/datetime/template.md
118
+ - markdown/readme/classes/object/range/show.md
119
+ - markdown/readme/classes/object/range/show.rb
120
+ - markdown/readme/classes/object/range/show.yaml
121
+ - markdown/readme/classes/object/range/template.md
122
+ - markdown/readme/classes/object/regexp/show.md
123
+ - markdown/readme/classes/object/regexp/show.rb
124
+ - markdown/readme/classes/object/regexp/show.yaml
125
+ - markdown/readme/classes/object/regexp/template.md
126
+ - markdown/readme/classes/object/template.md
127
+ - markdown/readme/classes/string/multiline/show.md
128
+ - markdown/readme/classes/string/multiline/show.rb
129
+ - markdown/readme/classes/string/multiline/show.yaml
130
+ - markdown/readme/classes/string/multiline/template.md
131
+ - markdown/readme/classes/string/simple/show.md
132
+ - markdown/readme/classes/string/simple/show.rb
133
+ - markdown/readme/classes/string/simple/show.yaml
134
+ - markdown/readme/classes/string/simple/template.md
135
+ - markdown/readme/classes/string/template.md
136
+ - markdown/readme/classes/struct/circular/show.md
137
+ - markdown/readme/classes/struct/circular/show.rb
138
+ - markdown/readme/classes/struct/circular/show.yaml
139
+ - markdown/readme/classes/struct/circular/template.md
140
+ - markdown/readme/classes/struct/mixed/show.md
141
+ - markdown/readme/classes/struct/mixed/show.rb
142
+ - markdown/readme/classes/struct/mixed/show.yaml
143
+ - markdown/readme/classes/struct/mixed/template.md
144
+ - markdown/readme/classes/struct/nested/show.md
145
+ - markdown/readme/classes/struct/nested/show.rb
146
+ - markdown/readme/classes/struct/nested/show.yaml
147
+ - markdown/readme/classes/struct/nested/template.md
148
+ - markdown/readme/classes/struct/simple/show.md
149
+ - markdown/readme/classes/struct/simple/show.rb
150
+ - markdown/readme/classes/struct/simple/show.yaml
151
+ - markdown/readme/classes/struct/simple/template.md
152
+ - markdown/readme/classes/struct/template.md
153
+ - markdown/readme/classes/symbol/simple/show.md
154
+ - markdown/readme/classes/symbol/simple/show.rb
155
+ - markdown/readme/classes/symbol/simple/show.yaml
156
+ - markdown/readme/classes/symbol/simple/template.md
157
+ - markdown/readme/classes/symbol/template.md
158
+ - markdown/readme/classes/template.md
159
+ - markdown/readme/show_array.rb
160
+ - markdown/readme/show_hash.rb
161
+ - markdown/readme/template.md
162
+ homepage: https://github.com/BurdetteLamar/debug_helper
163
+ licenses:
164
+ - MIT
165
+ metadata: {}
166
+ post_install_message:
167
+ rdoc_options: []
168
+ require_paths:
169
+ - lib
170
+ required_ruby_version: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - ">="
173
+ - !ruby/object:Gem::Version
174
+ version: '0'
175
+ required_rubygems_version: !ruby/object:Gem::Requirement
176
+ requirements:
177
+ - - ">="
178
+ - !ruby/object:Gem::Version
179
+ version: '0'
180
+ requirements: []
181
+ rubyforge_project:
182
+ rubygems_version: 2.4.5.2
183
+ signing_key:
184
+ specification_version: 4
185
+ summary: Help for printf-style debugging.
186
+ test_files: []