Hello, Does anyone know how to escape colons in YAML? The key in my yml is the domain with port number, but the yml file isn't working with this setup: ###BEGIN production: ### THIS IS THE ONE I'm HAVING TROUBLE WITH ### 126.96.36.199:8000: GoogleMapsKeyforThisDomain exampledomain.com: GoogleMapsAPIKeyforThatDomain development: GoogleMapsAPIKeyforDevelopmentDomain ###END I'm using a google maps plugin called YM4R that uses a .yml file to select the different Google Maps API key depending on where my app is being hosted... So, I'm trying to make 188.8.131.52:8000 the key. Any idea how to do this? (It's in the gmaps_api_key.yml file if you care) Thanks!
on 2007-10-08 21:21
on 2007-10-08 21:43
Not sure if this will work, but isn't YAML processed by ERB? Could you use something like: <%= "184.108.40.206:8000" %>: GoogleMapsKeyforThisDomain --Mel
on 2007-10-08 22:50
Mel Riffe wrote: > <%= "220.127.116.11:8000" %>: GoogleMapsKeyforThisDomain Thanks Mel - that didn't work... but wouldn't that just spit out the same text to YML? I'm wondering if I'm expecting Ym4R to be able to handle multiple domains and it can't... any other ideas? Thanks again...
on 2007-10-09 00:21
Hi, > Does anyone know how to escape colons in YAML? you can double-quote the whole string. I have tried it for quoting values anyway, never keys, so not sure if it will work for you this works for sure key: "a value with : in the middle" regards, javier ramirez
on 2007-10-09 17:54
javier ramirez wrote: > you can double-quote the whole string. I have tried it for quoting > values anyway, never keys, so not sure if it will work for you Double-quoted keys should work too. See section 18.104.22.168 of the YAML spec. Best. Marnen Laibow-Koser email@example.com
on 2013-01-28 15:16
In my perl code I found that a double-qouted string may not contain a colon, but in a single quoted string it works without using any escape. Success.