Sha256: cdf7ac61b17cc846748896e66152bb5d088c38461de58a9bed9225879e7976e4
Contents?: true
Size: 368 Bytes
Versions: 6
Compression:
Stored size: 368 Bytes
Contents
# frozen_string_literal: false require_relative '../optparse' require 'date' OptionParser.accept(DateTime) do |s,| begin DateTime.parse(s) if s rescue ArgumentError raise OptionParser::InvalidArgument, s end end OptionParser.accept(Date) do |s,| begin Date.parse(s) if s rescue ArgumentError raise OptionParser::InvalidArgument, s end end
Version data entries
6 entries across 6 versions & 2 rubygems