lib/configurable/utils.rb in configurable-0.6.0 vs lib/configurable/utils.rb in configurable-0.7.0
- old
+ new
@@ -130,10 +130,10 @@
# Loads the file contents as YAML. If recurse is true, a hash will be
# recursively loaded. A block may be provided to set recursively loaded
# values in the hash loaded from the path.
def load_file(path, recurse=false, &block)
return load_file(path, recurse, &DEFAULT_LOAD) if recurse && !block_given?
- base = File.file?(path) ? (YAML.load_file(path) || {}) : {}
+ base = File.directory?(path) ? {} : (YAML.load_file(path) || {})
if recurse
# determine the files/dirs to load recursively
# and add them to paths by key (ie the base
# name of the path, minus any extname)
\ No newline at end of file