1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/optparse/time.rb: prior time.rb.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2002-08-07 13:13:44 +00:00
parent e20d6139f4
commit 11cfb7e0f4
2 changed files with 5 additions and 3 deletions

View file

@ -1,4 +1,4 @@
Wed Aug 7 21:58:01 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net> Wed Aug 7 22:12:54 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* optparse.rb (OptionParser::Completion::convert): returned all * optparse.rb (OptionParser::Completion::convert): returned all
values not first one. values not first one.
@ -7,6 +7,8 @@ Wed Aug 7 21:58:01 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* optparse.rb (OptionParser::order): ditto. * optparse.rb (OptionParser::order): ditto.
* lib/optparse/time.rb: prior time.rb.
* lib/optparse/uri.rb: require standard uri module. thanks to * lib/optparse/uri.rb: require standard uri module. thanks to
Minero Aoki. Minero Aoki.

View file

@ -1,9 +1,9 @@
require 'optparse' require 'optparse'
require 'parsedate' require 'time'
OptionParser.accept(Time) do |s| OptionParser.accept(Time) do |s|
begin begin
Time::mktime(*ParseDate::parsedate(s)[0...6]) (Time.httpdate(s) rescue Time.parse(s)) if s
rescue rescue
raise OptionParser::InvalidArgument, s raise OptionParser::InvalidArgument, s
end end