Sha256: eb03c22e643a0700b1389e2d9ab2f8bcaa642a70e150b60b50ead56bdf1eb6db

Contents?: true

Size: 398 Bytes

Versions: 16

Compression:

Stored size: 398 Bytes

Contents

# frozen_string_literal: false
require 'rubygems/optparse/lib/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

16 entries across 16 versions & 1 rubygems

Version Path
rubygems-update-3.2.34 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.3.11 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.3.10 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.3.9 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.3.8 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.3.7 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.3.6 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.3.5 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.3.4 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.3.3 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.3.2 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.3.1 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.3.0 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.2.33 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.2.32 lib/rubygems/optparse/lib/optparse/date.rb
rubygems-update-3.2.31 lib/rubygems/optparse/lib/optparse/date.rb