Skip to content

Commit e4f868a

Browse files
committed
📝 Documentation
1 parent c6fa667 commit e4f868a

30 files changed

+1160
-280
lines changed

CHANGELOG.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.
1111
### Removed
1212

1313
## [2.0.2] - 2025-05-21 ([tag][2.0.2t])
14+
- COVERAGE: 100.00% -- 119/119 lines in 7 files
15+
- BRANCH COVERAGE: 100.00% -- 35/35 branches in 7 files
16+
- 100.00% documented
1417
### Added
1518
- Gem is signed by 20-year cert (@pboling)
1619
- Expires 2045-04-29
@@ -20,7 +23,8 @@ and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.
2023
- Including Hashie v0, v1, v2, v3, v4, v5, and HEAD
2124
- [gh2](https://github.com/oauth-xx/snaky_hash/pull/2) - Serializer option (@pboling)
2225
- [gh3](https://github.com/oauth-xx/snaky_hash/pull/3) - Serializer Extensions (@pboling)
23-
- Documentation site at [snaky-hash.galtzo.com](https://snaky-hash.galtzo.com)
26+
- Documentation site at [snaky-hash.galtzo.com](https://snaky-hash.galtzo.com) (@pboling)
27+
- 100% documented! (@pboling)
2428

2529
## [2.0.1] - 2022-09-23 ([tag][2.0.1t])
2630
### Added

README.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ end
3434

3535
✨ Also new dump & load plugin extensions to control the way your data is dumped and loaded.
3636

37+
### Note for use with oauth2 gem
38+
39+
The serializer is being introduced as a disabled option for backwards compatibility.
40+
In snaky_hash v3 it will default to `true`.
41+
If you want to start using the serializer immediately, reopen the `SnakyHash::StringKeyed` class and add the `SnakyHash::Serializer` module like this:
42+
43+
```ruby
44+
SnakyHash::StringKeyed.class_eval do
45+
extend SnakyHash::Serializer
46+
end
47+
```
48+
49+
You can then add serialization extensions as needed. See [serialization](#serialization) and [extensions](#extensions) for more.
50+
3751
| Federated [DVCS][💎d-in-dvcs] Repository | Status | Issues | PRs | Wiki | CI | Discussions |
3852
|-----------------------------------------------|-------------------------------------------------------------------|---------------------------|--------------------------|---------------------------|--------------------------|------------------------------|
3953
| 🧪 [oauth-xx/snaky_hash on GitLab][📜src-gl] | The Truth | [💚][🤝gl-issues] | [💚][🤝gl-pulls] | [💚][📜wiki] | 🏀 Tiny Matrix ||
@@ -539,7 +553,7 @@ or one of the others at the head of this README.
539553
[📌gitmoji]:https://gitmoji.dev
540554
[📌gitmoji-img]:https://img.shields.io/badge/gitmoji_commits-%20😜%20😍-34495e.svg?style=flat-square
541555
[🧮kloc]: https://www.youtube.com/watch?v=dQw4w9WgXcQ
542-
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.518-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
556+
[🧮kloc-img]: https://img.shields.io/badge/KLOC-0.119-FFDD67.svg?style=for-the-badge&logo=YouTube&logoColor=blue
543557
[🔐security]: SECURITY.md
544558
[🔐security-img]: https://img.shields.io/badge/security-policy-259D6C.svg?style=flat
545559
[📄copyright-notice-explainer]: https://opensource.stackexchange.com/questions/5778/why-do-licenses-such-as-the-mit-license-specify-a-single-year

REEK

Lines changed: 24 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,28 @@
11
spec/snaky_hash/snake_spec.rb -- 1 warning:
22
[4]:IrresponsibleModule: TheSnakedHash has no descriptive comment [https://github.com/troessner/reek/blob/v6.5.0/docs/Irresponsible-Module.md]
3-
lib/snaky_hash/extensions.rb -- 2 warnings:
4-
[4]:InstanceVariableAssumption: SnakyHash::Extensions assumes too much for instance variable '@extensions' [https://github.com/troessner/reek/blob/v6.5.0/docs/Instance-Variable-Assumption.md]
5-
[4]:IrresponsibleModule: SnakyHash::Extensions has no descriptive comment [https://github.com/troessner/reek/blob/v6.5.0/docs/Irresponsible-Module.md]
6-
lib/snaky_hash/serializer.rb -- 11 warnings:
7-
[7]:IrresponsibleModule: SnakyHash::Serializer has no descriptive comment [https://github.com/troessner/reek/blob/v6.5.0/docs/Irresponsible-Module.md]
8-
[52]:IrresponsibleModule: SnakyHash::Serializer::BackportedInstanceMethods has no descriptive comment [https://github.com/troessner/reek/blob/v6.5.0/docs/Irresponsible-Module.md]
9-
[32]:IrresponsibleModule: SnakyHash::Serializer::Modulizer has no descriptive comment [https://github.com/troessner/reek/blob/v6.5.0/docs/Irresponsible-Module.md]
10-
[72]:NilCheck: SnakyHash::Serializer#blank? performs a nil-check [https://github.com/troessner/reek/blob/v6.5.0/docs/Nil-Check.md]
11-
[115]:TooManyStatements: SnakyHash::Serializer#load_value has approx 6 statements [https://github.com/troessner/reek/blob/v6.5.0/docs/Too-Many-Statements.md]
12-
[57]:TooManyStatements: SnakyHash::Serializer::BackportedInstanceMethods#transform_values has approx 7 statements [https://github.com/troessner/reek/blob/v6.5.0/docs/Too-Many-Statements.md]
13-
[34]:TooManyStatements: SnakyHash::Serializer::Modulizer#to_extended_mod has approx 7 statements [https://github.com/troessner/reek/blob/v6.5.0/docs/Too-Many-Statements.md]
14-
[88]:UncommunicativeVariableName: SnakyHash::Serializer#dump_hash has the variable name 'v' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
15-
[101]:UncommunicativeVariableName: SnakyHash::Serializer#dump_value has the variable name 'v' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
16-
[128]:UncommunicativeVariableName: SnakyHash::Serializer#load_value has the variable name 'v' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
17-
[71]:UtilityFunction: SnakyHash::Serializer#blank? doesn't depend on instance state (maybe move it to another class?) [https://github.com/troessner/reek/blob/v6.5.0/docs/Utility-Function.md]
18-
lib/snaky_hash/snake.rb -- 13 warnings:
19-
[8]:BooleanParameter: SnakyHash::Snake#initialize has boolean parameter 'serializer' [https://github.com/troessner/reek/blob/v6.5.0/docs/Boolean-Parameter.md]
20-
[36, 38]:DuplicateMethodCall: SnakyHash::Snake::SnakyModulizer#to_mod calls 'define_method(:convert_key)' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
21-
[36, 38]:DuplicateMethodCall: SnakyHash::Snake::SnakyModulizer#to_mod calls 'key.respond_to?(:to_sym)' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
22-
[36, 38]:DuplicateMethodCall: SnakyHash::Snake::SnakyModulizer#to_mod calls 'key.to_s' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
23-
[48, 52]:DuplicateMethodCall: SnakyHash::Snake::SnakyModulizer#to_mod calls 'self.class' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
24-
[36, 38]:DuplicateMethodCall: SnakyHash::Snake::SnakyModulizer#to_mod calls 'underscore_string(key.to_s)' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
25-
[49, 51]:DuplicateMethodCall: SnakyHash::Snake::SnakyModulizer#to_mod calls 'val.dup' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
26-
[7]:IrresponsibleModule: SnakyHash::Snake has no descriptive comment [https://github.com/troessner/reek/blob/v6.5.0/docs/Irresponsible-Module.md]
27-
[22]:IrresponsibleModule: SnakyHash::Snake::SnakyModulizer has no descriptive comment [https://github.com/troessner/reek/blob/v6.5.0/docs/Irresponsible-Module.md]
28-
[36, 38]:ManualDispatch: SnakyHash::Snake::SnakyModulizer#to_mod manually dispatches method call [https://github.com/troessner/reek/blob/v6.5.0/docs/Manual-Dispatch.md]
29-
[54]:NestedIterators: SnakyHash::Snake::SnakyModulizer#to_mod contains iterators nested 2 deep [https://github.com/troessner/reek/blob/v6.5.0/docs/Nested-Iterators.md]
30-
[24]:TooManyStatements: SnakyHash::Snake::SnakyModulizer#to_mod has approx 17 statements [https://github.com/troessner/reek/blob/v6.5.0/docs/Too-Many-Statements.md]
31-
[54]:UncommunicativeVariableName: SnakyHash::Snake::SnakyModulizer#to_mod has the variable name 'e' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
32-
lib/snaky_hash.rb -- 1 warning:
33-
[16]:IrresponsibleModule: SnakyHash::Error has no descriptive comment [https://github.com/troessner/reek/blob/v6.5.0/docs/Irresponsible-Module.md]
3+
lib/snaky_hash/extensions.rb -- 1 warning:
4+
[11]:InstanceVariableAssumption: SnakyHash::Extensions assumes too much for instance variable '@extensions' [https://github.com/troessner/reek/blob/v6.5.0/docs/Instance-Variable-Assumption.md]
5+
lib/snaky_hash/serializer.rb -- 8 warnings:
6+
[106]:NilCheck: SnakyHash::Serializer#blank? performs a nil-check [https://github.com/troessner/reek/blob/v6.5.0/docs/Nil-Check.md]
7+
[165]:TooManyStatements: SnakyHash::Serializer#load_value has approx 6 statements [https://github.com/troessner/reek/blob/v6.5.0/docs/Too-Many-Statements.md]
8+
[87]:TooManyStatements: SnakyHash::Serializer::BackportedInstanceMethods#transform_values has approx 7 statements [https://github.com/troessner/reek/blob/v6.5.0/docs/Too-Many-Statements.md]
9+
[58]:TooManyStatements: SnakyHash::Serializer::Modulizer#to_extended_mod has approx 7 statements [https://github.com/troessner/reek/blob/v6.5.0/docs/Too-Many-Statements.md]
10+
[128]:UncommunicativeVariableName: SnakyHash::Serializer#dump_hash has the variable name 'v' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
11+
[145]:UncommunicativeVariableName: SnakyHash::Serializer#dump_value has the variable name 'v' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
12+
[172]:UncommunicativeVariableName: SnakyHash::Serializer#load_value has the variable name 'v' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
13+
[105]:UtilityFunction: SnakyHash::Serializer#blank? doesn't depend on instance state (maybe move it to another class?) [https://github.com/troessner/reek/blob/v6.5.0/docs/Utility-Function.md]
14+
lib/snaky_hash/snake.rb -- 11 warnings:
15+
[30]:BooleanParameter: SnakyHash::Snake#initialize has boolean parameter 'serializer' [https://github.com/troessner/reek/blob/v6.5.0/docs/Boolean-Parameter.md]
16+
[64, 70]:DuplicateMethodCall: SnakyHash::Snake::SnakyModulizer#to_mod calls 'define_method(:convert_key)' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
17+
[64, 70]:DuplicateMethodCall: SnakyHash::Snake::SnakyModulizer#to_mod calls 'key.respond_to?(:to_sym)' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
18+
[64, 70]:DuplicateMethodCall: SnakyHash::Snake::SnakyModulizer#to_mod calls 'key.to_s' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
19+
[82, 86]:DuplicateMethodCall: SnakyHash::Snake::SnakyModulizer#to_mod calls 'self.class' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
20+
[64, 70]:DuplicateMethodCall: SnakyHash::Snake::SnakyModulizer#to_mod calls 'underscore_string(key.to_s)' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
21+
[83, 85]:DuplicateMethodCall: SnakyHash::Snake::SnakyModulizer#to_mod calls 'val.dup' 2 times [https://github.com/troessner/reek/blob/v6.5.0/docs/Duplicate-Method-Call.md]
22+
[64, 70]:ManualDispatch: SnakyHash::Snake::SnakyModulizer#to_mod manually dispatches method call [https://github.com/troessner/reek/blob/v6.5.0/docs/Manual-Dispatch.md]
23+
[88]:NestedIterators: SnakyHash::Snake::SnakyModulizer#to_mod contains iterators nested 2 deep [https://github.com/troessner/reek/blob/v6.5.0/docs/Nested-Iterators.md]
24+
[56]:TooManyStatements: SnakyHash::Snake::SnakyModulizer#to_mod has approx 17 statements [https://github.com/troessner/reek/blob/v6.5.0/docs/Too-Many-Statements.md]
25+
[88]:UncommunicativeVariableName: SnakyHash::Snake::SnakyModulizer#to_mod has the variable name 'e' [https://github.com/troessner/reek/blob/v6.5.0/docs/Uncommunicative-Variable-Name.md]
3426
.yard_gfm_support.rb -- 1 warning:
3527
[9, 9]:FeatureEnvy: KramdownGfmDocument#initialize refers to 'options' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v6.5.0/docs/Feature-Envy.md]
36-
29 total warnings
28+
22 total warnings

doc/SnakyHash.html

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,39 @@ <h2>Overview</h2><div class="docstring">
8989
<div class="discussion">
9090
<p>This is a module-class hybrid.</p>
9191

92+
<p>A flexible key conversion system that supports both String and Symbol keys,<br />
93+
with optional serialization capabilities.</p>
94+
9295
<p>Hashie’s standard SymbolizeKeys is similar to the functionality we want.<br />
9396
… but not quite. We need to support both String (for oauth2) and Symbol keys (for oauth).<br />
94-
include Hashie::Extensions::Mash::SymbolizeKeys</p>
97+
see: Hashie::Extensions::Mash::SymbolizeKeys</p>
9598

9699

97100
</div>
98101
</div>
99102
<div class="tags">
100103

104+
<div class="examples">
105+
<h4 class="tag_title">Examples:</h4>
106+
107+
108+
<h5 class="example_title"><div class='inline'><p>Basic usage with string keys</p>
109+
</div></h5>
110+
111+
<pre class="example code"><code><span class='kw'>class</span> <span class='const'>MyHash</span> <span class='op'>&lt;</span> <span class='const'>Hashie</span><span class='op'>::</span><span class='const'>Mash</span>
112+
<span class='id identifier rubyid_include'>include</span> <span class='const'>SnakyHash</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="SnakyHash/Snake.html" title="SnakyHash::Snake (class)">Snake</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="SnakyHash/Snake.html#initialize-instance_method" title="SnakyHash::Snake#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>key_type:</span> <span class='symbol'>:string</span><span class='rparen'>)</span>
113+
<span class='kw'>end</span></code></pre>
114+
115+
116+
<h5 class="example_title"><div class='inline'><p>Usage with symbol keys and serialization</p>
117+
</div></h5>
118+
119+
<pre class="example code"><code><span class='kw'>class</span> <span class='const'>MySerializableHash</span> <span class='op'>&lt;</span> <span class='const'>Hashie</span><span class='op'>::</span><span class='const'>Mash</span>
120+
<span class='id identifier rubyid_include'>include</span> <span class='const'>SnakyHash</span><span class='op'>::</span><span class='const'><span class='object_link'><a href="SnakyHash/Snake.html" title="SnakyHash::Snake (class)">Snake</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="SnakyHash/Snake.html#initialize-instance_method" title="SnakyHash::Snake#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>key_type:</span> <span class='symbol'>:symbol</span><span class='comma'>,</span> <span class='label'>serializer:</span> <span class='kw'>true</span><span class='rparen'>)</span>
121+
<span class='kw'>end</span></code></pre>
122+
123+
</div>
124+
101125

102126
</div><h2>Defined Under Namespace</h2>
103127
<p class="children">
@@ -123,7 +147,7 @@ <h2>Overview</h2><div class="docstring">
123147
</div>
124148

125149
<div id="footer">
126-
Generated on Thu May 22 03:44:50 2025 by
150+
Generated on Thu May 22 04:27:14 2025 by
127151
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
128152
0.9.37 (ruby-3.4.3).
129153
</div>

doc/SnakyHash/Error.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,18 @@
101101

102102
</div>
103103

104+
<h2>Overview</h2><div class="docstring">
105+
<div class="discussion">
106+
<p>Base error class for all SnakyHash errors</p>
104107

105108

109+
</div>
110+
</div>
111+
<div class="tags">
112+
113+
114+
</div>
115+
106116

107117

108118

@@ -114,7 +124,7 @@
114124
</div>
115125

116126
<div id="footer">
117-
Generated on Thu May 22 03:44:50 2025 by
127+
Generated on Thu May 22 04:27:14 2025 by
118128
<a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
119129
0.9.37 (ruby-3.4.3).
120130
</div>

0 commit comments

Comments
 (0)