test for a configuration

This commit is contained in:
Ward Wouts 2003-04-24 09:41:17 +00:00
parent e1f96c4ac2
commit bbdd152991

View file

@ -1,6 +1,6 @@
#!/usr/local/bin/ruby -w
# $Dwarf: ripnews.rb,v 1.49 2003/04/20 21:09:00 ward Exp $
# $Dwarf: ripnews.rb,v 1.50 2003/04/22 21:30:06 ward Exp $
# $Source$
require 'date'
@ -116,8 +116,12 @@ def usage
end
def parse_config(default = {})
if FileTest.readable?("#{default[\"-c\"]}")
file = File.new("#{default[\"-c\"]}")
lines = file.readlines
else
lines = []
end
i = 0
group = ""
@ -207,6 +211,10 @@ def parse_config(default = {})
end
def check_config
if @config.length == 0
print "No configuration, nothing to do\n"
exit
end
@config.each_key {|i|
unless @config[i].has_key?("-I")
print "No inclusions given for group #{i}. Won't match anything.\n"