Giter VIP home page Giter VIP logo

Comments (3)

pkuczynski avatar pkuczynski commented on June 10, 2024

@cjlarose wdyt?

from config.

Fryguy avatar Fryguy commented on June 10, 2024

We also use engines in ManageIQ, but our use case is a little different. Basically we use Rails engines as a plugin system, and one of the pluggable things is the config settings. These engines can bring their own settings.yml and we will add those to the set of YAML Sources.

To do this we built an initializer that essentially loads config from all of our engines and the main app, all in the expected override order, then replaces the Settings constant. You can see the code here and follow along: https://github.com/ManageIQ/manageiq/blob/0a1c16529c96eb5367ed311e08fcd881f94cc818/lib/vmdb/settings.rb#L30, but tl;dr we loop through all of the engines in our application and add YAML Sources for each of them.

Ideally, config should more or less just work with engines and ManageIQ shouldn't have to have a custom initializer. I'm not sure if they should automatically work with engines by detecting settings.yml files, or if it makes sense to have a Config parameter where you opt in to which engines you want to honor settings from.

The other question is which way does priority work? If a key appears in the main application's settings and an engine's settings, which one wins? In ManageIQ our priority is that engines override the main application, but I'm not sure that same decision applies outside of our specific application or not.

from config.

alienxp03 avatar alienxp03 commented on June 10, 2024

Ideally, config should more or less just work with engines and ManageIQ shouldn't have to have a custom initializer

Agree with this part. At the moment I can customize the code on my engine to make it work. Not a big issue. But would be nice if it could just work with Rails engine, since from the engine's perspective, it's just another gem.

At the moment I'm not sure either on the solution, or the gem's direction with Rails engine. Just opened an issue here in case others might face the same issues that I have.

from config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.