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

Commit

Permalink
don't require yaml until we need to write settings
Browse files Browse the repository at this point in the history
we don't require yaml when we need to read the settings by using our own ghetto 
YAML parser that only applies to Bundler config files. specs still pass. :P
  • Loading branch information
indirect committed Nov 13, 2012
1 parent 2d65f9a commit 156d688
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion lib/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
require 'fileutils'
require 'pathname'
require 'bundler/gem_path_manipulation'
require 'bundler/psyched_yaml'
require 'bundler/rubygems_ext'
require 'bundler/rubygems_integration'
require 'bundler/version'
Expand Down
6 changes: 4 additions & 2 deletions lib/bundler/settings.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ def set_key(key, value, hash, file)
hash[key] = value
hash.delete(key) if value.nil?
FileUtils.mkdir_p(file.dirname)
require 'bundler/psyched_yaml'
File.open(file, "w") { |f| f.puts hash.to_yaml }
end
value
Expand All @@ -127,9 +128,10 @@ def local_config_file

def load_config(config_file)
if config_file.exist? && !config_file.size.zero?
yaml = YAML.load_file(config_file)
Hash[config_file.read.scan(/^(BUNDLE_.+): '?(.+?)'?$/)]
else
{}
end
yaml || {}
end

end
Expand Down

0 comments on commit 156d688

Please sign in to comment.