Entries Tagged 'News' ↓

Configatron 1.2.0 Released

Thanks to Simon Menke for contributing a great patch to Configatron that will automatically ‘namespace’ your configuration settings if you use the configure_from_hash or the configure_from_yaml methods.


Both give you the same results:

If you get a chance visit Simon’s blog at: http://5xm.org/ and say hi. Thanks again Simon.

Mack 0.7.0 featured on this week’s RailsEnvy podcast

The release of Mack 0.7.0 was featured as the lead story this week in the railsenvy.com podcast. They guys had great things to say about Mack, have a listen:

http://www.railsenvy.com/2008/9/3/rails-envy-podcast-episode-045-09-03-2008

As always, if you don’t subscribe to the podcast, you definitely should. It’s one of the best ones around.

Configatron 1.1.0 Released

On the heels of last week’s successful release of Configatron 1.0.0 comes version 1.1.0. The big addition, feature wise, to 1.1.0 is the ability to now load configurations from a YAML file.

configatron.configure_from_yaml('/path/to/file.yml')

When reload is called on configatron any YAML files will be read back in from disk, allowing you to change your configurations and reload them.

Enjoy!

Mack Sake Tasks

Thanks to Mack user, DeLynn Berry, for writing up some great Sake tasks! Now getting up and running with Mack development is even easier. Thanks DeLynn!

All you need to do is install Sake.

Once Sake is installed you can install the Mack sake tasks like so:

sake -i http://www.mackframework.com/mack-dev.sake

You can see a full list of tasks with the following command:

sake -T

Configatron 1.0.0 Released!

Configatron makes configuring your applications and scripts incredibly easy. No longer is a there a need to use constants or global variables. Now you can use a simple and painless system to configure your life. And, because it’s all Ruby, you can do any crazy thing you would like to! API

Note: Configatron is a general purpose library, that can be used in ANY Ruby application or script, it’s not Mack specific. So go on and configure to your hearts content. :)

$ sudo gem install configatron

Examples

Simple

Now, anywhere in your code you can do the following:

Viola! Simple as can be.

Now you’re saying, what if I want to have a ‘default’ set of options, but then override them later, based on other information? Simple again. Let’s use our above example. We’ve configured our ‘database_url’ option to be “postgres://localhost/mack_framework_rocks”. The problem with that is that is our production database url, not our development url. Fair enough, all you have to do is redeclare it:

becomes:

Notice how our other configuration parameters haven’t changed? Cool, eh?

Namespaces

The question that should be on your lips is what I need to have namespaced configuration parameters. It’s easy! Configatron allows you to create namespaces.

becomes:

Configatron allows you to nest namespaces to your hearts content! Just keep going, it’s that easy.

Enjoy!