Class | Picnic::Conf |
In: |
lib/picnic/conf.rb
|
Parent: | Object |
Provides an interface for accessing your Picnic app‘s configuration file.
Usage example:
# Load the configuration from /etc/foo/config.yml Conf.load('foo') # The contents of config.yml is now available as follows: puts Conf[:server] puts Conf[:authentication][:username] # ... etc.
Copies the example config file into the appropriate configuration directory.
app_name: | The name of your application. For example: foo |
app_root: | The path to your application‘s root directory. For example: /srv/www/camping/foo/ |
+dest_conf_file: | The path where the example conf file should be copied to. For example: /etc/foo/config.yml |
Returns the path to your application‘s example config file.
The example config file should be in the root directory of your application‘s distribution package and should be called config.example.yml. This file is used as a template for your app‘s configuration, to be customized by the end user.
Loads the configuration from the YAML file for the given app.
app_name should be the name of your app; for example: foo
app_root should be the path to your application‘s root directory; for example: | /srv/www/camping/foo/ |
By default, the configuration will be loaded from /etc/<app_name>/config.yml.