Sha256: dc7ef253ae5c7be23497a509a08eaa195ebc5d976d5602f41bfca780ecad5c79

Contents?: true

Size: 313 Bytes

Versions: 43

Compression:

Stored size: 313 Bytes

Contents

require 'time'
class Rack::App::Utils::Parser::Time
  def parse(str)
    ::Time.parse(str)
  end

  def validate(str)
    [
      /(\d{4})-(\d{2})-(\d{2})T(\d{2})\:(\d{2})\:(\d{2})[+-](\d{2})\:(\d{2})/,
      /^\d+-\d\d-\d\d \d\d:\d\d:\d\d \+\d+$/
    ].any? do |regexp|
      !!(str =~ regexp)
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
rack-app-7.3.1 lib/rack/app/utils/parser/time.rb
rack-app-7.3.0 lib/rack/app/utils/parser/time.rb
rack-app-7.2.2 lib/rack/app/utils/parser/time.rb
rack-app-7.2.1 lib/rack/app/utils/parser/time.rb
rack-app-7.2.0 lib/rack/app/utils/parser/time.rb
rack-app-7.1.0 lib/rack/app/utils/parser/time.rb
rack-app-7.0.0 lib/rack/app/utils/parser/time.rb
rack-app-6.8.0 lib/rack/app/utils/parser/time.rb
rack-app-6.7.1 lib/rack/app/utils/parser/time.rb
rack-app-6.7.0 lib/rack/app/utils/parser/time.rb
rack-app-6.6.0 lib/rack/app/utils/parser/time.rb
rack-app-6.5.0 lib/rack/app/utils/parser/time.rb
rack-app-6.4.1 lib/rack/app/utils/parser/time.rb
rack-app-6.4.0 lib/rack/app/utils/parser/time.rb
rack-app-6.3.3 lib/rack/app/utils/parser/time.rb
rack-app-6.3.2 lib/rack/app/utils/parser/time.rb
rack-app-6.3.1 lib/rack/app/utils/parser/time.rb
rack-app-6.3.0 lib/rack/app/utils/parser/time.rb
rack-app-6.2.0 lib/rack/app/utils/parser/time.rb
rack-app-6.1.0 lib/rack/app/utils/parser/time.rb