Class | RHC::Config |
In: |
lib/rhc/config.rb
|
Parent: | Object |
Responsible for encapsulating the loading and retrieval of OpenShift configuration files and converting them to commandline option equivalents. It also provides the converse option - converting a set of commandline options back into a config file.
In general, the values stored in the config should be identical (require little or no type conversion) to their option form. As new global options are added, only this class should have to change to persist that option.
During normal use, a new Config object should load the appropriate settings and those settings should be converted into commandline option defaults.
TODO: Encapsulate config writing to the home location TODO: Allow the config object to initialized with a path TODO: Remove deprecated methods, remove extra sources.
OPTIONS | = | { :server => ['libra_server', nil, 'The default OpenShift server to connect to'], :rhlogin => ['default_rhlogin', nil, 'Your OpenShift login name'], :password => nil, :use_authorization_tokens => [nil, :boolean, 'If true, the server will attempt to create and use authorization tokens to connect to the server'], :timeout => [nil, :integer, 'The default timeout for network operations'], :insecure => [nil, :boolean, "If true, certificate errors will be ignored.\nWARNING: This may allow others to eavesdrop on your communication with OpenShift."], :ssl_version => [nil, nil, 'The SSL protocol version to use when connecting to this server'], :ssl_client_cert_file => [nil, :path_to_file, 'A client certificate file for use with your server'], :ssl_client_key_file => [nil, :path_to_file, 'The corresponding key for the client certificate'], :ssl_ca_file => [nil, :path_to_file, 'A file containing CA one or more certificates'], :always_auth => [nil, :boolean, 'If true, the client will use an authenticated connection for all requests. Useful for certain client certificate configurations.'], } |
Option name [config_key type comment_string_for_config]
if nil, == key nil == string won't be written to file if nil |
authoritive configuration path this is used to determine where config options should be written to when a script modifies the config such as in rhc setup