Giter VIP home page Giter VIP logo

grails-merge-config's People

Contributors

caseyscarborough avatar

Watchers

 avatar  avatar  avatar

Forkers

herwix

grails-merge-config's Issues

Add support for more types

Currently only the types String, Integer, Double, and Boolean can be overridden. It would be nice to have more types be available such as a Map or List.

Issue with the way the application configuration is merged

When putting your configuration in the Config.groovy file, you have two options:

Option 1:

some {
  application {
    config = "3"
  }
}

Option 2:

some.application.config = "foo"

Both of these allow you to do the following to retrieve the configuration value:

grailsApplication.config.some.application.config
grailsApplication.config."some.application.config"

If you add (override) the key to the application config like so:

grailsApplication.config.add("some.application.config", "bar")

Then retrieving the configuration without quotes will give you the original value, while retrieving it with quotes will give you the new value:

grailsApplication.config.some.application.config   // => "foo"
grailsApplication.config."some.application.config" // => "bar"

It would be nice if there was a way to override the non-quoted way, without having to generate a map and add the map. I've implemented this, but it introduces even more strange issues.

For now the only option is to only retrieve configuration values using one of the following formats:

grailsApplication.config."some.application.config"
grailsApplication.config.get("some.application.config")

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.