Skip to content

Commit

Permalink
Fix: NameError (uninitialized constant Hashie::Extensions::Parsers::Y…
Browse files Browse the repository at this point in the history
…amlErbParser::Pathname)

`Hashie::Mash.load` require `Pathname` since v3.4.5.

see: bbafade

```
irb(main):001:0> require "hashie"
=> true
irb(main):002:0> Hashie::Mash.load("foo.yml")
Traceback (most recent call last):
        6: from /opt/rubies/2.6.0-dev/bin/irb:11:in `<main>'
        5: from (irb):2
        4: from /Users/onaka/.gem/ruby/2.6.0/gems/hashie-3.5.7/lib/hashie/mash.rb:105:in `load'
        3: from /Users/onaka/.gem/ruby/2.6.0/gems/hashie-3.5.7/lib/hashie/extensions/parsers/yaml_erb_parser.rb:19:in `perform'
        2: from /Users/onaka/.gem/ruby/2.6.0/gems/hashie-3.5.7/lib/hashie/extensions/parsers/yaml_erb_parser.rb:19:in `new'
        1: from /Users/onaka/.gem/ruby/2.6.0/gems/hashie-3.5.7/lib/hashie/extensions/parsers/yaml_erb_parser.rb:9:in `initialize'
NameError (uninitialized constant Hashie::Extensions::Parsers::YamlErbParser::Pathname)
irb(main):003:0> require "pathname"
=> true
irb(main):004:0> Hashie::Mash.load("foo.yml")
=> #<Hashie::Mash bar="baz">
```
  • Loading branch information
onk committed Feb 7, 2018
1 parent 3c6149c commit d76742c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -30,8 +30,10 @@ scheme are considered to be bugs.

* [#435](https://github.com/intridea/hashie/pull/435): Mash `default_proc`s are now propagated down to nested sub-Hashes - [@michaelherold](https://github.com/michaelherold).
* [#436](https://github.com/intridea/hashie/pull/436): Ensure that `Hashie::Extensions::IndifferentAccess` injects itself after a non-destructive merge - [@michaelherold](https://github.com/michaelherold).
* [#438](https://github.com/intridea/hashie/pull/438): Fix: `NameError (uninitialized constant Hashie::Extensions::Parsers::YamlErbParser::Pathname)` in `Hashie::Mash.load` - [@onk](https://github.com/onk).
* Your contribution here.


### Security

* Your contribution here.
Expand Down
1 change: 1 addition & 0 deletions lib/hashie/extensions/parsers/yaml_erb_parser.rb
@@ -1,5 +1,6 @@
require 'yaml'
require 'erb'
require 'pathname'
module Hashie
module Extensions
module Parsers
Expand Down

0 comments on commit d76742c

Please sign in to comment.