summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Merge pull request #511 from koic/suppress_kwargs_warning_for_ruby_2_7_0Daniel Doubrovkine (dB.) @dblockdotorg2020-01-152-1/+2
|\ | | | | Suppress keyword arguments warning for Ruby 2.7.0
| * Suppress keyword arguments warning for Ruby 2.7.0Koichi ITO2020-01-152-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This PR suppresses the following keyword arguments warning for Ruby 2.7.0. ```console % bundle exec rspec spec/hashie/extensions/mash/symbolize_keys_spec.rb (snip) /Users/koic/src/github.com/hahie/hashie/spec/hashie/extensions/mash/symbolize_keys_spec.rb:29: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call /Users/koic/src/github.com/hahie/hashie/spec/hashie/extensions/mash/symbolize_keys_spec.rb:21: warning: The called method `call' is defined here ``` For Ruby 2.8.0-dev (Ruby 3.0) the warning will be `ArgumentError`. ruby/ruby#2794
* | Don't warn when setting most affixed keys (#500)Michael Herold2020-01-155-1/+43
|/ | | | | | | | | | | | | | | | | | | | | Due to how we have implemented the bang/underbang/query behavior within Mash, setting keys that have those affixes in them actually allow overwriting the behavior of those affixes. As such, we shouldn't warn when setting a key that matches those patterns. When it comes to setter-like keys, I believe we still _do_ want to warn for two reasons: 1. Trying to access the key via method access is a syntax error. Ruby expects any method ending in `=` to be a 2+-arity method due to the infix notation of setter methods. This is unexpected behavior unless you're very familiar with Ruby parsing. 2. You can still retrieve the key via the normal `Hash#[]` reader, but it prevents setting a similar key without the equal sign. You can see this in the test about setters. I'd say that is unexpected and surprising behavior. Because of these two gotchas, I think we should still warn in cases where you try to set a key that looks like a setter.
* Fix except use in Mash#load (#508)Bobby McDonald2020-01-1412-283/+403
|
* Merge pull request #510 from BobbyMcWho/fix-compact-definitionBobby McDonald2020-01-133-27/+28
|\ | | | | Only define compact on ruby >= 2.4
| * Only define compact on ruby >= 2.4Bobby McDonald2020-01-133-27/+28
|/
* Merge pull request #507 from koic/suppress_warn_for_psych_3_1_0_or_higherDaniel Doubrovkine (dB.) @dblockdotorg2020-01-132-2/+20
|\ | | | | Suppress `Psych.safe_load` arg warn when using Psych 3.1.0+
| * Suppress `Psych.safe_load` arg warn when using Psych 3.1.0+Koichi ITO2020-01-132-2/+20
|/ | | | | | | | | | | | | | | | | | | | | | | This PR suppresses the following `Psych.safe_load` args warn when using Psych 3.1.0 (Ruby 2.6+). ```console % bundle exec rake spec (snip) /Users/koic/src/github.com/intridea/hashie/lib/hashie/extensions/parsers/yaml_erb_parser.rb:22: Passing permitted_classes with the 2nd argument of Psych.safe_load is deprecated. Use keyword argument like Psych.safe_load(yaml, permitted_classes: ...) instead. /Users/koic/src/github.com/intridea/hashie/lib/hashie/extensions/parsers/yaml_erb_parser.rb:22: Passing permitted_symbols with the 3rd argument of Psych.safe_load is deprecated. Use keyword argument like Psych.safe_load(yaml, permitted_symbols: ...) instead. /Users/koic/src/github.com/intridea/hashie/lib/hashie/extensions/parsers/yaml_erb_parser.rb:22: Passing aliases with the 4th argument of Psych.safe_load is deprecated. Use keyword argument like Psych.safe_load(yaml, aliases: ...) instead ```
* Merge pull request #505 from michaelherold/fix-multiple-array-conversionDaniel Doubrovkine (dB.) @dblockdotorg2019-12-143-2/+10
|\ | | | | Ensure that Hashie::Arrays are not deconverted
| * Ensure that Hashie::Arrays are not deconvertedMichael Herold2019-12-133-2/+10
|/ | | | | | | In order for `#dig` to work properly, we need Arrays to be `Hashie::Array`s to be aware of the key conversion. Our original `Mash#convert_value` method was deconverting `Hashie::Array`s into normal Arrays and causing `#dig` to behave in an unexpected manner.
* Merge pull request #502 from jmanian/masterDaniel Doubrovkine (dB.) @dblockdotorg2019-11-251-1/+2
|\ | | | | update comment for Mash truthiness methods
| * update comment for Mash truthiness methodsJeff Manian2019-11-251-1/+2
|/
* Merge pull request #499 from michaelherold/permissive-respond-toBobby McDonald2019-11-187-0/+176
|\ | | | | Add a PermissiveRespondTo extension for Mashes
| * Add a PermissiveRespondTo extension for MashesMichael Herold2019-11-177-0/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | By default, Mashes don't state that they respond to unset keys. This causes unexpected behavior when you try to use a Mash with a SimpleDelegator. This new extension allows you create a permissive subclass of Mash that will be fully compatible with SimpleDelegator and allow you to fully do thunk-oriented programming with Mashes. This comes with the trade-off of a ~19KB cache for each of these subclasses and a ~20% performance penalty on any of those subclasses.
* | Merge pull request #467 from michaelherold/deep-merge-bugDaniel Doubrovkine (dB.) @dblockdotorg2019-11-184-6/+93
|\ \ | | | | | | Prevent deep_merge from mutating nested hashes
| * | Prevent deep_merge from mutating nested hashesMichael Herold2019-11-174-6/+93
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `DeepMerge` extension has two methods of mutating hashes: a destructive one and a non-destructive one. The `#deep_merge` version should not mutate the original hash or any hash nested within it. The `#deep_merge!` version is free to mutate the receiver. Without deeply duplicating the values contained within the hash, the invariant of immutability cannot be held for the original hash. In order to preserve that invariant, we need to introduce a method of deeply duplicating the hash. The trick here is that we cannot rely on a simple call to `Object#dup`. Some classes within the Ruby standard library are not duplicable in particular versions of Ruby. Newer versions of Ruby allow these classes to be "duplicated" in a way that returns the original value. These classes represent value objects, so it is safe to return the original value ... unless the classes are monkey-patched, but that isn't something we can protect against. This implementation does a best-effort to deeply duplicate an entire hash by relying on these value object classes being able to return themselves without violating immutability.
* | Merge pull request #498 from michaelherold/gemspec-updatesDaniel Doubrovkine (dB.) @dblockdotorg2019-11-185-19/+42
|\ \ | |/ |/| Update the gemspec for improved information and installation size/speed
| * Improve the setup scriptMichael Herold2019-11-172-3/+15
| | | | | | | | | | We weren't installing the dependencies for the integration tests so the default Rake task was failing upon first run on a new machine.
| * Switch to only setting Bundler as a dev dependencyMichael Herold2019-11-172-14/+17
| | | | | | | | | | Our contributing documentation specifically mentions Bundler so we should set it as a development dependency.
| * Exclude tests from the gem releaseMichael Herold2019-11-172-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you're installing a gem in a production environment, you want it to install as fast it can. One of the ways you can speed up the installation of the gem is by making it smaller. We currently ship the test suite with the gem, increasing the size of the built gem significantly. By not shipping the test suite, we can shrink the size of the gem by 38%. Below are the measurements I took for that statement. **The size of the gem with the test suite** $ du -b hashie-4.0.1.gem 80384 hashie-4.0.1.gem **The size of the gem without the test suite** $ du -b hashie-4.0.1.gem 50176 hashie-4.0.1.gem
| * Adjust URL in gemspec and add metadata URLsMichael Herold2019-11-171-0/+9
|/ | | | | | RubyGems.org has recently added the capability to have extra metadata URLs shown on the gem page. These are handy for people who are new to a gem or need to report an issue.
* Update github urls to hashie/hashie (#497)Bobby McDonald2019-11-179-205/+210
| | | | | | | | | | | | | | | | * Update github urls to hashie/hashie * Point omniauth in integration tests at master. Until omniauth releases the changes merged from https://github.com/omniauth/omniauth/pull/977 , we must point at master branch. * revert incorrect change of gem email Co-Authored-By: Michael Herold <github@michaeljherold.com> * Reference open issue for release
* Remove github actionsBobby McDonald2019-11-161-31/+0
| | | This is causing too much noise while I experiment, I'll move it to my fork of hashie and test there.
* Pass specific ruby versions for ruby-buildBobby McDonald2019-11-161-1/+1
|
* Use ruby-build with cacheBobby McDonald2019-11-161-2/+8
|
* remove erroneously pasted codeBobby McDonald2019-11-161-7/+0
|
* versions should be stringsBobby McDonald2019-11-161-1/+8
|
* Use correct matrix variableBobby McDonald2019-11-161-2/+2
|
* Initial attempt at adding github actions CIBobby McDonald2019-11-161-0/+25
|
* Merge pull request #496 from michaelherold/update-readme-from-moveDaniel Doubrovkine (dB.) @dblockdotorg2019-11-161-6/+6
|\ | | | | Update the README from moving the repo
| * Update the README from moving the repoMichael Herold2019-11-161-6/+6
|/ | | | [ci skip]
* Preparing for next development iteration, 4.0.1.Bobby McDonald2019-10-303-2/+34
|
* Preparing for release, 4.0.0.v4.0.0Bobby McDonald2019-10-303-20/+4
|
* Merge pull request #492 from BobbyMcWho/remove-blacklist-whitelistDaniel Doubrovkine (dB.) @dblockdotorg2019-10-286-25/+26
|\ | | | | Remove references to blacklists and whitelists
| * Remove references to blacklists and whitelistsBobby McDonald2019-10-256-25/+26
| |
* | Merge pull request #491 from BobbyMcWho/100-char-linesDaniel Doubrovkine (dB.) @dblockdotorg2019-10-2023-64/+141
|\ \ | | | | | | Change rubocop to restrict to 100 character lines.
| * | Change rubocop to allow 100 character lines.Bobby McDonald2019-10-1723-64/+141
| | | | | | | | | | | | | | | For accessibility reasons, we should limit our lines to 100 chars max. https://github.com/slack-ruby/slack-ruby-client/pull/293#discussion_r309472083
* | | Merge pull request #490 from BobbyMcWho/refactor-quietDaniel Doubrovkine (dB.) @dblockdotorg2019-10-181-5/+4
|\ \ \ | |/ / |/| | refactor quiet method
| * | remove tap and use blockBobby McDonald2019-10-171-5/+4
|/ /
* | Merge pull request #489 from Bhacaz/documentation_keyword_argumentsDaniel Doubrovkine (dB.) @dblockdotorg2019-10-162-4/+11
|\ \ | |/ | | Updated README.md
| * Updated README.mdJean-Francis Bastien2019-10-152-4/+11
|/ | | | SymbolizeKeys and Keywords argument behavior.
* Allow mash error silencing (#488)Bobby McDonald2019-10-148-77/+131
|
* Make Hashie play nice with Rails 6 Hash#except method (#479)Bobby McDonald2019-10-0210-20/+51
|
* Merge pull request #481 from BobbyMcWho/480-implement-non-destructive-methodsDaniel Doubrovkine (dB.) @dblockdotorg2019-08-185-10/+279
|\ | | | | Implement non-destructive standard Hash methods
| * Upgrading to 4.0Bobby McDonald2019-08-162-2/+42
| |
| * Implement ruby 2.6 hash merging.Bobby McDonald2019-08-142-5/+41
| | | | | | | | | | | | As of ruby 2.6, Hash#merge and Hash#merge! allow for multiple hashes to be passed to the method, and will merge each one in the order that they were passed.
| * Implement non-destructive hash methodsBobby McDonald2019-08-143-3/+196
|/ | | | | | | | | | | | | | | When calling the following non-destructive hash methods: :compact :invert :reject :select :slice :transform_keys :transform_values we would be returned an instance of a standard Hash rather than a Mash (or subclass). This changes that behavior to instead return an instance of the class the method was called on.
* Merge pull request #482 from BobbyMcWho/travis-updatesDaniel Doubrovkine (dB.) @dblockdotorg2019-08-142-8/+16
|\ | | | | Travis updates
| * Add ruby 2.6 jobBobby McDonald2019-08-141-0/+2
| |
| * Update ruby versions to default xenial installedBobby McDonald2019-08-141-5/+5
| |