diff options
Diffstat (limited to 'lib/bundler/yaml_serializer.rb')
-rw-r--r-- | lib/bundler/yaml_serializer.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/yaml_serializer.rb b/lib/bundler/yaml_serializer.rb index 3c9eccafc2..0fd81c40ef 100644 --- a/lib/bundler/yaml_serializer.rb +++ b/lib/bundler/yaml_serializer.rb @@ -37,7 +37,7 @@ module Bundler HASH_REGEX = / ^ ([ ]*) # indentations - (.*) # key + (.+) # key (?::(?=(?:\s|$))) # : (without the lookahead the #key includes this when : is present in value) [ ]? (?: !\s)? # optional exclamation mark found with ruby 1.9.3 @@ -54,10 +54,10 @@ module Bundler last_empty_key = nil str.split(/\r?\n/).each do |line| if match = HASH_REGEX.match(line) - indent, key, _, val = match.captures + indent, key, quote, val = match.captures key = convert_to_backward_compatible_key(key) depth = indent.scan(/ /).length - if val.empty? + if quote.empty? && val.empty? new_hash = {} stack[depth][key] = new_hash stack[depth + 1] = new_hash |