[rubygems/rubygems] Fix line comment issue for map
https://github.com/rubygems/rubygems/commit/7ca06e139b
This commit is contained in:
parent
1c81d1a69d
commit
3222c67262
@ -41,7 +41,7 @@ module Bundler
|
||||
HASH_REGEX = /
|
||||
^
|
||||
([ ]*) # indentations
|
||||
(.+) # key
|
||||
([^#]+) # key excludes comment char '#'
|
||||
(?::(?=(?:\s|$))) # : (without the lookahead the #key includes this when : is present in value)
|
||||
[ ]?
|
||||
(['"]?) # optional opening quote
|
||||
|
@ -41,7 +41,7 @@ module Gem
|
||||
HASH_REGEX = /
|
||||
^
|
||||
([ ]*) # indentations
|
||||
(.+) # key
|
||||
([^#]+) # key excludes comment char '#'
|
||||
(?::(?=(?:\s|$))) # : (without the lookahead the #key includes this when : is present in value)
|
||||
[ ]?
|
||||
(['"]?) # optional opening quote
|
||||
|
@ -569,10 +569,14 @@ if you believe they were disclosed to a third party.
|
||||
yaml = <<~YAML
|
||||
---
|
||||
:foo: bar # buzz
|
||||
#:notkey: bar
|
||||
YAML
|
||||
|
||||
actual = Gem::ConfigFile.load_with_rubygems_config_hash(yaml)
|
||||
assert_equal("bar", actual[:foo])
|
||||
assert_equal(false, actual.key?("#:notkey"))
|
||||
assert_equal(false, actual.key?(:notkey))
|
||||
assert_equal(1, actual.size)
|
||||
end
|
||||
|
||||
def test_s3_source
|
||||
|
Loading…
x
Reference in New Issue
Block a user