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
|
#!/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$
|
# $Source$
|
||||||
|
|
||||||
require 'date'
|
require 'date'
|
||||||
|
|
@ -116,8 +116,12 @@ def usage
|
||||||
end
|
end
|
||||||
|
|
||||||
def parse_config(default = {})
|
def parse_config(default = {})
|
||||||
|
if FileTest.readable?("#{default[\"-c\"]}")
|
||||||
file = File.new("#{default[\"-c\"]}")
|
file = File.new("#{default[\"-c\"]}")
|
||||||
lines = file.readlines
|
lines = file.readlines
|
||||||
|
else
|
||||||
|
lines = []
|
||||||
|
end
|
||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
group = ""
|
group = ""
|
||||||
|
|
@ -207,6 +211,10 @@ def parse_config(default = {})
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_config
|
def check_config
|
||||||
|
if @config.length == 0
|
||||||
|
print "No configuration, nothing to do\n"
|
||||||
|
exit
|
||||||
|
end
|
||||||
@config.each_key {|i|
|
@config.each_key {|i|
|
||||||
unless @config[i].has_key?("-I")
|
unless @config[i].has_key?("-I")
|
||||||
print "No inclusions given for group #{i}. Won't match anything.\n"
|
print "No inclusions given for group #{i}. Won't match anything.\n"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue