summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authortadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-06 00:39:44 +0000
committertadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-06 00:39:44 +0000
commit5781f2b44c1b967903016b08c865f066736672c6 (patch)
tree76ff79ab4116ca57f936423dd39cceadfd1a4cef /sample
parent636089ddbebe54616d010f2296ae1182b195593d (diff)
* lib/date.rb, lib/date/format.rb: introduced some constants
(for internal use) and aliases (minute and second). * sample/cal.rb: trivial adjustments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@14904 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r--sample/cal.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/sample/cal.rb b/sample/cal.rb
index d2105573bb..387657490f 100644
--- a/sample/cal.rb
+++ b/sample/cal.rb
@@ -1,7 +1,7 @@
#! /usr/bin/env ruby
-# cal.rb: Written by Tadayoshi Funaba 1998-2004,2006
-# $Id: cal.rb,v 2.10 2006-12-30 21:44:44+09 tadf Exp $
+# cal.rb: Written by Tadayoshi Funaba 1998-2004,2006,2008
+# $Id: cal.rb,v 2.11 2008-01-06 08:42:17+09 tadf Exp $
require 'date'
@@ -53,7 +53,7 @@ class Cal
end
def pict(y, m)
- d = (1..31).detect{|d| Date.valid_date?(y, m, d, @start)}
+ d = (1..31).detect{|x| Date.valid_date?(y, m, x, @start)}
fi = Date.new(y, m, d, @start)
fi -= (fi.jd - @k + 1) % 7
@@ -162,3 +162,5 @@ if __FILE__ == $0
print cal.print(y, m)
end
+
+# See Bird & Wadler's Introduction to functional programming 4.5.