|
8 | 8 |
|
9 | 9 | This library is similar in purpose to the HashWithIndifferentAccess that is famously used in Rails.
|
10 | 10 |
|
| 11 | +This gem is used by `oauth`, `oauth2`, and other, gems to normalize hash keys to `snake_case` and lookups, |
| 12 | +and provide a nice psuedo-object interface. |
| 13 | + |
| 14 | +It can be thought of as a mashup, with upgrades, to the `Rash` (specifically the [`rash_alt`](https://github.com/shishi/rash_alt) flavor), which is a special `Mash`, made popular by the `hashie` gem, and the `serialized_hashie` [gem by krystal](https://github.com/krystal/serialized-hashie). |
| 15 | + |
| 16 | +Classes that include `SnakyHash::Snake` should inherit from `Hashie::Mash`. |
| 17 | + |
| 18 | +## New for v2.0.2: Serialization Support |
| 19 | + |
| 20 | +The serialization support is set to `false` by default, for backwards compatibility, but may be switched to `true` in the next major release, which will be v3. Example: |
| 21 | + |
| 22 | +```ruby |
| 23 | +# This class has `dump` and `load` abilities! |
| 24 | +class MyStringKeyedHash < Hashie::Mash |
| 25 | + include SnakyHash::Snake.new( |
| 26 | + key_type: :string, |
| 27 | + serializer: true, |
| 28 | + ) |
| 29 | +end |
| 30 | +``` |
| 31 | + |
11 | 32 | | Federated [DVCS][💎d-in-dvcs] Repository | Status | Issues | PRs | Wiki | CI | Discussions |
|
12 | 33 | |-----------------------------------------------|-------------------------------------------------------------------|---------------------------|--------------------------|---------------------------|--------------------------|------------------------------|
|
13 | 34 | | 🧪 [oauth-xx/snaky_hash on GitLab][📜src-gl] | The Truth | [💚][🤝gl-issues] | [💚][🤝gl-pulls] | [💚][📜wiki] | 🏀 Tiny Matrix | ➖ |
|
@@ -69,20 +90,13 @@ and are developed in tight collaboration with the oauth and oauth2 gems.
|
69 | 90 | | Works with MRI Ruby 2 | [![Ruby 2.3 Compat][💎ruby-2.3i]][🚎1-an-wf] [![Ruby 2.4 Compat][💎ruby-2.4i]][🚎1-an-wf] [![Ruby 2.5 Compat][💎ruby-2.5i]][🚎1-an-wf] [![Ruby 2.6 Compat][💎ruby-2.6i]][🚎7-us-wf] [![Ruby 2.7 Compat][💎ruby-2.7i]][🚎7-us-wf] |
|
70 | 91 | | Source | [![Source on GitLab.com][📜src-gl-img]][📜src-gl] [![Source on CodeBerg.org][📜src-cb-img]][📜src-cb] [![Source on Github.com][📜src-gh-img]][📜src-gh] [![The best SHA: dQw4w9WgXcQ!][🧮kloc-img]][🧮kloc] |
|
71 | 92 | | Documentation | [![Discussion][⛳gg-discussions-img]][⛳gg-discussions] [![Current release on RubyDoc.info][📜docs-cr-rd-img]][🚎yard-current] [![HEAD on RubyDoc.info][📜docs-head-rd-img]][🚎yard-head] [![BDFL Blog][🚂bdfl-blog-img]][🚂bdfl-blog] [![Wiki][📜wiki-img]][📜wiki] |
|
72 |
| -| Compliance | [![License: MIT][📄license-img]][📄license-ref] [![📄ilo-declaration-img]][📄ilo-declaration] [![Security Policy][🔐security-img]][🔐security] [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct] [![SemVer 2.0.0][📌semver-img]][📌semver] [![FOSSA][🏘fossa-img]][🏘fossa] | |
| 93 | +| Compliance | [![License: MIT][📄license-img]][📄license-ref] [![📄ilo-declaration-img]][📄ilo-declaration] [![Security Policy][🔐security-img]][🔐security] [![Contributor Covenant 2.1][🪇conduct-img]][🪇conduct] [![SemVer 2.0.0][📌semver-img]][📌semver] | |
73 | 94 | | Style | [![Enforced Code Style Linter][💎rlts-img]][💎rlts] [![Keep-A-Changelog 1.0.0][📗keep-changelog-img]][📗keep-changelog] [![Gitmoji Commits][📌gitmoji-img]][📌gitmoji] |
|
74 |
| -| Support | [![Live Chat on Discord][✉️discord-invite-img]][✉️discord-invite] [![Get help from me on Upwork][👨🏼🏫expsup-upwork-img]][👨🏼🏫expsup-upwork] [![Get help from me on Codementor][👨🏼🏫expsup-codementor-img]][👨🏼🏫expsup-codementor] | |
| 95 | +| Support | [![Live Chat on Discord][✉️discord-invite-img]][✉️discord-invite] [![Get help from me on Upwork][👨🏼🏫expsup-upwork-img]][👨🏼🏫expsup-upwork] [![Get help from me on Codementor][👨🏼🏫expsup-codementor-img]][👨🏼🏫expsup-codementor] | |
75 | 96 | | Enterprise Support | [![Get help from me on Tidelift][🏙️entsup-tidelift-img]][🏙️entsup-tidelift]<br/>💡Subscribe for support guarantees covering _all_ FLOSS dependencies!<br/>💡Tidelift is part of [Sonar][🏙️entsup-tidelift-sonar]!<br/>💡Tidelift pays maintainers to maintain the software you depend on!<br/>📊`@`Pointy Haired Boss: An [enterprise support][🏙️entsup-tidelift] subscription is "[never gonna let you down][🧮kloc]", and *supports* open source maintainers! |
|
76 | 97 | | Comrade BDFL 🎖️ | [![Follow Me on LinkedIn][💖🖇linkedin-img]][💖🖇linkedin] [![Follow Me on Ruby.Social][💖🐘ruby-mast-img]][💖🐘ruby-mast] [![Follow Me on Bluesky][💖🦋bluesky-img]][💖🦋bluesky] [![Contact BDFL][🚂bdfl-contact-img]][🚂bdfl-contact] [![My technical writing][💖💁🏼♂️devto-img]][💖💁🏼♂️devto] |
|
77 | 98 | | `...` 💖 | [![Find Me on WellFound:][💖✌️wellfound-img]][💖✌️wellfound] [![Find Me on CrunchBase][💖💲crunchbase-img]][💖💲crunchbase] [![My LinkTree][💖🌳linktree-img]][💖🌳linktree] [![More About Me][💖💁🏼♂️aboutme-img]][💖💁🏼♂️aboutme] [🧊][💖🧊berg] [🐙][💖🐙hub] [🛖][💖🛖hut] [🧪][💖🧪lab] |
|
78 | 99 |
|
79 |
| -This gem is used by the `oauth` and `oauth2` gems, and others, to normalize hash keys and lookups, |
80 |
| -and provide a nice psuedo-object interface. |
81 |
| - |
82 |
| -It has its roots in the `Rash` (specifically the [`rash_alt`](https://github.com/shishi/rash_alt) flavor), which is a special `Mash`, made popular by the `hashie` gem. |
83 |
| - |
84 |
| -Classes that include `SnakyHash::Snake` should inherit from `Hashie::Mash`. |
85 |
| - |
86 | 100 | ## ✨ Installation
|
87 | 101 |
|
88 | 102 | Install the gem and add to the application's Gemfile by executing:
|
@@ -254,26 +268,18 @@ The gem is available as open source under the terms of
|
254 | 268 | the [MIT License][📄license] [![License: MIT][📄license-img]][📄license-ref].
|
255 | 269 | See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright-notice-explainer].
|
256 | 270 |
|
257 |
| -[![FOSSA Status][fossa2-img])][fossa2] |
258 |
| - |
259 |
| -[fossa2]: https://app.fossa.io/projects/git%2Bgithub.com%2Foauth-xx%2Fsnaky_hash?ref=badge_large |
260 |
| -[fossa2-img]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Foauth-xx%2Fsnaky_hash.svg?type=large |
261 |
| - |
262 | 271 | ### © Copyright
|
263 | 272 |
|
264 | 273 | <ul>
|
265 | 274 | <li>
|
266 |
| - 2017 - 2025 Peter H. Boling, of |
| 275 | + 2022, 2025 Peter H. Boling, of |
267 | 276 | <a href="https://railsbling.com">
|
268 | 277 | RailsBling.com
|
269 | 278 | <picture>
|
270 | 279 | <img alt="Rails Bling" height="20" src="https://railsbling.com/images/logos/RailsBling-TrainLogo.svg" />
|
271 | 280 | </picture>
|
272 | 281 | </a>, and snaky_hash contributors
|
273 | 282 | </li>
|
274 |
| - <li> |
275 |
| - Copyright (c) 2011 - 2013 Michael Bleigh and Intridea, Inc. |
276 |
| - </li> |
277 | 283 | </ul>
|
278 | 284 |
|
279 | 285 | ## 🤑 One more thing
|
@@ -345,15 +351,15 @@ or one of the others at the head of this README.
|
345 | 351 | [👽version]: https://rubygems.org/gems/snaky_hash
|
346 | 352 | [👽versioni]: https://img.shields.io/gem/v/snaky_hash.svg
|
347 | 353 | [🔑qlty-mnt]: https://qlty.sh/gh/oauth-xx/projects/snaky_hash
|
348 |
| -[🔑qlty-mnti♻️]: https://qlty.sh/badges/d3370c2c-8791-4202-9759-76f527f76005/maintainability.svg |
| 354 | +[🔑qlty-mnti♻️]: https://qlty.sh/badges/84e960b2-4ed2-4b47-9913-02c32680ec98/maintainability.svg |
349 | 355 | [🔑qlty-cov]: https://qlty.sh/gh/oauth-xx/projects/snaky_hash
|
350 |
| -[🔑qlty-covi♻️]: https://qlty.sh/badges/d3370c2c-8791-4202-9759-76f527f76005/test_coverage.svg |
| 356 | +[🔑qlty-covi♻️]: https://qlty.sh/badges/84e960b2-4ed2-4b47-9913-02c32680ec98/test_coverage.svg |
351 | 357 | [🔑codecov]: https://codecov.io/gh/oauth-xx/snaky_hash
|
352 |
| -[🔑codecovi♻️]: https://codecov.io/gh/oauth-xx/snaky_hash/graph/badge.svg?token=bNqSzNiuo2 |
| 358 | +[🔑codecovi♻️]: https://codecov.io/gh/oauth-xx/snaky_hash/graph/badge.svg?token=XqaZixl4ss |
353 | 359 | [🔑coveralls]: https://coveralls.io/github/oauth-xx/snaky_hash?branch=main
|
354 | 360 | [🔑coveralls-img]: https://coveralls.io/repos/github/oauth-xx/snaky_hash/badge.svg?branch=main
|
355 |
| -[🔑depfu]: https://depfu.com/github/oauth-xx/snaky_hash?project_id=5884 |
356 |
| -[🔑depfui♻️]: https://badges.depfu.com/badges/6d34dc1ba682bbdf9ae2a97848241743/count.svg |
| 361 | +[🔑depfu]: https://depfu.com/github/oauth-xx/snaky_hash?project_id=63073 |
| 362 | +[🔑depfui♻️]: https://badges.depfu.com/badges/7019dcf43672ba8c0e77e7fdd1063398/count.svg |
357 | 363 | [🖐codeQL]: https://github.com/oauth-xx/snaky_hash/security/code-scanning
|
358 | 364 | [🖐codeQL-img]: https://github.com/oauth-xx/snaky_hash/actions/workflows/codeql-analysis.yml/badge.svg
|
359 | 365 | [🚎1-an-wf]: https://github.com/oauth-xx/snaky_hash/actions/workflows/ancient.yml
|
@@ -423,7 +429,7 @@ or one of the others at the head of this README.
|
423 | 429 | [🤝cb-pulls]: https://codeberg.org/oauth-xx/snaky_hash/pulls
|
424 | 430 | [🤝cb-donate]: https://donate.codeberg.org/
|
425 | 431 | [🤝contributing]: CONTRIBUTING.md
|
426 |
| -[🔑codecov-g♻️]: https://codecov.io/gh/oauth-xx/snaky_hash/graphs/tree.svg?token=bNqSzNiuo2 |
| 432 | +[🔑codecov-g♻️]: https://codecov.io/gh/oauth-xx/snaky_hash/graphs/tree.svg?token=XqaZixl4ss |
427 | 433 | [🖐contrib-rocks]: https://contrib.rocks
|
428 | 434 | [🖐contributors]: https://github.com/oauth-xx/snaky_hash/graphs/contributors
|
429 | 435 | [🖐contributors-img]: https://contrib.rocks/image?repo=oauth-xx/snaky_hash
|
@@ -456,8 +462,17 @@ or one of the others at the head of this README.
|
456 | 462 | [💎SHA_checksums]: https://gitlab.com/oauth-xx/snaky_hash/-/tree/main/checksums
|
457 | 463 | [💎rlts]: https://github.com/rubocop-lts/rubocop-lts
|
458 | 464 | [💎rlts-img]: https://img.shields.io/badge/code_style_%26_linting-rubocop--lts-34495e.svg?plastic&logo=ruby&logoColor=white
|
459 |
| -[🏘fossa]: https://app.fossa.io/projects/git%2Bgithub.com%2Foauth-xx%2Fsnaky_hash?ref=badge_shield |
460 |
| -[🏘fossa-img]: https://app.fossa.io/api/projects/git%2Bgithub.com%2Foauth-xx%2Fsnaky_hash.svg?type=shield |
461 | 465 | [💎d-in-dvcs]: https://railsbling.com/posts/dvcs/put_the_d_in_dvcs/
|
462 | 466 | [✉️discord-invite]: https://discord.gg/3qme4XHNKN
|
463 | 467 | [✉️discord-invite-img]: https://img.shields.io/discord/1373797679469170758?style=for-the-badge
|
| 468 | + |
| 469 | +<details> |
| 470 | + <summary>Deprecated Badges</summary> |
| 471 | + |
| 472 | +CodeCov currently fails to parse the coverage upload. |
| 473 | + |
| 474 | +[![CodeCov Test Coverage][🔑codecovi♻️]][🔑codecov] |
| 475 | + |
| 476 | +[![Coverage Graph][🔑codecov-g♻️]][🔑codecov] |
| 477 | + |
| 478 | +</details> |
0 commit comments