class Fluoride::Analyzer::Config

Constants

DEFAULT_CONFIG_PATH
DEFAULT_EXCLUDE_MIME_TYPES
DEFAULT_EXCLUDE_PATHS

Attributes

exclude_match_params[RW]
exclude_mime_types[RW]
exclude_path_patterns[RW]
limit_count[RW]
match_on_required_params[RW]

Public Class Methods

load(config_path = DEFAULT_CONFIG_PATH) click to toggle source
# File lib/fluoride-analyzer/config.rb, line 16
def self.load(config_path = DEFAULT_CONFIG_PATH)
  yaml_config = YAML::load(File.open(config_path))
  config = self.new(yaml_config)
end
new(yaml_config) click to toggle source
# File lib/fluoride-analyzer/config.rb, line 21
def initialize(yaml_config)
  self.exclude_path_patterns = DEFAULT_EXCLUDE_PATHS
                               + yaml_config['exclude_path_patterns']
                               - yaml_config['include_path_patterns']

  self.exclude_mime_types    = DEFAULT_EXCLUDE_MIME_TYPES
                               + yaml_config['exclude_mime_types']
                               - yaml_config['include_mime_types']


  if yaml_config.has_key?('match_on_required_params')
    self.match_on_required_params = yaml_config['match_on_required_params']
  else
    self.match_on_required_params = false
  end

  self.exclude_match_params = yaml_config['exclude_match_params'] || []
  self.include_match_params = yaml_config['include_match_params'] || []
  self.limit_count          = yaml_config['limit_count']
end