summaryrefslogtreecommitdiff
path: root/ext/tk/sample
diff options
context:
space:
mode:
authora_matsuda <a_matsuda@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-28 15:10:10 +0000
committera_matsuda <a_matsuda@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-28 15:10:10 +0000
commit357ef2f428967bd917c3eca4c9dcd08745728b23 (patch)
tree36f188759f31303f451eaac8538aefb932171022 /ext/tk/sample
parent1ea5d1ae2a40bfda94abd1e2ff8bd5b52b1e1b05 (diff)
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
Diffstat (limited to 'ext/tk/sample')
-rw-r--r--ext/tk/sample/tkbiff.rb8
-rw-r--r--ext/tk/sample/tkfrom.rb8
2 files changed, 8 insertions, 8 deletions
diff --git a/ext/tk/sample/tkbiff.rb b/ext/tk/sample/tkbiff.rb
index a65e4be..8dc586a 100644
--- a/ext/tk/sample/tkbiff.rb
+++ b/ext/tk/sample/tkbiff.rb
@@ -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)
diff --git a/ext/tk/sample/tkfrom.rb b/ext/tk/sample/tkfrom.rb
index 4c24988..69a122f 100644
--- a/ext/tk/sample/tkfrom.rb
+++ b/ext/tk/sample/tkfrom.rb
@@ -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)