sif
Sif is a Ruby library that complements Thor by adding external configuration to your Thor applications.
Usage
A common Thor usage pattern is to write a class which extends the Thor class. If you instead extend Sif::Loader, your app will now load a YAML file located at ~/.config, parse it, and add all the data in it as instance variables for your class to do what it will with.
Options
Override the config filename
You can override the default config filename like this
config_file '.my_sif_app'
Additionally, users can point your app at alternative config files
$ app do stuff --config=/path/to/config.file
$ app do stuff -c=/path/to/config.file
Additional config
By overriding the load_configuration method - don't forget to call 'super' - you can do further configuration yourself. For instance, creating a member variable derived from several config options.
Contributing to sif
- Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
- Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
- Fork the project.
- Start a feature/bugfix branch.
- Commit and push until you are happy with your contribution.
- Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
- Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
Copyright
Copyright (c) 2013 George McIntosh. See LICENSE.txt for further details.