Giter VIP home page Giter VIP logo

app_constants's People

Contributors

damncabbage avatar theleoborges avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

app_constants's Issues

Provide a way to check missing environment and keys via rake task

Wouldn't it be good if there was a rake task to verify that all keys are present before starting the app server or before/during deployment?

We did this at the big webhosting client around 3+ years ago. Please ping me at vraravam -at- thoughtworks -dot- com in case you are interested. I can help implement this. (I did the exact same functionality along with that rake task there - but it could not be open sourced).

app_constants.rb does not override respond_to? or self.respond_to?

Greetings! Thanks for your work on this project. I have had some trouble integrating app_constants with other libraries because the ghost method technique is not reinforced through the use of the respond_to? methods. When integrating with libraries that choose to reflect on the methods defined in AppConstants, it will claim the class doesn't not define any of the methods set dynamically in the configurations.yml file.

My question is as following. According to your ghost method implementation in #method_missing and self.method_missing, it would appear that #respond_to? and self.respond_to? should always return true. This specifically boils down to the #method_missing instance method.

lines 35.36

    if constants_hash[method.to_s].nil?
      ""

I will submit a patch for this if it is desired behavior. Otherwise, we could decide to get more specific and only respond true for configuration methods that do exist. My current implementation is as following:

  def self.respond_to?(method)
    @@instance.constants_hash[method.to_s].present?
  end

  def respond_to?(method)
    constants_hash[method.to_s].present?
  end

.. However your ghost method implementation is more permissive. Any thoughts on this? Thanks again for your work.

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.