moj_tribunals_config

<img src=“https://codeclimate.com/github/ministryofjustice/moj_tribunals_config/badges/gpa.svg” /> <img src=“https://codeclimate.com/github/ministryofjustice/moj_tribunals_config/badges/coverage.svg” />

To use:

# add this line to your Gemfile:

gem 'moj_tribunals_config'

# in an initializer, add the following code:

require 'moj_tribunals_config'

my_config = Moj::Tribunals::ConfigLoader.new.load

This will load the default config files from the gem.

To load different files, you can provide an alternative path to the ConfigLoader.new method, e.g.

my_config = Moj::Tribunals::ConfigLoader.new('/my/alternative/config/path').load

To just load config for a specific tribunal, you can do:

config_loader = Moj::Tribunals::ConfigLoader.new
config_file = config_loader.config_file_for('utiac')
config_loader.load_file( config_file )

RailsConfig integration

If you’re using the RailsConfig gem, your intializer can just do something like:

files = Moj::Tribunals::ConfigLoader.new.config_files
files.each{ |f| Settings.add_source!( f ) }
Settings.reload!

Contributing to moj_tribunals_config

  • 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 fieldset unintentionally.

  • Please try not to mess with the Rakefile, fieldset, or history. If you want to have your own fieldset, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

© Crown copyright (Ministry of Justice - Digital Services). See LICENSE.txt for further details.