veracross / consult

Configuration and secrets management for Rails
MIT License
12 stars 0 forks source link

Consult not basing templates folder search in config #2

Closed aharpervc closed 6 years ago

aharpervc commented 6 years ago

The readme's example consult.yml says:

    # Relative paths are assumed to be in #{Rails.root}/config.
    # Path to the template
    path: templates/database.yml.erb

However, when I set up {root}\config\templates\database.yml.erb and started my rails app, I got this exception:

$ bundle exec rails s
Error rendering template: database
c:/bin/ruby/243/lib/ruby/gems/2.4.0/gems/consult-0.5.0/lib/consult/template.rb:18:in `read': No such file or directory @ rb_sysopen - C:/Users/aharper/workspace/consult-rails-test/crt-app/templates/database.yml.erb (Errno::ENOENT)

Note that it's not looking in /config, it's looking in the app root folder. This is confirmed by moving the templates directory to the app root and starting the app... this exception does not occur.

aharpervc commented 6 years ago

This is also true for rendered files. dest: database.yml will write that file to the app root, not to config/database.yml

sixfeetover commented 6 years ago

Thanks, that's a typo. The docs should just say Rails.root.