Mercurial > hgrepos > hgweb.cgi > after5
comparison after5.rb @ 103:734bfd8cbdc6 draft
Quotation preserved in faked from header
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Thu, 08 Oct 2020 11:07:31 +0859 |
parents | d765239327e0 |
children | 02e452079659 |
comparison
equal
deleted
inserted
replaced
102:d765239327e0 | 103:734bfd8cbdc6 |
---|---|
1 #!/usr/local/bin/ruby21 | 1 #!/usr/bin/env ruby21 |
2 # -*- coding: euc-jp -*- | 2 # -*- coding: euc-jp -*- |
3 # | 3 # |
4 # Associative Scheduling Table - after5 | 4 # Associative Scheduling Table - after5 |
5 # (C)2003, 2004, 2006, 2008, 2012-2019 by HIROSE Yuuji [yuuji<at>gentei.org] | 5 # (C)2003, 2004, 2006, 2008, 2012-2020 by HIROSE Yuuji [yuuji<at>gentei.org] |
6 # $Id: after5.rb,v 1.20 2012/12/03 15:54:20 yuuji Exp $ | 6 # $Id: after5.rb,v 1.20 2012/12/03 15:54:20 yuuji Exp $ |
7 # Last modified Wed Aug 21 10:25:19 2019 on firestorm | 7 # Last modified Thu Oct 8 11:06:06 2020 on firestorm |
8 # See http://www.gentei.org/~yuuji/software/after5/ | 8 # See http://www.gentei.org/~yuuji/software/after5/ |
9 # このスクリプトはEUCで保存してください。 | 9 # このスクリプトはEUCで保存してください。 |
10 $hgid = <<_HGID_.split[1..-2].join(" ") | 10 $hgid = <<_HGID_.split[1..-2].join(" ") |
11 $HGid$ | 11 $HGid$ |
12 _HGID_ | 12 _HGID_ |
13 $myurl = "http://www.gentei.org/~yuuji/software/after5/" | 13 $myurl = "https://www.gentei.org/~yuuji/software/after5/" |
14 | 14 |
15 require 'kconv' | 15 require 'kconv' |
16 require 'nkf' | 16 require 'nkf' |
17 | 17 |
18 $charset = 'EUC-JP' | 18 $charset = 'EUC-JP' |
1160 @sc = ScheduleDir.new | 1160 @sc = ScheduleDir.new |
1161 @O = StringIO.new | 1161 @O = StringIO.new |
1162 @H = HTMLout.new() | 1162 @H = HTMLout.new() |
1163 @umback = File.umask | 1163 @umback = File.umask |
1164 @author = 'yuuji@gentei.org' | 1164 @author = 'yuuji@gentei.org' |
1165 @after5url = 'http://www.gentei.org/~yuuji/software/after5/' | 1165 @after5url = 'https://www.gentei.org/~yuuji/software/after5/' |
1166 File.umask(007) | 1166 File.umask(007) |
1167 end | 1167 end |
1168 def doit() | 1168 def doit() |
1169 @params = getarg() | 1169 @params = getarg() |
1170 @cookie = getcookie() | 1170 @cookie = getcookie() |
2772 end | 2772 end |
2773 end | 2773 end |
2774 def rewritefrom(email, comment, newseed) # from catchup.rb | 2774 def rewritefrom(email, comment, newseed) # from catchup.rb |
2775 # no need to setcomment here because if comment set, it's enough | 2775 # no need to setcomment here because if comment set, it's enough |
2776 comment.sub!(/(\"?)(.*)\1/, '\2') | 2776 comment.sub!(/(\"?)(.*)\1/, '\2') |
2777 quote = $1 | |
2777 comment += "/" if comment>"" | 2778 comment += "/" if comment>"" |
2778 return comment.gsub(/([^\x00-\x7f]+)/){NKF.nkf('-jM', $1)} + | 2779 return quote + |
2779 email.sub("@", "=")+" <"+newseed+">" | 2780 comment.gsub(/([^\x00-\x7f]+)/){NKF.nkf('-jM', $1)} + |
2780 # end | 2781 email.sub("@", "=") + |
2782 quote + " <"+newseed+">" | |
2781 end | 2783 end |
2782 | 2784 |
2783 def tagify_subj(body, tag, removeregexp, fromhack = nil) | 2785 def tagify_subj(body, tag, removeregexp, fromhack = nil) |
2784 # This method should be generic for other headers than `Subject'? | 2786 # This method should be generic for other headers than `Subject'? |
2785 hold = [] | 2787 hold = [] |