test for a configuration
This commit is contained in:
parent
e1f96c4ac2
commit
bbdd152991
1 changed files with 11 additions and 3 deletions
|
|
@ -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 = {})
|
||||
file = File.new("#{default[\"-c\"]}")
|
||||
lines = file.readlines
|
||||
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"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue