Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
make sure we require psych if gem fails
Browse files Browse the repository at this point in the history
  • Loading branch information
indirect committed Nov 15, 2012
1 parent f99bc89 commit 9904583
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/bundler/psyched_yaml.rb
@@ -1,17 +1,20 @@
# Psych could be a gem, so try to ask for it
begin
# Psych could be a gem, so set up the load path
gem 'psych' if defined?(gem)
gem 'psych'
rescue LoadError
end if defined?(gem)

# Psych could just be in the stdlib
# but it's too late if Syck is already loaded
# Psych could just be in the stdlib
# but it's too late if Syck is already loaded
begin
require 'psych' unless defined?(Syck)
rescue LoadError
# apparently Psych wasn't available. Oh well.
ensure
# at least load the YAML stdlib, whatever that may be
require 'yaml'
# Apparently Psych wasn't available. Oh well.
end

# At least load the YAML stdlib, whatever that may be
require 'yaml'

module Bundler
# On encountering invalid YAML,
# Psych raises Psych::SyntaxError
Expand Down

0 comments on commit 9904583

Please sign in to comment.