mirror of
https://github.com/mistergibson/gxg-web-client.git
synced 2026-08-18 01:42:36 -07:00
Initial Commit
This commit is contained in:
parent
356ad3315b
commit
81daf6f387
283 changed files with 130672 additions and 1 deletions
11
gxg/standard/optparse/time.rb
Normal file
11
gxg/standard/optparse/time.rb
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
# frozen_string_literal: false
|
||||
require 'optparse'
|
||||
require 'time'
|
||||
|
||||
OptionParser.accept(Time) do |s,|
|
||||
begin
|
||||
(Time.httpdate(s) rescue Time.parse(s)) if s
|
||||
rescue
|
||||
raise OptionParser::InvalidArgument, s
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue