зеркало из https://github.com/github/ruby.git
parsedate is no more available since 1.9
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
1ea5d1ae2a
Коммит
357ef2f428
|
@ -19,11 +19,8 @@ else
|
|||
$spool = ARGV[0]
|
||||
end
|
||||
|
||||
require "parsedate"
|
||||
require "base64"
|
||||
|
||||
include ParseDate
|
||||
|
||||
class Mail
|
||||
def Mail.new(f)
|
||||
if !f.kind_of?(IO)
|
||||
|
@ -128,7 +125,10 @@ def pop_up
|
|||
date, from, subj = mail.header['Date'], mail.header['From'], mail.header['Subject']
|
||||
next if !date
|
||||
y = m = d = 0
|
||||
y, m, d = parsedate(date) if date
|
||||
if date
|
||||
date = Date.parse(date)
|
||||
y, m, d = date.year, date.month, date.mday
|
||||
end
|
||||
from = "sombody@somewhere" if ! from
|
||||
subj = "(nil)" if ! subj
|
||||
from = decode_b(from)
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
#!/usr/bin/env ruby
|
||||
# frozen_string_literal: false
|
||||
|
||||
require "parsedate"
|
||||
require "base64"
|
||||
|
||||
include ParseDate
|
||||
|
||||
class Mail
|
||||
def Mail.new(f)
|
||||
if !f.kind_of?(IO)
|
||||
|
@ -107,7 +104,10 @@ for file in ARGV
|
|||
from = mail.header['From']
|
||||
subj = mail.header['Subject']
|
||||
y = m = d = 0
|
||||
y, m, d = parsedate(date) if date
|
||||
if date
|
||||
date = Date.parse(date) if date
|
||||
y, m, d = date.year, date.mon, date.mday
|
||||
end
|
||||
from = "sombody@somewhere" unless from
|
||||
subj = "(nil)" unless subj
|
||||
from = decode_b(from)
|
||||
|
|
Загрузка…
Ссылка в новой задаче