mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
parent
1c81d1a69d
commit
3222c67262
3 changed files with 6 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue