Skip to content

Is it possible to share a single app.yml with nested config for different classes? #113

@jhirn

Description

@jhirn

Hello. I am in the process of converting my project to use anyway config and really liking the gem so far. I have one question which may be possible with the gem as-is, but can't seem to get it to work.

Essentially, I'd like to avoid having one yml file per class so all actual settings are in one place. So given the following,

class AppConfig < Anyway::Config
end

class RedisConfig < AppConfig
   attr_config :url
   required :url
end

class  DomainConfig < AppConfig
   attr_config :admin_portal
   required :admin_portal
end

I'd like to have a single app.yml that looks like this

development:
  domain:
    admin_portal:  development.example.com
  redis:
    url: localhost:6379

test:
  domain:
    admin_portal:  test.example.com
  redis:
    url: localhost:6379

Rather than individual domain.yml and redis.yml files. I've been playing around with config_name and some other paths but stumped so figured I'd ask before going too far down a rabbit hole or giving up.

Thanks!

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions