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 ### 8.11.32.120: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 8.11.32.120:8000 the key. Any idea how to do this? (It''s in the gmaps_api_key.yml file if you care) Thanks! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Not sure if this will work, but isn''t YAML processed by ERB? Could you use something like: <%= "8.11.32.120:8000" %>: GoogleMapsKeyforThisDomain --Mel On 10/8/07, Dustin Anderson <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > 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 ### > 8.11.32.120: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 8.11.32.120:8000 the key. Any idea how to do > this? (It''s in the gmaps_api_key.yml file if you care) > > Thanks! > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Mel Riffe wrote:> <%= "8.11.32.120:8000" %>: GoogleMapsKeyforThisDomainThanks 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... -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 youDouble-quoted keys should work too. See section 4.5.1.1 of the YAML spec. Best. Marnen Laibow-Koser marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit https://groups.google.com/groups/opt_out.