Browse files

Revert "work around Ruby bug empty files in YAML.load_file"

This reverts commit 4e855b9.
  • Loading branch information...
1 parent 94fc748 commit 44496724bc3d91967fda51120dbd0fff80511218 @hone hone committed May 25, 2012
Showing with 2 additions and 10 deletions.
  1. +2 −10 lib/bundler/settings.rb
View
12 lib/bundler/settings.rb
@@ -2,8 +2,8 @@ module Bundler
class Settings
def initialize(root)
@root = root
- @local_config = load_config(local_config_file)
- @global_config = load_config(global_config_file)
+ @local_config = (File.exist?(local_config_file) && yaml = YAML.load_file(local_config_file)) ? yaml : {}
+ @global_config = (File.exist?(global_config_file) && yaml = YAML.load_file(global_config_file)) ? yaml : {}
end
def [](key)
@@ -124,13 +124,5 @@ def global_config_file
def local_config_file
Pathname.new("#{@root}/config")
end
-
- def load_config(config_file)
- if config_file.exist? && !config_file.size.zero?
- yaml = YAML.load_file(config_file)
- end
- yaml || {}
- end
-
end
end

0 comments on commit 4449672

Please sign in to comment.