summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Giddins <segiddins@segiddins.me>2017-10-30 21:45:35 -0500
committerSamuel Giddins <segiddins@segiddins.me>2017-10-30 22:30:32 -0500
commit528ff71fd3d2833c0d961e1f65be682c1627844e (patch)
treecca77a7640758b2ff47e477c80b67c3228a9cd02
parenta0b8d0f822091038872679083cfb9d1addde6b7f (diff)
downloadbundler-528ff71fd3d2833c0d961e1f65be682c1627844e.tar.gz
Ensure bundler/psyched_yaml is always loaded before Gem.load_yaml is called
-rw-r--r--lib/bundler.rb2
-rw-r--r--lib/bundler/rubygems_integration.rb1
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 81c6a5b594..bef2caabcf 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -487,6 +487,8 @@ EOF
private
def eval_yaml_gemspec(path, contents)
+ Kernel.send(:require, "bundler/psyched_yaml")
+
# If the YAML is invalid, Syck raises an ArgumentError, and Psych
# raises a Psych::SyntaxError. See psyched_yaml.rb for more info.
Gem::Specification.from_yaml(contents)
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 1185625e03..0f16b6231d 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -299,6 +299,7 @@ module Bundler
def spec_from_gem(path, policy = nil)
require "rubygems/security"
+ require "bundler/psyched_yaml"
gem_from_path(path, security_policies[policy]).spec
rescue Gem::Package::FormatError
raise GemspecError, "Could not read gem at #{path}. It may be corrupted."