Mash should load yaml file.#459
Conversation
|
Reproducing problem with loading yaml file with aliases. |
|
Thanks! I'll take a look. |
|
Okay, I've narrowed it down to this commit: 5a6ffc7 I'm going to see what is in there that would cause this to be an issue. |
Also, reorganize the test into the existing file and update the changelog.
|
TIL that Would you please test this out to make sure it works for the use case(s) which made you discover this regression? If so, we can get a patch release out to fix it for you in a released version. |
|
Thanks a lot for quick fix. Looks like it works with our app. |
|
Other than the regression, there's probably a reason YAML doesn't do aliases by default (security?). Maybe we should deprecate this behavior or expose it differently? |
|
I'd be okay with adding the ability to toggle it on or off. The interface for class Mash
def self.load(path, options = {})
# ...
parser_klass = options.fetch(:parser) { Hashie::Extensions::Parsers::YamlErbParser }
parser = parser_klass.new(options.fetch(:parser_options, {}))
@_mashes[path] = new(parser.perform(path)).freeze
end
end
config = Mash.load("my_yaml.yml", parser_options: { aliases: true })I'm not sure what the best approach for this would be. Prior to 3.6.0, we used An asideOne of my dreams is to deprecate |
|
Sorry for silence, took holiday on Friday. From my point of view creating mash from YAML directly is not adding much value. Is nice to have it but I wouldn't spend much time to consider all possible use cases. One more way it could be to have safe_load, and load methods. If you decide not merge this pull request and stay with non alias YAML version, I'm fine with just loading yaml manually and pass data as hash to Mash.new. (hard part was just to find what is breaking) |
|
Hi, Has there been a decision on this? We are currently loading YAML config files (with aliases) through Should we switch to loading the YAML manually first to keep up-to-date? |
|
Should we merge this @michaelherold ? |
michaelherold
left a comment
There was a problem hiding this comment.
Yes, I think we will merge this. Sorry that we missed your follow-up, @arekt!
|
@michaelherold no worries, thanks for merge :) |
No description provided.