Module: RConfig

Extended by:
ActiveSupport::Concern, Callbacks, Cascade, Constants, CoreMethods, Exceptions, LoadPaths, Reload, Settings, Utils
Defined in:
lib/rconfig/config.rb,
lib/rconfig.rb,
lib/rconfig/utils.rb,
lib/rconfig/logger.rb,
lib/rconfig/reload.rb,
lib/rconfig/cascade.rb,
lib/rconfig/settings.rb,
lib/rconfig/callbacks.rb,
lib/rconfig/constants.rb,
lib/rconfig/exceptions.rb,
lib/rconfig/load_paths.rb,
lib/rconfig/core_methods.rb,
lib/rconfig/properties_file.rb,
lib/generators/rconfig/install_generator.rb

Overview

Copyright © 2009 Rahmal Conda <[email protected]>

This class parses key/value based properties files used for configuration. It is used by rconfig to import configuration files of the aforementioned format. Unlike yaml, and xml files it can only support three levels. First, it can have root level properties:

server_url=host.domain.com
server_port=8080

Secondly, it can have properties grouped into catagories. The group names must be specified within brackets like [ … ]

[server]
url=host.domain.com
port=8080

Finally, groups can also be qualified with namespaces, similar to git config files. Group names are same as before, but with namespace in within the brackets like [ <group> “<name>” ]

[host "dev"]
domain=dev.server.com

[host "prod"]
domain=www.server.com

These can be retrieved using dot-notation or variable to do it dynamically.

RConfig.props.host.dev.domain
          - or -
RConfig.props.host[env].domain  (where env is 'dev' or 'prod')

Defined Under Namespace

Modules: Callbacks, Cascade, Constants, CoreMethods, Exceptions, Generators, LoadPaths, Reload, Settings, Utils Classes: Config, ConfigError, DisabledLogger, InvalidLoadPathError, Logger, PropertiesFile

Constant Summary collapse

VERSION =
'0.5.4'

Constants included from Constants

Constants::CNF_FILE_TYPES, Constants::CONFIG_FILE_TYPES, Constants::CONFIG_ROOT, Constants::EMPTY_ARRAY, Constants::ENV_TIER, Constants::HOSTNAME, Constants::HOSTNAME_SHORT, Constants::SUFFIXES, Constants::XML_FILE_TYPES, Constants::YML_FILE_TYPES

Method Summary

Methods included from Utils

app_root, create_dottable_hash, default_load_paths, filename_for_name, flush_cache, log_level, log_level=, make_indifferent, merge_hashes, parse, parse_xml, rails?, read, setting, setup

Methods included from Exceptions

raise_load_path_error, raise_logger_error

Methods included from LoadPaths

add_load_path, load_paths_set?, parse_load_paths, set_load_paths

Methods included from Cascade

overlay=, suffixes_for

Methods included from Callbacks

fire_on_load, on_load

Methods included from Reload

auto_check?, enable_reload=, reload, reload?, reload_disabled?, reload_interval=, without_reload

Methods included from CoreMethods

[], check_for_changes, config_changed?, config_files, config_for, get_config_data, get_config_files, load_config_files, method_missing, reload_on_change, with_file