some fixes for ruby 1.8.1

This commit is contained in:
Ward Wouts 2004-06-16 08:17:48 +00:00
parent 233fc507d8
commit 63d8c22721
7 changed files with 24 additions and 23 deletions

View file

@ -1,6 +1,6 @@
#!/usr/local/bin/ruby -w
# $Dwarf: ripnews.rb,v 1.79 2004/03/03 21:18:50 ward Exp $
# $Dwarf: ripnews.rb,v 1.80 2004/05/19 09:25:40 ward Exp $
# $Source$
#
@ -63,7 +63,7 @@ def save_file(dir, name, data)
rescue Errno::ENOENT
print "Caught Errno::ENOENT (save_file)\n"
print "Error: #{$!}\n"
print "What the #@$$ happended?\n"
print "What the *beep* happened?\n"
return false
end
when "Array"
@ -85,7 +85,7 @@ def save_file(dir, name, data)
rescue Errno::ENOENT
print "Caught Errno::ENOENT (save_file)\n"
print "Error: #{$!}\n"
print "What the #@$$ happended?\n"
print "What the *beep* happened?\n"
return false
end
else
@ -136,9 +136,9 @@ end
def parse_config(default = {})
print "Parsing config\n"
print "#{default[\"-c\"]}\n"
if FileTest.readable?("#{default[\"-c\"]}")
file = File.new("#{default[\"-c\"]}")
print "#{default['-c']}\n"
if FileTest.readable?("#{default['-c']}")
file = File.new("#{default['-c']}")
lines = file.readlines
else
lines = []
@ -466,7 +466,7 @@ def get_max_file_length(tempdir=".")
name = "a"*500
name = "#$$#{name}"
begin
file = File.new("#{tempdir}/#{name}", "w", "0644").close
file = File.new("#{tempdir}/#{name}", "w", 0644).close
File.delete("#{tempdir}/#{name}")
rescue Errno::ENAMETOOLONG
name = name[0...-1]