Coder Social home page Coder Social logo

Keys with hyphens about configru HOT 11 CLOSED

programble avatar programble commented on August 17, 2024
Keys with hyphens

from configru.

Comments (11)

causal-agent avatar causal-agent commented on August 17, 2024

I believe this should already work. Also, as an interesting side-effect, that should then be accessible from Configru['as-df'] and Configru[:as-df].

from configru.

duckinator avatar duckinator commented on August 17, 2024

Configru[:'as-df'], you mean

from configru.

causal-agent avatar causal-agent commented on August 17, 2024

I keep forgetting this isn't a Lisp. Where would :as - df ever make sense, anyway?

from configru.

causal-agent avatar causal-agent commented on August 17, 2024

How bad would it be if Configru replaced _ with - behind the scenes? For example, the configuration file would have foo-bar: baz, and foo_bar would be used in the load DSL for it and the value could be accessed using Configru.foo_bar. Would this be much of a problem, do you think?

from configru.

duckinator avatar duckinator commented on August 17, 2024

I don't think this would be a problem, personally. May want to ask around a bit, though.

EDIT: Screw that, do it. Change back people complain and you feel it's worth changing. :P

from configru.

causal-agent avatar causal-agent commented on August 17, 2024

I can't ask around, you are my only user!

I'll make it replace _ with - and push out 0.0.2 unless you have any other feature requests I should add as well.

from configru.

duckinator avatar duckinator commented on August 17, 2024

if you have:

foo-bar

you should have:

Configru.foo_bar

and

Configru['foo-bar']

from configru.

causal-agent avatar causal-agent commented on August 17, 2024

Both of those work, along with Configru['foo_bar'] and Configru[:foo_bar].

from configru.

duckinator avatar duckinator commented on August 17, 2024

Sounds good!
So then your only limitation is not having foo_bar AND foo-bar

from configru.

causal-agent avatar causal-agent commented on August 17, 2024

If you use underscores in YAML, you should be murdered.

from configru.

duckinator avatar duckinator commented on August 17, 2024

True

from configru.

Related Issues (3)

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.