Sha256: e78c106b349fdc2f2af803d565e0ee493de967ff4a899f57abf355268f80226c

Contents?: true

Size: 231 Bytes

Versions: 6

Compression:

Stored size: 231 Bytes

Contents

# frozen_string_literal: false
require_relative '../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

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
optparse-0.6.0 lib/optparse/time.rb
optparse-0.5.0 lib/optparse/time.rb
cmd-optparse.rb-0.1.0 lib/optparse/time.rb
optparse-0.4.0 lib/optparse/time.rb
optparse-0.3.1 lib/optparse/time.rb
optparse-0.3.0 lib/optparse/time.rb