Sha256: cd0aeb2a703d57c47f69b23e5ada86086e5b128d5bcd20eacb90b9b6a5511806
Contents?: true
Size: 482 Bytes
Versions: 43
Compression:
Stored size: 482 Bytes
Contents
require 'date' class Rack::App::Utils::Parser::DateTime def parse(str) ::DateTime.parse(str) end def validate(str) [ /(\d{4})-(\d{2})-(\d{2})T(\d{2})\:(\d{2})\:(\d{2})[+-](\d{2})\:(\d{2})/, /^\w+, \d+ \w+ \d+ \d\d:\d\d:\d\d \+\d+$/, /^-?\d+-\d\d-\d\d\w\d\d:\d\d:\d\d\+\d\d:\d\d$/, /\w+ \w+ \d+ \d+ \d+:\d+:\d+ \w+\+\d+ \(\w+\)/, /^-?\d+-\d\d?-\d\d?\w\d\d?:\d\d?:\d\d?\w$/ ].any? do |regexp| !!(str =~ regexp) end end end
Version data entries
43 entries across 43 versions & 1 rubygems