app_config icon indicating copy to clipboard operation
app_config copied to clipboard

Nested YAML

Open rurounijones opened this issue 14 years ago • 2 comments

I would love to be able to do something like

development:
  ftp:
    server:
    port:

and then be able to access it like Conf.ftp.server

would make things a lot cleaner and allow groupings of settings.

rurounijones avatar Dec 03 '10 06:12 rurounijones

Did you try doing that? That is one of the primary functions of this plugin. See the README file on the github project page.

If it doesn't work, something is seriously messed up.

cjbottaro avatar Dec 03 '10 06:12 cjbottaro

The last time I tried it it exploded badly, I have given it another go. I am using Rails 2.3.5 and Ruby 1.8.7

If I try do to something like

common:
  ftp:
    ip:
    port:
    username:
    password:

And access it with Conf.ftp.username then I get the error (Working from memory here, sorry) that username is not a valid method for ftp (Class Hash).

When I go into the debugger if I look at Conf.ftp it appears to be a hash. If I then do Conf.ftp['username'] then it works fine but naturally the syntax is rather ugly

rurounijones avatar Dec 10 '10 00:12 rurounijones