hashie 4.1.0 → 5.2.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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +138 -53
  3. data/CONTRIBUTING.md +38 -1
  4. data/LICENSE +1 -1
  5. data/README.md +920 -205
  6. data/Rakefile +32 -1
  7. data/UPGRADING.md +56 -0
  8. data/hashie.gemspec +10 -5
  9. data/lib/hashie/array.rb +15 -12
  10. data/lib/hashie/clash.rb +59 -4
  11. data/lib/hashie/dash.rb +160 -32
  12. data/lib/hashie/extensions/active_support/core_ext/hash.rb +38 -0
  13. data/lib/hashie/extensions/array/pretty_inspect.rb +20 -0
  14. data/lib/hashie/extensions/block_access.rb +71 -0
  15. data/lib/hashie/extensions/coercion.rb +180 -26
  16. data/lib/hashie/extensions/dash/coercion.rb +34 -3
  17. data/lib/hashie/extensions/dash/indifferent_access.rb +90 -3
  18. data/lib/hashie/extensions/dash/lazy.rb +170 -0
  19. data/lib/hashie/extensions/dash/predefined_values.rb +148 -0
  20. data/lib/hashie/extensions/dash/property_translation.rb +138 -15
  21. data/lib/hashie/extensions/deep_fetch.rb +21 -9
  22. data/lib/hashie/extensions/deep_find.rb +20 -0
  23. data/lib/hashie/extensions/deep_grep.rb +69 -0
  24. data/lib/hashie/extensions/deep_locate.rb +16 -29
  25. data/lib/hashie/extensions/deep_merge.rb +16 -0
  26. data/lib/hashie/extensions/deep_merge_initializer.rb +42 -0
  27. data/lib/hashie/extensions/ignore_undeclared.rb +24 -7
  28. data/lib/hashie/extensions/indifferent_access.rb +124 -5
  29. data/lib/hashie/extensions/kernel_coercion.rb +58 -0
  30. data/lib/hashie/extensions/key_conflict_warning.rb +39 -4
  31. data/lib/hashie/extensions/key_conversion.rb +9 -0
  32. data/lib/hashie/extensions/mash/define_accessors.rb +71 -8
  33. data/lib/hashie/extensions/mash/keep_original_keys.rb +13 -9
  34. data/lib/hashie/extensions/mash/permissive_respond_to.rb +2 -0
  35. data/lib/hashie/extensions/mash/required_keys.rb +111 -0
  36. data/lib/hashie/extensions/mash/safe_assignment.rb +22 -4
  37. data/lib/hashie/extensions/mash/strict_key_access.rb +65 -0
  38. data/lib/hashie/extensions/mash/symbolize_keys.rb +11 -7
  39. data/lib/hashie/extensions/mash/transform_keys.rb +86 -0
  40. data/lib/hashie/extensions/mash/underscore_keys.rb +32 -0
  41. data/lib/hashie/extensions/merge_initializer.rb +9 -0
  42. data/lib/hashie/extensions/method_access.rb +94 -8
  43. data/lib/hashie/extensions/parsers/yaml_erb_parser.rb +28 -35
  44. data/lib/hashie/extensions/parsers/yaml_parser.rb +81 -0
  45. data/lib/hashie/extensions/persistable.rb +137 -0
  46. data/lib/hashie/extensions/pretty_inspect.rb +14 -0
  47. data/lib/hashie/extensions/ruby_version.rb +18 -1
  48. data/lib/hashie/extensions/ruby_version_check.rb +17 -0
  49. data/lib/hashie/extensions/strict_key_access.rb +59 -5
  50. data/lib/hashie/extensions/stringify_keys.rb +72 -17
  51. data/lib/hashie/extensions/symbolize_keys.rb +84 -17
  52. data/lib/hashie/hash.rb +18 -2
  53. data/lib/hashie/logger.rb +18 -1
  54. data/lib/hashie/mash.rb +314 -82
  55. data/lib/hashie/railtie.rb +27 -1
  56. data/lib/hashie/rash.rb +64 -4
  57. data/lib/hashie/trash.rb +8 -0
  58. data/lib/hashie/utils.rb +17 -6
  59. data/lib/hashie/version.rb +3 -1
  60. data/lib/hashie.rb +46 -0
  61. metadata +22 -9
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97b60a3200a49e6f1e56b3d29978c381b8087bb5eeda134ae6ab2a3924f49001
4
- data.tar.gz: 35a74ae35652f8c0f8673995edaae1b4e15850bdcd0141545bd5cee4ada19f40
3
+ metadata.gz: 1623620401412d6612e1b7a1d2963cd9b31d584c3278987fafe45eac8cdd025b
4
+ data.tar.gz: f3bb1e89d55110e20bed0b5c76e6e9e817c1e99ad0fed2e7ee7c89cc948baaf8
5
5
  SHA512:
6
- metadata.gz: 428fec8afebba7c475b5e71d56f749dc0477dc1bb15143fa21bfc8b45087ffccd4012dd745b5bbbde690939d1f44f0109383a504f9c44e7f4631dead1263ea44
7
- data.tar.gz: 9ef563e80a10babdc0719b4b88004ba3b571441191335baf45d9292478c585cc919d598bfc32c4d246448ce4777f64030de2f968e53388e4166c8562e66d5860
6
+ metadata.gz: dea36ed10af73ca738634902bf043db652baa251b43066fcb9e309f28c501ac60ea843ef66944fd1b5a5801f37bac385bb2e165daeef9e62498f527387502e2e
7
+ data.tar.gz: 1131b72244560c35aaff3c6b3fcc28da13caa67c74b7c6f3dc6628c0cbe0ee74ae85429165d04988d1466ff045ee9198505c48192833ca249260cea3f2310dc8
data/CHANGELOG.md CHANGED
@@ -1,10 +1,118 @@
1
- # Change Log
1
+ # Changelog
2
2
 
3
- All notable changes to this project will be documented in this file. This
4
- project adheres to [Semantic Versioning 2.0.0][semver]. Any violations of this
5
- scheme are considered to be bugs.
3
+ All notable changes to this project will be documented in this file.
6
4
 
7
- [semver]: http://semver.org/spec/v2.0.0.html
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+ Any violations of this scheme are considered to be bugs.
8
+
9
+ ## [5.2.0] - 2026-10-23
10
+
11
+ [5.2.0]: https://github.com/hashie/hashie/compare/v5.1.0...v5.2.0
12
+
13
+ ### Added
14
+
15
+ * [#644](https://github.com/hashie/hashie/pull/644): Added `rubocop-spellcheck` to the lint task for Ruby and documentation, with reviewed project vocabulary - [@dblock](https://github.com/dblock).
16
+ * [#636](https://github.com/hashie/hashie/pull/636): Added opt-in per-property lazy loaders for Dash and Trash, with transformations, coercion, defaults, and required-property validation deferred until access, following [#587](https://github.com/hashie/hashie/issues/587) - [@dblock](https://github.com/dblock).
17
+ * [#635](https://github.com/hashie/hashie/pull/635): Parse README Ruby examples with Kramdown and execute them in CI with isolated optional dependencies - [@dblock](https://github.com/dblock).
18
+ * [#623](https://github.com/hashie/hashie/pull/623): Documented Dash validation with ActiveModel and added integration coverage, following [#300](https://github.com/hashie/hashie/issues/300), reported by [@SkyCrawl](https://github.com/SkyCrawl), with the ActiveModel approach suggested by [@martinstreicher](https://github.com/martinstreicher) and endorsed by [@dblock](https://github.com/dblock).
19
+ * [#625](https://github.com/hashie/hashie/pull/625): Added an opt-in `YamlParser` that parses YAML without evaluating ERB, while preserving `Mash.load`'s existing ERB-enabled default for compatibility, following [#575](https://github.com/hashie/hashie/issues/575) - [@bo-tato](https://github.com/bo-tato), [@dblock](https://github.com/dblock).
20
+ * [#626](https://github.com/hashie/hashie/pull/626): Added executable YARD examples for every public class, module, and method, with public API example coverage enforced in Rake and CI, following the documentation work in [#421](https://github.com/hashie/hashie/pull/421) - [@michaelherold](https://github.com/michaelherold), [@dblock](https://github.com/dblock).
21
+ * [#621](https://github.com/hashie/hashie/pull/621): Added `Mash::UnderscoreKeys` on top of `TransformKeys` for camel-case and hyphenated key normalization, following [#566](https://github.com/hashie/hashie/pull/566) - [@arianf](https://github.com/arianf), [@dblock](https://github.com/dblock).
22
+ * [#620](https://github.com/hashie/hashie/pull/620): Added configurable `Mash::TransformKeys` key normalization as a foundation for [#566](https://github.com/hashie/hashie/pull/566) - [@arianf](https://github.com/arianf), [@dblock](https://github.com/dblock).
23
+ * [#618](https://github.com/hashie/hashie/pull/618): Added `Hashie::Extensions::DeepGrep` for regular-expression searches of nested hashes and arrays, following [#528](https://github.com/hashie/hashie/pull/528) - [@vmarutha](https://github.com/vmarutha), [@dblock](https://github.com/dblock).
24
+ * [#617](https://github.com/hashie/hashie/pull/617): Documented nil coercion bypass versus Dash defaults and added initialization, assignment, update, and inheritance regression coverage, following [#472](https://github.com/hashie/hashie/pull/472) - [@bobbytables](https://github.com/bobbytables), [@dblock](https://github.com/dblock).
25
+ * [#611](https://github.com/hashie/hashie/pull/611): Added callable coercers, including bound methods and dry-types objects, following [#379](https://github.com/hashie/hashie/pull/379) and [#239](https://github.com/hashie/hashie/issues/239) - [@mkcode](https://github.com/mkcode), [@dblock](https://github.com/dblock).
26
+ * [#612](https://github.com/hashie/hashie/pull/612): Added `Hashie::Extensions::DeepMergeInitializer` to recursively initialize Hash subclasses, including hashes inside arrays, following [#382](https://github.com/hashie/hashie/pull/382) - [@sazor](https://github.com/sazor), [@dblock](https://github.com/dblock).
27
+ * [#592](https://github.com/hashie/hashie/pull/592): Added support for Ruby 4.0 - [@dblock](https://github.com/dblock).
28
+ * [#595](https://github.com/hashie/hashie/pull/595): Added test coverage reporting with Coveralls - [@dblock](https://github.com/dblock).
29
+ * [#597](https://github.com/hashie/hashie/pull/597): Fixed coverage reporting to Coveralls to work on pull requests via `GITHUB_TOKEN` - [@dblock](https://github.com/dblock).
30
+ * [#599](https://github.com/hashie/hashie/pull/599): Added `Hashie::Extensions::Mash::StrictKeyAccess` to raise a `KeyError` for undefined keys, including in nested Mashes - [@dblock](https://github.com/dblock).
31
+ * [#601](https://github.com/hashie/hashie/pull/601): Added `Hashie::Extensions::KernelCoercion` to coerce core types using stricter `Kernel` methods (e.g. `Kernel#Integer`) instead of lenient conversion methods (e.g. `#to_i`) - [@dblock](https://github.com/dblock).
32
+ * [#605](https://github.com/hashie/hashie/pull/605): Added `Hashie::Extensions::Mash::RequiredKeys`, allowing a Mash to require specific keys to be set while still allowing arbitrary keys - [@dblock](https://github.com/dblock).
33
+ * [#608](https://github.com/hashie/hashie/pull/608): Added `Hashie::Extensions::BlockAccess` for block-style construction of nested hashes, completing [#109](https://github.com/hashie/hashie/pull/109) as a reusable extension - [@ryansouza](https://github.com/ryansouza), [@dblock](https://github.com/dblock).
34
+ * [#610](https://github.com/hashie/hashie/pull/610): Added opt-in `Hashie::Extensions::Persistable` for safe YAML loading and atomic file saves, following [#262](https://github.com/hashie/hashie/pull/262) - [@maxlinc](https://github.com/maxlinc), [@michaelherold](https://github.com/michaelherold), [@dblock](https://github.com/dblock).
35
+
36
+ ### Changed
37
+
38
+ * [#630](https://github.com/hashie/hashie/pull/630): Enabled project-wide RuboCop with new cops, Rake and RSpec plugins, frozen string literals, autocorrections, and a refreshed baseline for remaining offenses - [@dblock](https://github.com/dblock).
39
+ * [#615](https://github.com/hashie/hashie/pull/615): Reduced allocations in Mash array conversion while preserving `Hashie::Array` behavior, and reused symbol names in indifferent and original-key access when available - [@dblock](https://github.com/dblock).
40
+ * [#607](https://github.com/hashie/hashie/pull/607): Standardized exception message casing and punctuation and enforced the convention with RuboCop - [@dblock](https://github.com/dblock).
41
+ * [#607](https://github.com/hashie/hashie/pull/607): Upgraded RuboCop to 1.91.0 and consolidated exception-message checks into one CI lint job - [@dblock](https://github.com/dblock).
42
+ * [#590](https://github.com/hashie/hashie/pull/590): Migrated Danger to use `danger-pr-comment` workflow - [@dblock](https://github.com/dblock).
43
+ * [#613](https://github.com/hashie/hashie/pull/613): `Mash` converts symbol keys with `Symbol#name` on Ruby 3.0+, so reads and writes with a symbol key no longer allocate a string - [@sampokuokkanen](https://github.com/sampokuokkanen).
44
+
45
+ ### Removed
46
+
47
+ * Reverted [#619](https://github.com/hashie/hashie/pull/619)'s `deep_merge_new_hash` hook in favor of the breaking-change proposal in [#632](https://github.com/hashie/hashie/pull/632), which preserves incoming hash subclasses directly - [@dblock](https://github.com/dblock).
48
+ * [#622](https://github.com/hashie/hashie/pull/622): Dropped Ruby 2.7 support, raised the minimum to Ruby 3.0, and removed obsolete Ruby version gates and symbol-conversion fallbacks, following [#613](https://github.com/hashie/hashie/pull/613#issuecomment-6354118292) - [@dblock](https://github.com/dblock).
49
+
50
+ ### Fixed
51
+
52
+ * [#642](https://github.com/hashie/hashie/pull/642): Fixed Clash Marshal serialization on MRI by no longer advertising unimplemented serialization hooks - [@dblock](https://github.com/dblock).
53
+ * [#640](https://github.com/hashie/hashie/pull/640): Fixed Dash key transformation skipping hashes inside ordinary Ruby arrays - [@dblock](https://github.com/dblock).
54
+ * [#638](https://github.com/hashie/hashie/pull/638): Fixed Dash and Trash properties named `required?` colliding with required-property validation, following [#276](https://github.com/hashie/hashie/issues/276), reported by [@maxlinc](https://github.com/maxlinc) - [@dblock](https://github.com/dblock).
55
+ * [#616](https://github.com/hashie/hashie/pull/616): Fixed indifferent Trash initialization dropping source keys translated into multiple properties when ignoring undeclared fields, following [#518](https://github.com/hashie/hashie/pull/518) and [#514](https://github.com/hashie/hashie/issues/514) - [@jitendra1998](https://github.com/jitendra1998), [@dblock](https://github.com/dblock).
56
+ * [#609](https://github.com/hashie/hashie/pull/609): Fixed Clash YAML serialization losing stored keys and values, preserving subclasses and parent links - [@dblock](https://github.com/dblock).
57
+ * [#593](https://github.com/hashie/hashie/pull/593): Fix trash subclasses changing superclass transformers - [@complex857](https://github.com/complex857).
58
+ * [#606](https://github.com/hashie/hashie/pull/606): Fix `Hashie::Mash#dup` for subclasses including `MethodAccessWithOverride`, preserving default values and procs - [@Boulea7](https://github.com/Boulea7).
59
+ * [#596](https://github.com/hashie/hashie/pull/596): Fixed `Hashie::Extensions::Mash::DefineAccessors` raising an `ArgumentError` when a Mash key literally matched a suffixed accessor name (e.g. `foo=`, `foo?`, `foo!`, `foo_`) - [@dblock](https://github.com/dblock).
60
+ * [#602](https://github.com/hashie/hashie/pull/602): Fixed `Hashie::Extensions::Coercion`'s `coerce_value` not triggering for nested Hashes inside a `Mash`, since Mash's own recursive Hash-to-Mash conversion ran first - [@dblock](https://github.com/dblock).
61
+ * [#603](https://github.com/hashie/hashie/pull/603): Fixed `Trash`/`PropertyTranslation` incorrectly allowing `:from` to match the property name when the types differ (e.g. a symbol property translated `from:` a string of the same name), causing a "method redefined" warning instead of the intended `ArgumentError` - [@dblock](https://github.com/dblock).
62
+ * [#604](https://github.com/hashie/hashie/pull/604): Fixed `Dash#deep_transform_keys` (and `Trash`) raising `ArgumentError` for required properties under Rails 7+, since `ActiveSupport::Hash#deep_transform_keys` builds its result via `self.class.new` - [@dblock](https://github.com/dblock).
63
+ * [#614](https://github.com/hashie/hashie/pull/614): Fixed `Hashie::Mash#dup` allocating six extra objects on every call since #606, by looking up `Hash#default` and `Hash#default_proc` once and calling them with `bind_call` - [@sampokuokkanen](https://github.com/sampokuokkanen).
64
+
65
+ ## [5.1.0] - 2025-12-24
66
+
67
+ [5.1.0]: https://github.com/hashie/hashie/compare/v5.0.0...v5.1.0
68
+
69
+ ### Added
70
+
71
+ * [#569](https://github.com/hashie/hashie/pull/569): Added support for Rails 7 - [@aflansburg](https://github.com/aflansburg).
72
+
73
+ ### Changed
74
+
75
+ * [#571](https://github.com/hashie/hashie/pull/571): Test with Ruby 3.2 - [@petergoldstein](https://github.com/petergoldstein).
76
+ * [#558](https://github.com/hashie/hashie/pull/558): Test with Ruby 3.1 - [@petergoldstein](https://github.com/petergoldstein).
77
+ * [#582](https://github.com/hashie/hashie/pull/582): Test with Ruby 3.3 and 3.4 - [@btalayeminaei](https://github.com/btalayeminaei).
78
+ * [#589](https://github.com/hashie/hashie/pull/589): Requires Ruby 2.7+ and upgraded Rubocop to 1.82.0 - [@sue445](https://github.com/sue445).
79
+
80
+ ### Fixed
81
+
82
+ * [#583](https://github.com/hashie/hashie/pull/583): Fix a warning about the `logger` gem on Ruby 3.4 - [@earlopain](https://github.com/earlopain).
83
+
84
+ ## [5.0.0] - 2021-11-08
85
+
86
+ [5.0.0]: https://github.com/hashie/hashie/compare/v4.1.0...v5.0.0
87
+
88
+ ### Added
89
+
90
+ * [#523](https://github.com/hashie/hashie/pull/523): Added TOC, ensure a keep-a-changelog formatted CHANGELOG - [@dblock](https://github.com/dblock).
91
+ * [#522](https://github.com/hashie/hashie/pull/522): Added eierlegende Wollmilchsau mascot graphic - [@carolineartz](https://github.com/carolineartz).
92
+ * [#530](https://github.com/hashie/hashie/pull/530): Added Hashie::Extensions::Dash::PredefinedValues - [@caalberts](https://github.com/caalberts).
93
+ * [#536](https://github.com/hashie/hashie/pull/536): Added exporting a normal Hash from an indifferent one through the `#to_hash` method - [@michaelherold](https://github.com/michaelherold).
94
+ * [#539](https://github.com/hashie/hashie/pull/539): Run 2.7 tests once - [@anakinj](https://github.com/anakinj).
95
+
96
+ ### Changed
97
+
98
+ * [#521](https://github.com/hashie/hashie/pull/499): Do not convert keys that cannot be represented as symbols to `String` in `Mash` initialization - [@carolineartz](https://github.com/carolineartz).
99
+ * [#524](https://github.com/hashie/hashie/pull/524): Test with Ruby 2.7 - [@aried3r](https://github.com/aried3r).
100
+ * [#525](https://github.com/hashie/hashie/pull/525): Use `indifferent_writer` in `IndifferentAccess#convert!` - [@yogeshjain999](https://github.com/yogeshjain999).
101
+ * [#527](https://github.com/hashie/hashie/pull/527): Updated Copyright to (c) 2009-2020 Intridea, Inc., and Contributors - [@dblock](https://github.com/dblock).
102
+ * [#555](https://github.com/hashie/hashie/pull/555): Test with Ruby 3.0 - [@dblock](https://github.com/dblock).
103
+
104
+ ### Removed
105
+
106
+ * [#538](https://github.com/hashie/hashie/pull/538): Dropped testing for JRuby 9.0, though not support - [@michaelherold](https://github.com/michaelherold).
107
+
108
+ ### Fixed
109
+
110
+ * [#516](https://github.com/hashie/hashie/issues/516): Fixed `NoMethodError` raised when including `Hashie::Extensions::Mash::SymbolizeKeys` and `Hashie::Extensions::SymbolizeKeys` in mashes/hashes with non string or symbol keys - [@carolineartz](https://github.com/carolineartz).
111
+ * [#531](https://github.com/hashie/hashie/pull/531): Fixed [slice doesn't work using symbols](https://github.com/hashie/hashie/issues/529) using hash with `IndifferentAccess` extension - [@gnomex](https://github.com/gnomex).
112
+ * [#533](https://github.com/hashie/hashie/pull/533): Fixed `NoMethodError: undefined method 'to_json'` at `hashie/dash_spec` - [@gnomex](https://github.com/gnomex).
113
+ * [#535](https://github.com/hashie/hashie/pull/535): Restored the exporting of all properties as part of `Dash#to_h` and `Dash#to_hash` - [@michaelherold](https://github.com/michaelherold).
114
+ * [#537](https://github.com/hashie/hashie/pull/537): Fixed inconsistencies with handling defaults in `Dash` with and without `IgnoreUnclared` mixed in - [@michaelherold](https://github.com/michaelherold).
115
+ * [#547](https://github.com/hashie/hashie/pull/547): Fixed issue where a source hash key can be used in translating multiple properties - [@danwa5](https://github.com/danwa5).
8
116
 
9
117
  ## [4.1.0] - 2020-02-01
10
118
 
@@ -12,8 +120,13 @@ scheme are considered to be bugs.
12
120
 
13
121
  ### Added
14
122
 
123
+ * [#545](https://github.com/hashie/hashie/pull/545): Add `Hashie::Mash#except` and `Hashie::Extensions::IndifferentAccess#except` when running under Ruby 3 to match newly added Ruby stdlib method - [@jackjennings](https://github.com/jackjennings).
15
124
  * [#499](https://github.com/hashie/hashie/pull/499): Add `Hashie::Extensions::Mash::PermissiveRespondTo` to make specific subclasses of Mash fully respond to messages for use with `SimpleDelegator` - [@michaelherold](https://github.com/michaelherold).
16
125
 
126
+ ### Changed
127
+
128
+ * [#498](https://github.com/hashie/hashie/pull/498): Exclude tests from the gem release to reduce installation size and improve installation speed - [@michaelherold](https://github.com/michaelherold).
129
+
17
130
  ### Fixed
18
131
 
19
132
  * [#467](https://github.com/intridea/hashie/pull/467): Fixed `DeepMerge#deep_merge` mutating nested values within the receiver - [@michaelherold](https://github.com/michaelherold).
@@ -27,11 +140,6 @@ scheme are considered to be bugs.
27
140
  * [#512](https://github.com/hashie/hashie/pull/512): Suppress an integer unification warning for using Ruby 2.4.0+ - [@koic](https://github.com/koic).
28
141
  * [#513](https://github.com/hashie/hashie/pull/513): Suppress a Ruby's warning when using Ruby 2.6.0+ - [@koic](https://github.com/koic).
29
142
 
30
- ### Miscellaneous
31
-
32
- * [#981](https://github.com/hashie/hashie/pull/981): Exclude tests from the gem release to reduce installation size and improve installation speed - [@michaelherold](https://github.com/michaelherold).
33
- * Your contribution here.
34
-
35
143
  ## [4.0.0] - 2019-10-30
36
144
 
37
145
  [4.0.0]: https://github.com/hashie/hashie/compare/v3.6.0...v4.0.0
@@ -47,6 +155,7 @@ scheme are considered to be bugs.
47
155
  ### Changed
48
156
 
49
157
  * [#481](https://github.com/hashie/hashie/pull/481): Implement non-destructive standard Hash methods - [@bobbymcwho](https://github.com/bobbymcwho).
158
+ * [#482](https://github.com/hashie/hashie/pull/482): Update Travis configs to make jruby builds run on trusty dist - [@BobbyMcWho](https://github.com/BobbyMcWho).
50
159
 
51
160
  ### Fixed
52
161
 
@@ -54,11 +163,7 @@ scheme are considered to be bugs.
54
163
  * [#465](https://github.com/hashie/hashie/pull/465): Fixed `deep_update` to call any readers when a key exists - [@laertispappas](https://github.com/laertispappas).
55
164
  * [#479](https://github.com/hashie/hashie/pull/479): Fixed an issue with `Hash#except` not returning a `Mash` in Rails 6 - [@bobbymcwho](https://github.com/bobbymcwho).
56
165
  * [#489](https://github.com/hashie/hashie/pull/489): Updated the documentation to exlain the behavior of `Mash` and keyword arguments - [@Bhacaz](https://github.com/Bhacaz).
57
-
58
- ### Miscellaneous
59
-
60
166
  * [#465](https://github.com/hashie/hashie/pull/465): Clean up our RuboCop configuration and fix the outstanding line length violations. This involved some minor refactoring on `Hashie::Extensions::Coercion`, `Hashie::Extensions::Dash::IndifferentAccess`, `Hashie::Extensions::DeepLocate`, `Hashie::Extensions::Mash::SafeAssignment`, and `Hashie::Hash`, but none that were detectable via the test suite - [@michaelherold](https://github.com/michaelherold).
61
- * [#482](https://github.com/hashie/hashie/pull/482): Update Travis configs to make jruby builds run on trusty dist. - [@BobbyMcWho](https://github.com/BobbyMcWho).
62
167
 
63
168
  ## [3.6.0] - 2018-08-13
64
169
 
@@ -67,6 +172,12 @@ scheme are considered to be bugs.
67
172
  ### Added
68
173
 
69
174
  * [#455](https://github.com/hashie/hashie/pull/455): Allow overriding methods when passing in a hash - [@lnestor](https://github.com/lnestor).
175
+ * [#434](https://github.com/hashie/hashie/pull/434): Add documentation around Mash sub-Hashes - [@michaelherold](https://github.com/michaelherold).
176
+ * [#439](https://github.com/hashie/hashie/pull/439): Add an integration spec for Elasticsearch - [@michaelherold](https://github.com/michaelherold).
177
+
178
+ ### Changed
179
+
180
+ * [#433](https://github.com/hashie/hashie/pull/433): Update Rubocop to the most recent version - [@michaelherold](https://github.com/michaelherold).
70
181
 
71
182
  ### Fixed
72
183
 
@@ -76,21 +187,15 @@ scheme are considered to be bugs.
76
187
  * [#438](https://github.com/hashie/hashie/pull/438): Fix: `NameError (uninitialized constant Hashie::Extensions::Parsers::YamlErbParser::Pathname)` in `Hashie::Mash.load` - [@onk](https://github.com/onk).
77
188
  * [#457](https://github.com/hashie/hashie/pull/457): Fix `Trash` to allow it to copy properties from other properties - [@michaelherold](https://github.com/michaelherold).
78
189
 
79
- ### Miscellaneous
80
-
81
- * [#433](https://github.com/hashie/hashie/pull/433): Update Rubocop to the most recent version - [@michaelherold](https://github.com/michaelherold).
82
- * [#434](https://github.com/hashie/hashie/pull/434): Add documentation around Mash sub-Hashes - [@michaelherold](https://github.com/michaelherold).
83
- * [#439](https://github.com/hashie/hashie/pull/439): Add an integration spec for Elasticsearch - [@michaelherold](https://github.com/michaelherold).
84
-
85
190
  ## [3.5.7] - 2017-12-19
86
191
 
87
192
  [3.5.7]: https://github.com/hashie/hashie/compare/v3.5.6...v3.5.7
88
193
 
89
194
  ### Fixed
90
195
 
91
- [#430](https://github.com/hashie/hashie/pull/430): Fix Hashie::Rash randomly losing items - [@Antti](https://github.com/Antti)
196
+ * [#430](https://github.com/hashie/hashie/pull/430): Fix Hashie::Rash randomly losing items - [@Antti](https://github.com/Antti).
92
197
 
93
- ### Miscellaneous
198
+ ### Changed
94
199
 
95
200
  * [#425](https://github.com/hashie/hashie/pull/425): Update rubies in CI - [@kachick](https://github.com/kachick).
96
201
 
@@ -98,7 +203,7 @@ scheme are considered to be bugs.
98
203
 
99
204
  [3.5.6]: https://github.com/hashie/hashie/compare/v3.5.5...v3.5.6
100
205
 
101
- ### Miscellaneous
206
+ ### Fixed
102
207
 
103
208
  * [#416](https://github.com/hashie/hashie/pull/416): Fix `warning: instance variable @disable_warnings not initialized` - [@axfcampos](https://github.com/axfcampos).
104
209
 
@@ -124,7 +229,7 @@ scheme are considered to be bugs.
124
229
 
125
230
  ### Fixed
126
231
 
127
- * [#409](https://github.com/hashie/hashie/pull/409): Fixed Railtie detection for projects where Rails is defined but Railties are not availble - [@CallumD](https://github.com/callumd).
232
+ * [#409](https://github.com/hashie/hashie/pull/409): Fixed Railtie detection for projects where Rails is defined but Railties are not available - [@CallumD](https://github.com/callumd).
128
233
  * [#411](https://github.com/hashie/hashie/pull/411): Fixed a performance regression from 3.4.3 that caused a 10x slowdown in OmniAuth - [@michaelherold](https://github.com/michaelherold).
129
234
 
130
235
  ## [3.5.3] - 2017-02-11
@@ -145,16 +250,13 @@ scheme are considered to be bugs.
145
250
 
146
251
  * [#395](https://github.com/hashie/hashie/pull/395): Add the ability to disable warnings in Mash subclasses - [@michaelherold](https://github.com/michaelherold).
147
252
  * [#400](https://github.com/hashie/hashie/pull/400): Fix Hashie.logger load and set the Hashie logger to the Rails logger in a Rails environment - [@michaelherold](https://github.com/michaelherold).
253
+ * [#397](https://github.com/hashie/hashie/pull/397): Add the integration specs harness into the main test tasks - [@michaelherold](https://github.com/michaelherold).
148
254
 
149
255
  ### Fixed
150
256
 
151
257
  * [#396](https://github.com/hashie/hashie/pull/396): Fix for specs in #381: Incorrect use of shared context meant example was not being run - [@biinari](https://github.com/biinari).
152
258
  * [#399](https://github.com/hashie/hashie/pull/399): Fix passing Pathname object to Hashie::Mesh.load() - [@albb0920](https://github.com/albb0920).
153
259
 
154
- ### Miscellanous
155
-
156
- * [#397](https://github.com/hashie/hashie/pull/397): Add the integration specs harness into the main test tasks - [@michaelherold](https://github.com/michaelherold).
157
-
158
260
  ## [3.5.1] - 2017-01-31
159
261
 
160
262
  * [#392](https://github.com/hashie/hashie/pull/392): Fix for #391: Require all dependencies of Hashie::Mash - [@dblock](https://github.com/dblock).
@@ -183,10 +285,7 @@ scheme are considered to be bugs.
183
285
  * [#377](https://github.com/hashie/hashie/pull/377): Dont use Rubygems to check ruby version - [@sazor](https://github.com/sazor).
184
286
  * [#378](https://github.com/hashie/hashie/pull/378): Deep find all searches inside all nested hashes - [@sazor](https://github.com/sazor).
185
287
  * [#380](https://github.com/hashie/hashie/pull/380): Evaluate procs default values of Dash in object initialization - [@sazor](https://github.com/sazor).
186
-
187
- ### Miscellanous
188
-
189
- * [#387](https://github.com/hashie/hashie/pull/387): Fix builds failing due to Rake 11 having a breaking change - [@michaelherold](https://github.com/michaelherold).
288
+ * [#387](https://github.com/hashie/hashie/pull/387): Fixed builds failing due to Rake 11 having a breaking change - [@michaelherold](https://github.com/michaelherold).
190
289
 
191
290
  ## [3.4.6] - 2016-09-16
192
291
 
@@ -203,6 +302,7 @@ scheme are considered to be bugs.
203
302
  ### Added
204
303
 
205
304
  * [#337](https://github.com/hashie/hashie/pull/337), [#331](https://github.com/hashie/hashie/issues/331): `Hashie::Mash#load` accepts a `Pathname` object - [@gipcompany](https://github.com/gipcompany).
305
+ * [#366](https://github.com/hashie/hashie/pull/366): Added Danger, PR linter - [@dblock](https://github.com/dblock).
206
306
 
207
307
  ### Deprecated
208
308
 
@@ -213,10 +313,6 @@ scheme are considered to be bugs.
213
313
  * [#358](https://github.com/hashie/hashie/pull/358): Fixed support for Array#dig - [@modosc](https://github.com/modosc).
214
314
  * [#365](https://github.com/hashie/hashie/pull/365): Ensured ActiveSupport::HashWithIndifferentAccess is defined before use in #deep_locate - [@mikejarema](https://github.com/mikejarema).
215
315
 
216
- ### Miscellanous
217
-
218
- * [#366](https://github.com/hashie/hashie/pull/366): Added Danger, PR linter - [@dblock](https://github.com/dblock).
219
-
220
316
  ## [3.4.4] - 2016-04-29
221
317
 
222
318
  [3.4.4]: https://github.com/hashie/hashie/compare/v3.4.3...v3.4.4
@@ -248,7 +344,7 @@ scheme are considered to be bugs.
248
344
  * [#304](https://github.com/hashie/hashie/pull/304): Ensured compatibility of `Hash` extensions with singleton objects - [@regexident](https://github.com/regexident).
249
345
  * [#310](https://github.com/hashie/hashie/pull/310): Fixed `Hashie::Extensions::SafeAssignment` bug with private methods - [@marshall-lee](https://github.com/marshall-lee).
250
346
 
251
- ### Miscellaneous
347
+ ### Changed
252
348
 
253
349
  * [#313](https://github.com/hashie/hashie/pull/313): Restrict pending spec to only Ruby versions 2.2.0-2.2.2 - [@pboling](https://github.com/pboling).
254
350
  * [#315](https://github.com/hashie/hashie/pull/315): Default `bin/` scripts: `console` and `setup` - [@pboling](https://github.com/pboling).
@@ -383,8 +479,6 @@ scheme are considered to be bugs.
383
479
 
384
480
  [3.0.0]: https://github.com/hashie/hashie/compare/v2.1.2...v3.0.0
385
481
 
386
- Note: This version introduces several backward incompatible API changes. See [UPGRADING](UPGRADING.md) for details.
387
-
388
482
  ### Added
389
483
 
390
484
  * [#149](https://github.com/hashie/hashie/issues/149): Allow IgnoreUndeclared and DeepMerge to be used with undeclared properties - [@jhaesus](https://github.com/jhaesus).
@@ -414,7 +508,7 @@ Note: This version introduces several backward incompatible API changes. See [UP
414
508
 
415
509
  ### Fixed
416
510
 
417
- * [#131](https://github.com/hashie/hashie/pull/131): Added IgnoreUndeclared, an extension to silently ignore undeclared properties at intialization - [@righi](https://github.com/righi).
511
+ * [#131](https://github.com/hashie/hashie/pull/131): Added IgnoreUndeclared, an extension to silently ignore undeclared properties at initialization - [@righi](https://github.com/righi).
418
512
  * [#138](https://github.com/hashie/hashie/pull/138): Added Hashie::Rash, a hash whose keys can be regular expressions or ranges - [@epitron](https://github.com/epitron).
419
513
  * [#144](https://github.com/hashie/hashie/issues/144): Fixed regression invoking `to_hash` with no parameters - [@mbleigh](https://github.com/mbleigh).
420
514
 
@@ -429,6 +523,7 @@ Note: This version introduces several backward incompatible API changes. See [UP
429
523
  ### Changed
430
524
 
431
525
  * [#89](https://github.com/hashie/hashie/issues/89): Do not respond to every method with suffix in Hashie::Mash, fixes Rails strong_parameters - [@Maxim-Filimonov](https://github.com/Maxim-Filimonov).
526
+ * Ruby style now enforced with Rubocop - [@dblock](https://github.com/dblock).
432
527
 
433
528
  ### Removed
434
529
 
@@ -450,10 +545,6 @@ Note: This version introduces several backward incompatible API changes. See [UP
450
545
  * [#130](https://github.com/hashie/hashie/pull/130): IndifferentAccess now works without MergeInitializer - [@npj](https://github.com/npj).
451
546
  * [#133](https://github.com/hashie/hashie/pull/133): Fixed Hash##to_hash with symbolize_keys - [@mhuggins](https://github.com/mhuggins).
452
547
 
453
- ### Miscellaneous
454
-
455
- * Ruby style now enforced with Rubocop - [@dblock](https://github.com/dblock).
456
-
457
548
  ## [2.0.5] - 2013-05-10
458
549
 
459
550
  [2.0.5]: https://github.com/hashie/hashie/compare/v2.0.4...v2.0.5
@@ -470,7 +561,7 @@ Note: This version introduces several backward incompatible API changes. See [UP
470
561
 
471
562
  * [#94](https://github.com/hashie/hashie/pull/94): Made #fetch method consistent with normal Hash - [@markiz](https://github.com/markiz).
472
563
 
473
- ### Miscellaneous
564
+ ### Changed
474
565
 
475
566
  * [#90](https://github.com/hashie/hashie/pull/90): Various doc tweaks - [@craiglittle](https://github.com/craiglittle).
476
567
 
@@ -498,10 +589,7 @@ Note: This version introduces several backward incompatible API changes. See [UP
498
589
  ### Removed
499
590
 
500
591
  * [#81](https://github.com/hashie/hashie/pull/81): Removed Mash#object_id override - [@matschaffer](https://github.com/matschaffer).
501
-
502
- ### Miscellaneous
503
-
504
- * Gem cleanup: removed VERSION, Gemfile.lock - [@jch](https://github.com/jch), [@mbleigh](https://github.com/mbleigh).
592
+ * Removed VERSION and Gemfile.lock - [@jch](https://github.com/jch), [@mbleigh](https://github.com/mbleigh).
505
593
 
506
594
  ## [2.0.0] - 2013-02-16
507
595
 
@@ -511,6 +599,7 @@ Note: This version introduces several backward incompatible API changes. See [UP
511
599
 
512
600
  * [#41](https://github.com/hashie/hashie/pull/41): DeepMerge extension - [@nashby](https://github.com/nashby).
513
601
  * [#78](https://github.com/hashie/hashie/pull/78): Merge and update accepts a block - [@jch](https://github.com/jch).
602
+ * [#72](https://github.com/hashie/hashie/pull/72): Updated gemspec with license info - [@jordimassaguerpla](https://github.com/jordimassaguerpla).
514
603
 
515
604
  ### Changed
516
605
 
@@ -525,7 +614,3 @@ Note: This version introduces several backward incompatible API changes. See [UP
525
614
  * [#62](https://github.com/hashie/hashie/pull/62): Updated respond_to? method signature to match ruby core definition - [@dlupu](https://github.com/dlupu).
526
615
  * [#63](https://github.com/hashie/hashie/pull/63): Dash defaults are dup'ed before assigned - [@ohrite](https://github.com/ohrite).
527
616
  * [#66](https://github.com/hashie/hashie/pull/66): Mash#fetch works with symbol or string keys - [@arthwood](https://github.com/arthwood).
528
-
529
- ### Miscellaneous
530
-
531
- * [#72](https://github.com/hashie/hashie/pull/72): Updated gemspec with license info - [@jordimassaguerpla](https://github.com/jordimassaguerpla).
data/CONTRIBUTING.md CHANGED
@@ -39,6 +39,8 @@ Ensure that you can build the project and run tests.
39
39
  bundle exec rake
40
40
  ```
41
41
 
42
+ CI reports code coverage to Coveralls. Coverage excludes `spec/` and `script/`; their tests and executable examples still run.
43
+
42
44
  #### Write Tests
43
45
 
44
46
  Try to write a test that reproduces the problem you're trying to fix or describes a feature that you want to build. Add to [spec/hashie](spec/hashie).
@@ -49,7 +51,11 @@ We definitely appreciate pull requests that highlight or reproduce a problem, ev
49
51
 
50
52
  Implement your feature or bug fix.
51
53
 
52
- Ruby style is enforced with [Rubocop](https://github.com/bbatsov/rubocop), run `bundle exec rubocop` and fix any style issues highlighted.
54
+ Ruby style is enforced with [Rubocop](https://github.com/bbatsov/rubocop), run `bundle exec rake rubocop` on Ruby 3.2 or newer and fix any style issues highlighted. Exception messages should start with a lowercase letter and have no trailing punctuation, matching Ruby's built-in exceptions.
55
+
56
+ RuboCop scans Ruby sources, specs, benchmarks, gem manifests, and Ruby scripts across the project, with new cops enabled by default. Ruby files must use `# frozen_string_literal: true`. Existing offenses that cannot be safely corrected are tracked in `.rubocop_todo.yml`.
57
+
58
+ On MRI Ruby 3.2 or newer, RuboCop also checks spelling in Ruby comments and strings and documentation with `rubocop-spellcheck`. The plugin's native dependencies are not installed on JRuby. Fix typos in the source and add intentional project terms to `.spellcheck.txt`, one word per line. Run only the spelling check with `bundle exec rubocop --only Spellcheck/Spelling`. If regenerating vocabulary with `--auto-gen-config`, review the word list so genuine typos are not accepted and preserve the existing `.rubocop_todo.yml` baseline.
53
59
 
54
60
  Make sure that `bundle exec rake` completes without errors.
55
61
 
@@ -57,6 +63,37 @@ Make sure that `bundle exec rake` completes without errors.
57
63
 
58
64
  Document any external behavior in the [README](README.md).
59
65
 
66
+ YARD examples cover every public class, module, and method declared in `lib`, and are executable:
67
+
68
+ ```
69
+ bundle exec rake docs:examples
70
+ bundle exec rspec spec/documentation_examples_spec.rb
71
+ ```
72
+
73
+ The dedicated documentation CI job runs both commands on Ruby 4.0. Railtie and ActiveSupport integration examples run separately on Ruby 3.3 with the real Rails 7 integration bundle: `BUNDLE_GEMFILE=spec/integration/rails_7/Gemfile bundle exec ruby -Ilib script/test_documentation_examples.rb --rails`. Both runs check coverage for all library files; only execution is partitioned by dependency requirements. Each `@example` must be self-contained: Hashie is loaded automatically, but local variables and class definitions are not shared between examples. Put expected Ruby values in inline, single-line `# =>` comments (or `#=>`); the runner evaluates the expression and compares it to the expected value with RSpec equality assertions. Multiline setup is supported, but standalone result comments and examples without assertions fail rather than passing unchecked. For example:
74
+
75
+ ```ruby
76
+ # @example Convert keys without changing a flat hash
77
+ # hash = { name: 'Ruby' }
78
+ # Hashie.stringify_keys(hash) # => { 'name' => 'Ruby' }
79
+ # hash # => { name: 'Ruby' }
80
+ ```
81
+
82
+ The runner uses maintained YARD parsing and the existing RSpec dependency, rather than importing #421's old yard-doctest/yardstick/inch/Guard stack. Each public class, module, and method needs its own `@example`; a class-level example does not cover its methods. Private methods and APIs already marked `@private` or `@api private` (including their descendants) do not need examples. Do not mark public APIs private merely to avoid documenting them. All `@example` tags are executed, even on internal APIs.
83
+
84
+ The focused specs verify successful execution, incorrect expected values causing a nonzero exit, missing public API examples failing coverage, and internal APIs not requiring coverage. Empty selections also fail. To test selected files, run `bundle exec ruby -Ilib script/test_documentation_examples.rb path/to/file.rb`; the default selection discovers `lib/**/*.rb`, so new files are included automatically.
85
+
86
+ This follows [@michaelherold's documentation in #421](https://github.com/hashie/hashie/pull/421), including its key-conversion examples, and extends executable coverage across the public API. Publishing and versioned GitHub Pages remain separate work; published documentation remains on [RubyDoc.info](https://www.rubydoc.info/gems/hashie). The original PR remains a reference and should not be closed automatically.
87
+
88
+ Fenced Ruby examples in the README are parsed with Kramdown's GFM parser and executed in the documentation CI job. Install the isolated documentation bundle, which supplies real Rails, ActiveModel, and dry-types dependencies, then run:
89
+
90
+ ```bash
91
+ BUNDLE_GEMFILE=spec/documentation/Gemfile bundle install
92
+ bundle exec rake docs:readme
93
+ ```
94
+
95
+ The runner executes Ruby without rewriting output comments into assertions. Examples demonstrating exceptions rescue the expected exception explicitly. Each example runs in its own namespace and temporary directory; related snippets share a namespace when preceded by matching `<!-- hashie:example descriptive-name -->` comments. Hashie is loaded automatically; snippets require their other dependencies. Shell, YAML, and other non-Ruby fences are not executed. Only run trusted documentation: this is not a sandbox.
96
+
60
97
  #### Update Changelog
61
98
 
62
99
  Add a line to [CHANGELOG](CHANGELOG.md) under *Unreleased*. Make it look like every other line, including your name and link to your Github account.
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Intridea, Inc., and Contributors
1
+ Copyright (c) 2009-2020 Intridea, Inc., and Contributors.
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the