[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 = /
|
HASH_REGEX = /
|
||||||
^
|
^
|
||||||
([ ]*) # indentations
|
([ ]*) # indentations
|
||||||
(.+) # key
|
([^#]+) # key excludes comment char '#'
|
||||||
(?::(?=(?:\s|$))) # : (without the lookahead the #key includes this when : is present in value)
|
(?::(?=(?:\s|$))) # : (without the lookahead the #key includes this when : is present in value)
|
||||||
[ ]?
|
[ ]?
|
||||||
(['"]?) # optional opening quote
|
(['"]?) # optional opening quote
|
||||||
|
@ -41,7 +41,7 @@ module Gem
|
|||||||
HASH_REGEX = /
|
HASH_REGEX = /
|
||||||
^
|
^
|
||||||
([ ]*) # indentations
|
([ ]*) # indentations
|
||||||
(.+) # key
|
([^#]+) # key excludes comment char '#'
|
||||||
(?::(?=(?:\s|$))) # : (without the lookahead the #key includes this when : is present in value)
|
(?::(?=(?:\s|$))) # : (without the lookahead the #key includes this when : is present in value)
|
||||||
[ ]?
|
[ ]?
|
||||||
(['"]?) # optional opening quote
|
(['"]?) # optional opening quote
|
||||||
|
@ -569,10 +569,14 @@ if you believe they were disclosed to a third party.
|
|||||||
yaml = <<~YAML
|
yaml = <<~YAML
|
||||||
---
|
---
|
||||||
:foo: bar # buzz
|
:foo: bar # buzz
|
||||||
|
#:notkey: bar
|
||||||
YAML
|
YAML
|
||||||
|
|
||||||
actual = Gem::ConfigFile.load_with_rubygems_config_hash(yaml)
|
actual = Gem::ConfigFile.load_with_rubygems_config_hash(yaml)
|
||||||
assert_equal("bar", actual[:foo])
|
assert_equal("bar", actual[:foo])
|
||||||
|
assert_equal(false, actual.key?("#:notkey"))
|
||||||
|
assert_equal(false, actual.key?(:notkey))
|
||||||
|
assert_equal(1, actual.size)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_s3_source
|
def test_s3_source
|
||||||
|
Loading…
x
Reference in New Issue
Block a user