Sha256: 2a11e14ecedf58b4648e5e165e7ccd0edc0998c3dab832db576187d62af84a6a

Contents?: true

Size: 199 Bytes

Versions: 1

Compression:

Stored size: 199 Bytes

Contents

# frozen_string_literal: false
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

1 entries across 1 versions & 1 rubygems

Version Path
cmd-optparse.rb-0.5.0 lib/cmd/option_parser/time.rb