class ASF::Config

Support for local (development) configuration overrides to be stored in .whimsy files in YAML format. Allows the specification of where subversion, git, and other files are stored, where updated files are cached, mailing list configuration, and other values.

Any .whimsy file in your home directory is processed first.

Additionally, a search is made for .whimsy files in the current working directory and then working up the directory path and finally in /srv. If such a .whimsy file is found, it will be processed for overrides to the configuration.

The configuration value of :root:, if provided, will establish the default root directory for a number of files/directories (among them, svn, git, and subscriptions). If the value is '.' and the parent directory for this file contains a `whimsy` subdirectory, then the parent directory will be considered the root.

Public Class Methods

[](value) click to toggle source

Look up a configuration value by name (generally a symbol, like :svn). Allows test overrides

# File lib/whimsy/asf/config.rb, line 111
def self.[](value)
  @testdata[value] || @config[value]
end
[]=(name, path) click to toggle source

Set a local directory corresponding to a path Useful as a test data override.

# File lib/whimsy/asf/config.rb, line 117
def self.[]=(name, path)
  @testdata[name] = File.expand_path(path)
end
get(value) click to toggle source

Look up a configuration value by name (generally a symbol, like :svn).

# File lib/whimsy/asf/config.rb, line 105
def self.get(value)
  @config[value]
end
root() click to toggle source
# File lib/whimsy/asf/config.rb, line 121
def self.root
  @root
end
setroot(path) click to toggle source

For testing only!!

# File lib/whimsy/asf/config.rb, line 126
def self.setroot(path)
  @root = path
end
setsvnroot(path) click to toggle source

Testing only: override svn config path must end in /*

# File lib/whimsy/asf/config.rb, line 132
def self.setsvnroot(path)
  raise RuntimeError "Invalid path: #{path}" unless path.end_with? '/*'

  @config[:svn] = path
end