summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix #401: use a Railtie to set Hashie.logger on rails boot.Matthew Rudy Jacobs2017-02-103-6/+13
|
* Prepare for next development iteration, 3.5.3Michael Herold2017-02-101-1/+1
|
* In Rails, set `Hashie.logger` to `Rails.logger`Michael Herold2017-02-101-1/+6
|
* Remove auto-load for `Hashie.logger`Michael Herold2017-02-102-2/+3
| | | | | | | | | The auto-load is never triggered because there is no `Hashie::Logger` constant to trigger it. We need to `require` the file in the top level `hashie.rb` and anywhere else that uses it (in case someone just loads a single file). At the moment, this is only used in Mash, so we're covered.
* Fix passing Pathname object to Hashie::Mesh.load()Albert Song2017-02-081-2/+3
| | | | With a test that would fail without this patch.
* Allow Mash subclasses to disable warningsMichael Herold2017-02-041-0/+25
| | | | | | | | | | | | | | | | | Since we are transitively used as a dependency in many projects, we should have given the ability to toggle this behavior off. The logging feature is more of a "help people get started with Mash" feature. If you're using Hashie in a library, it's likely that you already know the tradeoffs of attempting to override methods on the object. To use this feature, you only have to subclass Mash and then call the class method: ```ruby class KeyStore < Hashie::Mash disable_warnings end ```
* Prepare for next development iteration, 3.5.2Michael Herold2017-01-311-1/+1
|
* Fix #391: require all dependencies in Hashie::Mash.dblock2017-01-314-15/+21
|
* Prepare for next development iteration, 3.5.1Michael Herold2017-01-311-1/+1
|
* Preparing for release, 3.5.0v3.5.0Michael Herold2017-01-311-1/+1
|
* Support Ruby 2.4.0 (#389)Masahiro Saito2017-01-061-4/+8
|
* Fix #385 - deep merge by reference bug (#386)Joe Marty2016-12-131-1/+1
|
* Add a logging layer to address common issues (#381)Michael Herold2016-11-023-0/+48
|
* Evaluate procs default values in object initializationsazor2016-10-311-1/+5
|
* Deep find all goes inside all nested hashessazor2016-10-191-4/+3
|
* Check ruby version without rubygemssazor2016-10-183-3/+64
|
* Fix dig bug for Arraysazor2016-10-171-1/+8
|
* Use existing translations when using IndifferentAccess andMatt White2016-09-161-1/+2
| | | | IgnoreUndeclared
* Preparing for next development iteration, 3.4.7.dblock2016-09-161-1/+1
|
* Since hashie/mash can be required alone, require its dependenciesJoe Rafaniello2016-09-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes #367 While it's probably not something hashie wants to allow, previously this was possible so we shouldn't break this when going 3.4.4 to 3.4.5. As an example, omniauth requires hashie/mash alone: https://github.com/omniauth/omniauth/blob/d941c4bcb1eb52f3674dd46225808751dd6a1c2f/lib/omniauth/auth_hash.rb#L1 This appears to have been broken in #358. Note, we can't write a test for this because we require 'hashie' in the spec_helper which properly defines the Hashie::Extensions::Array constant and autoloads the pretty_inspect here: https://github.com/intridea/hashie/blob/229ee36d7c6a07eff6d8a0434726e12b8c3a0223/lib/hashie.rb#L48 **Before** ``` 10:44:30 ~/Code/hashie (master) (2.3.1) + be irb irb(main):001:0> require 'hashie/mash' NameError: uninitialized constant Hashie::Extensions::Array Did you mean? Hashie::Array Array from /Users/joerafaniello/Code/hashie/lib/hashie/array.rb:3:in `<class:Array>' from /Users/joerafaniello/Code/hashie/lib/hashie/array.rb:2:in `<module:Hashie>' from /Users/joerafaniello/Code/hashie/lib/hashie/array.rb:1:in `<top (required)>' from /Users/joerafaniello/Code/hashie/lib/hashie/mash.rb:2:in `require' from /Users/joerafaniello/Code/hashie/lib/hashie/mash.rb:2:in `<top (required)>' ... ``` **After** ``` 10:44:40 ~/Code/hashie (master) (2.3.1) + be irb irb(main):001:0> require 'hashie/mash' => true irb(main):002:0> exit ```
* Preparing for next development iteration, 3.4.6.dblock2016-09-161-1/+1
|
* Checking for explicit definition of ActiveSupport::HashWithIndifferentAccess ↵Mike Jarema2016-09-091-1/+1
| | | | | | | | | | (#365) * Checking for explicit definition of ActiveSupport::HashWithIndifferentAccess, current code assumes that the presence of ActiveSupport implies that HashWithIndifferentAccess was required * Correcting typo in CHANGELOG update * Updating CHANGELOG to log fix to #deep_locate
* Hashie::Mash.load accepts a Pathname object. Closes #331.Atsushi Ishida2016-07-151-1/+1
| | | | https://github.com/intridea/hashie/issues/331
* Fix support for Array#digjonathan schatz2016-06-015-1/+56
|
* Preparing for the next development iteration, 3.4.5.dblock2016-04-291-1/+1
|
* Merge pull request #350 from marshall-lee/fix_ignore_undeclaredDaniel Doubrovkine (dB.) @dblockdotorg2016-02-081-2/+5
|\ | | | | Stringified translations wasn't working in IgnoreUndeclared.
| * Refactor IgnoreUndeclared#initialize_attributes.Vladimir Kochnev2016-02-081-2/+5
| |
| * Stringified translations wasn't working in IgnoreUndeclared.Vladimir Kochnev2016-02-081-1/+1
| | | | | | | | | | | | Translation from `:symbol` and translation from `'string'` are different translations. No need in coercion to symbol or some other coercions.
* | Convert Mash keys for #digTakashi Kokubun2016-02-081-0/+6
|/
* Fix `#merge` breaking indifferent accessMichael Herold2016-01-311-0/+8
| | | | | | | | | `HashWithDifferentAccess` wasn't properly setting the indifferent access when merging in other hashes. This reruns `#convert!` after calling the superclass implementation of the method, so it preserves indifferent access on the resulting object. Fixes #345
* Make reverse_merge compatible with subclassing.Vladimir Kochnev2015-11-151-1/+1
|
* Clash: multiple bang notation callsBartosz Kopiński2015-10-271-11/+12
| | | | | | | | Added inheritance Added multiple bang notation merging Minor performace improvements - ends_with? is faster than regexp
* Make DeepLocate indifference-aware by defaultbugfix-deep-findMichael Herold2015-10-251-15/+21
| | | | | | | | | | | | | | `Hashie::Extensions::DeepLocate.deep_locate`, when passed a key, did not take into account indifferent access. This lead to a regression in v3.4.1 when `Hashie::Extensions::DeepFind` was modified to be backed by `DeepLocate`. This change makes the default comparator aware of indifferent access by inspecting the object that it is called on. It works with both `ActiveSupport::HashWithIndifferentAccess` and `Hashie::Extensions::IndifferentAccess`. Fixes #309
* Upgraded to RuboCop 0.34.2.dblock2015-10-251-2/+4
|
* Ensure that MethodQuery methods return booleans.Michael Herold2015-10-251-5/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation about the MethodQuery module spells out the expected behavior. While the spec suite appeared to be testing the same, the RSpec matchers were not actually checking the behavior properly. This lead to a divergence between the expected behavior, as outlined in the module documentation, and the actual behavior, as tested in the spec suite. This is the reason that #299 is happening: the expected behavior is not the actual behavior. I have included a test for #299 to show that it works as expected in this branch. This change makes the spec suite match the behavior in the module documentation, then modifies the methods to match the documentated specification. Lastly, I took the time to clean up the MethodQuery module for two reasons: 1. The old implementation used Regexps on the stringified method names, which is unnecessary since we have the wonderful `String#end_with?` method to check the suffix of a strings. 2. The old logic was difficult to reason through, so I clarified the intent of the methods by reducing the complexity of the conditionals and extracting meaningful methods where possible.
* Preparing for next development iteration, 3.4.4. [ci skip]dblock2015-10-251-1/+1
|
* - Removed `Hashie::Extensions::MergeInitializer` from `StrictKeyAccess` ↵Peter Boling2015-10-241-12/+15
| | | | | | | Extension - Updated, and enhanced specs - Improved documentation
* SRP: The StrictKeyAccess extension will raise an error whenever a key is ↵Peter Boling2015-10-232-0/+72
| | | | | | | | | | | | | | | | | | | | | | accessed that does not exist in the hash. In Python a "Hash" is called a "Dictionary", and ... > "It is an error to extract a value using a non-existent key." See: https://docs.python.org/2/tutorial/datastructures.html#dictionaries EXAMPLE: class StrictHash < Hash include Hashie::Extensions::StrictKeyAccess end >> hash = StrictHash[foo: "bar"] => {:foo=>"bar"} >> hash[:foo] => "bar" >> hash[:cow] KeyError: key not found: :cow
* Merge pull request #311 from marshall-lee/refactor_coercionDaniel Doubrovkine (dB.) @dblockdotorg2015-09-021-39/+65
|\ | | | | Refactor `Hashie::Extensions::Coercion`, add cache.
| * Refactor `Hashie::Extensions::Coercion`, add cache.Vladimir Kochnev2015-09-021-39/+65
| |
* | Speed up SafeAssignment and fix private methods.Vladimir Kochnev2015-09-021-1/+1
|/
* Merge pull request #308 from marshall-lee/mash_micro_optimizeDaniel Doubrovkine (dB.) @dblockdotorg2015-08-311-12/+19
|\ | | | | Some micro optimizations to Hashie::Mash.
| * Some micro optimizations to Hashie::Mash.Vladimir Kochnev2015-08-311-12/+19
| |
* | Remove needless codeVladimir Kochnev2015-08-311-2/+0
| |
* | Introduce Hashie::Extensions::Dash::Coercion.Vladimir Kochnev2015-08-312-0/+26
|/
* Fix bug (#303) preventing use of deep_merge/stringify_keys/symbolize_keys on ↵Vincent Esche2015-06-083-10/+18
| | | | extended singleton objects.
* Preparing for next release, 3.4.3Michael Herold2015-06-021-1/+1
|
* Extract Trash behavior into an extensionMichael Herold2015-04-253-117/+170
| | | | | | | | | | | | | | | | | | | | Issue #188 brought up the fact that a Trash is really just a Dash with some extended behavior. Why don't we make that a little more explicit and define its behavior as an extension? *Follow Up* If this is merged, I move that we deprecate Trash for removal in 4.0. I think reducing the number of classes will help users better understand what behavior they are including in their subclasses. In the long run, a 4.0 release would look really good with all of the behavior factored out into extension methods. As we continue down that path, we can slowly deprecate all of the `*ash` classes with the 3.x releases. What do the other maintainers think of this suggestion? Fixes #188
* Clarify the in-line documentation for DeepFindMichael Herold2015-04-181-0/+18
| | | | Fixes #284
* Removed Mash#id and Mash#type.Jonathan Rochkind2015-04-081-8/+0
| | | | | | | | | | Ruby 1.8.7 had Object#id and #type, both of which were deprecated, which Hashie::Mash wanted to cover with more reasonable methods. These methods in Object were removed in ruby 1.9. The cover methods are unneeded, and can cause problems with Mash::SafeAssignment preventing you from using these as keys. Fixes #290