add require for yenc
some tabbing inserted
This commit is contained in:
parent
0b1249b372
commit
d7c079a7bb
1 changed files with 11 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/local/bin/ruby -w
|
||||
|
||||
# $Dwarf: ripnews.rb,v 1.46 2003/04/20 16:34:40 ward Exp $
|
||||
# $Dwarf: ripnews.rb,v 1.47 2003/04/20 18:39:13 ward Exp $
|
||||
# $Source$
|
||||
|
||||
require 'date'
|
||||
|
|
@ -9,6 +9,7 @@ require 'news/article'
|
|||
require 'news/newsrc'
|
||||
require 'tempfile'
|
||||
require 'encode/uuencode'
|
||||
require 'encode/yenc'
|
||||
|
||||
|
||||
###########################################################################
|
||||
|
|
@ -227,6 +228,7 @@ def get_single(subj, group)
|
|||
body = @articles.get_group_body(subj)
|
||||
if UUEncode.is_uuencoded(body)
|
||||
filename = UUEncode.get_filename(body)
|
||||
print " filename #{filename}\n"
|
||||
return false unless check_ext(group, filename, "s")
|
||||
print " UUDecoding...\n"
|
||||
mode, filename, body = UUEncode.uudecode(body)
|
||||
|
|
@ -248,11 +250,14 @@ def get_multi(subj, group)
|
|||
body = @articles.get_group_body(subj)
|
||||
if UUEncode.is_uuencoded(body)
|
||||
filename = UUEncode.get_filename(body)
|
||||
print " filename #{filename}\n"
|
||||
return false unless check_ext(group, filename, "m")
|
||||
print " UUDecoding...\n"
|
||||
mode, filename, body = UUEncode.uudecode(body)
|
||||
elsif YEnc.is_yencoded(body)
|
||||
print "yencc\n"
|
||||
filename = YEnc.get_filename(body)
|
||||
print "filename #{filename}\n"
|
||||
return false unless check_ext(group, filename, "m")
|
||||
print " YDecoding...\n"
|
||||
mode, filename, body = YEnc.ydecode(body)
|
||||
|
|
@ -266,9 +271,12 @@ def get_multi(subj, group)
|
|||
if UUEncode.is_uuencoded(body) or YEnc.is_yencoded(body)
|
||||
if UUEncode.is_uuencoded(body)
|
||||
filename = UUEncode.get_filename(body)
|
||||
print " filename #{filename}\n"
|
||||
return false unless check_ext(group, filename, "m")
|
||||
elsif YEnc.is_yencoded(body)
|
||||
print "yencc\n"
|
||||
filename = YEnc.get_filename(body)
|
||||
print "filename #{filename}\n"
|
||||
return false unless check_ext(group, filename, "m")
|
||||
end
|
||||
file = Tempfile.new("riptmp", @config[group]["TEMPDIR"])
|
||||
|
|
@ -405,13 +413,13 @@ for group in @config.keys.sort
|
|||
mode, filename, body = get_multi(i, group)
|
||||
end
|
||||
if mode == false
|
||||
print "Skipping article...\n"
|
||||
print " Skipping article...\n"
|
||||
else
|
||||
output_data(i, mode, filename, body)
|
||||
end
|
||||
rescue Article::TempError, Article::PermError
|
||||
print "#{$!}\n"
|
||||
print "Skipping article...\n"
|
||||
print " Skipping article...\n"
|
||||
next
|
||||
end
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue