class Utils::Config::ConfigFile
def discover(&block)
def discover(&block) if block @discover = Discover.new(&block) end @discover ||= Discover.new end
def initialize
def initialize end
def parse(source)
def parse(source) interpret_with_binding source, binding self end
def parse_config_file(config_file_name)
def parse_config_file(config_file_name) File.open(config_file_name) do |cf| parse cf.read end self rescue SystemCallError => e $DEBUG and warn "Couldn't read config file "\ "#{config_file_name.inspect}: #{e.class} #{e}" return nil end
def probe(&block)
def probe(&block) if block @probe = Probe.new(&block) end @probe ||= Probe.new end
def search(&block)
def search(&block) if block @search = Search.new(&block) end @search ||= Search.new end
def strip_spaces(&block)
def strip_spaces(&block) if block @strip_spaces = StripSpaces.new(&block) end @strip_spaces ||= StripSpaces.new end
def to_ruby
def to_ruby result = "# vim: set ft=ruby:\n" for bc in %w[search discover strip_spaces probe] result << "\n" << __send__(bc).to_ruby end result end