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

Commit

Permalink
Revert "work around Ruby bug empty files in YAML.load_file"
Browse files Browse the repository at this point in the history
This reverts commit 4e855b9.
  • Loading branch information
hone committed May 25, 2012
1 parent 94fc748 commit 4449672
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions lib/bundler/settings.rb
Expand Up @@ -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)
Expand Down Expand Up @@ -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.