Sha256: fb371d686f631e198ebe23b1414717b17acb7c0eea71ded86865ec5d2610adbf

Contents?: true

Size: 388 Bytes

Versions: 62

Compression:

Stored size: 388 Bytes

Contents

# frozen_string_literal: false
require_relative '../optparse'
require 'date'

Gem::OptionParser.accept(DateTime) do |s,|
  begin
    DateTime.parse(s) if s
  rescue ArgumentError
    raise Gem::OptionParser::InvalidArgument, s
  end
end
Gem::OptionParser.accept(Date) do |s,|
  begin
    Date.parse(s) if s
  rescue ArgumentError
    raise Gem::OptionParser::InvalidArgument, s
  end
end

Version data entries

62 entries across 62 versions & 1 rubygems

Version Path
rubygems-update-3.5.23 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.22 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.21 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.20 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.19 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.18 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.17 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.16 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.15 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.14 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.13 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.12 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.10 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.9 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.8 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.7 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.6 lib/rubygems/vendor/optparse/lib/optparse/date.rb
rubygems-update-3.5.5 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.5.4 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.5.3 lib/rubygems/optparse/lib/optparse/date.rb