Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

safe_yaml vs Psych safe_load #78

Open
mfazekas opened this issue Jul 3, 2015 · 1 comment
Open

safe_yaml vs Psych safe_load #78

mfazekas opened this issue Jul 3, 2015 · 1 comment

Comments

@mfazekas
Copy link

mfazekas commented Jul 3, 2015

On ruby 2.2.2

2.2.2 :001 > require 'yaml'
2.2.2 :002 > YAML.safe_load("foo: !ruby/regexp '/bar/'\n",[Regexp])
 => ("foo"=>/bar/)

if i include safe_yaml:

2.2.2 :001 > require 'yaml'
2.2.2 :002 > require 'safe_yaml'
2.2.2 :003 > YAML.safe_load("foo: !ruby/regexp '/bar/'\n",[Regexp])
 => {"foo"=>"/bar/"} 

Note that safe_yaml does not create a regex but a string.

@mfazekas
Copy link
Author

mfazekas commented Jul 3, 2015

The concrete issue i've faced was running rake rubocop on a project that included rails_admin, since rails_admin indirectly includes safe_yaml and rubocop uses YAML.safe_load, they are not working together. See rubocop/rubocop#2009

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant