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:
parent
e20d6139f4
commit
11cfb7e0f4
2 changed files with 5 additions and 3 deletions
|
@ -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
|
||||
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.
|
||||
|
||||
* lib/optparse/time.rb: prior time.rb.
|
||||
|
||||
* lib/optparse/uri.rb: require standard uri module. thanks to
|
||||
Minero Aoki.
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
require 'optparse'
|
||||
require 'parsedate'
|
||||
require 'time'
|
||||
|
||||
OptionParser.accept(Time) do |s|
|
||||
begin
|
||||
Time::mktime(*ParseDate::parsedate(s)[0...6])
|
||||
(Time.httpdate(s) rescue Time.parse(s)) if s
|
||||
rescue
|
||||
raise OptionParser::InvalidArgument, s
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue