Skip to content

Commit ed2fa30

Browse files
committed
fix safe_yaml loading for ruby 2.2+
refs #CNVS-27229 Change-Id: I79219a24c61cb29b4ad11a74e0caa72197d2400c Reviewed-on: https://gerrit.instructure.com/77729 Reviewed-by: Cody Cutrer <cody@instructure.com> Tested-by: Jenkins Product-Review: James Williams <jamesw@instructure.com> QA-Review: James Williams <jamesw@instructure.com>
1 parent a274377 commit ed2fa30

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/canvas_yaml.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@
2525
require 'yaml'
2626

2727
require 'syck' # so we can undo all the things before something else requires it
28-
YAML::ENGINE.yamler = 'psych' if defined?(YAML::ENGINE)
28+
if defined?(YAML::ENGINE)
29+
YAML::ENGINE.yamler = 'psych'
30+
else
31+
YAML = Psych # :/
32+
end
2933

3034
require 'safe_yaml'
3135

0 commit comments

Comments
 (0)