Conversation
…onfiguration YAML - Only works in the context of rails - It takes precedence over the default `config/application.yml` - Add README and include other examples of how you can customise your file path
|
Not sure why this caused the travis build to 🔴 fail for rails 3.2 on ruby 1.9.3 since it's not even related code. Is this a bug caused by something else? |
|
Restarting that particular job. Recently, the suite has been experiencing some intermittent failures and I haven't had the chance to get to the bottom of it yet. 😢 🐼 |
|
@laserlemon Ah, cool, looks like they all pass now! Wohoo! |
|
I have a few suggestions and concerns. First, let's call the variable Next, I think this feature would be more useful if the user could specify any path on the server, not just a path within |
|
@laserlemon I like the idea of As for your concern. Joining an absolute path with As for my rationale. I ran in to issues and came up with this feature trying to support defaults for different environments on different platforms in development. For OS X defaults I would like something like this: # config/application.osx+brew.yml
development: &defaults
database_url: postgres://app@localhost:5432/dev?template=template0&pool=5&encoding=unicode
redis_url: redis://localhost:6379/0
test:
<<: *defaults
database_url: postgres://app@localhost:5432/test?template=template0&pool=5&encoding=unicode
redis_url: redis://localhost:6379/0While something like # config/application.fig+docker.yml
development: &defaults
database_url: postgres://app@postgres:5432/dev?template=template0&pool=5&encoding=unicode
redis_url: redis://redis:6379/0
test:
<<: *defaults
database_url: postgres://app@postgres:5432/test?template=template0&pool=5&encoding=unicode
redis_url: redis://redis:6379/0 |
|
@laserlemon Does this replace #78 or do you want to take another direction altogether? |
|
@laserlemon What are your thoughts? |
|
This patch looks familiar |
|
@jbussdieker Haha, yeah sorry. I didn't realise until long after submitting this pull request. Kind of jumped the gun. |
|
@laserlemon Any thoughts on whether this (or #78) is likely to get merged? |
|
+1 This fix is exactly what I was looking for, could someone please merge ??? |
|
@carltonbrown Unfortunately Figaro seems to have been unmaintained for several years. Personally I've found https://github.com/bkeepers/dotenv works well as a replacement. |
Possibly solves or replaces #78
Say your deployment process require you to have your configuration at a certain file path or that you want to provide defaults for different platforms in development.
You can achieve this by using an environment variable to tell Figaro where to look for your yaml file.
If you're not using rails or if you want to determine the file path by other means, set the
Figaro.adapter.pathto your desired value.Now you can get your environment variables using environment variables