Skip to content
This repository
Browse code

adding requires and default yaml parser to psych if possible

  • Loading branch information...
commit a318f9180811fee3f0fd9db98c39916695502091 1 parent f2ca897
Aaron Patterson authored January 19, 2011
6  lib/bundler.rb
... ...
@@ -1,6 +1,12 @@
1 1
 require 'rbconfig'
2 2
 require 'fileutils'
3 3
 require 'pathname'
  4
+
  5
+begin
  6
+  require 'psych'
  7
+rescue LoadError
  8
+end
  9
+
4 10
 require 'yaml'
5 11
 require 'bundler/rubygems_ext'
6 12
 require 'bundler/version'
1  lib/bundler/cli.rb
... ...
@@ -1,6 +1,7 @@
1 1
 $:.unshift File.expand_path('../vendor', __FILE__)
2 2
 require 'thor'
3 3
 require 'thor/actions'
  4
+require 'rubygems/user_interaction'
4 5
 require 'rubygems/config_file'
5 6
 
6 7
 # Work around a RubyGems bug
1  lib/bundler/source.rb
... ...
@@ -1,4 +1,5 @@
1 1
 require "uri"
  2
+require 'rubygems/user_interaction'
2 3
 require "rubygems/installer"
3 4
 require "rubygems/spec_fetcher"
4 5
 require "rubygems/format"
2  lib/bundler/ui.rb
... ...
@@ -1,3 +1,5 @@
  1
+require 'rubygems/user_interaction'
  2
+
1 3
 module Bundler
2 4
   class UI
3 5
     def warn(message)
2  spec/support/rubygems_ext.rb
... ...
@@ -1,3 +1,5 @@
  1
+require 'rubygems/user_interaction'
  2
+
1 3
 module Spec
2 4
   module Rubygems
3 5
     def self.setup

2 notes on commit a318f91

Stéphan Kochen

This commit changes the default YAML parser to Psych for all gems, which may introduce subtle breakage. I personally ran into this in Rails 2.3: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/6354-psych-does-not-handle-symbols-in-yaml-used-in-activesupport

I'm not sure if this is a Bundler issue, or if any problems should be reported to the application or Psych. FWIW, Rails 3.0 seems to have worked around it, so I assume they acknowledge it to be an issue there, and I've reported one for 2.3.

Sergii Boiko

It's a very bad idea to add 'psych' instead of default 'syck' for 'yaml'. I have an issue with this in bundler 1.0.10 and ruby 1.9.2 because psych has a big issue with aliased sections in yaml. Now, to fix it, I should do require 'yaml' before require 'bunler' in rails-script.

See https://gist.github.com/809309 for reproduce. I've created bug https://github.com/carlhuda/bundler/issues/issue/1010

Nathan Broadbent

Is it possible that 'psych' is breaking the YAML output of ".bundle/config"?
It appears to us that between 1.0.9 and 1.0.10, the command "bundle install --deployment" has been broken, and no longer writes to ".bundle/config".
It could be an issue with our server configuration though, so it would be great to have this verified by someone else.

Please sign in to comment.
Something went wrong with that request. Please try again.