Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

stricter-string-to-date

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stricter-string-to-date

  • 1.0.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Stricter::String::To::Date

ActiveSupport 4.0 changed String#to_date to raise a more descriptive error for invalid dates.

It also makes date parsing more liberal than ActiveSupport 3.x.

# ActiveSupport 3.x
"asdf".to_date # => NoMethodError: undefined method `div' for nil:NilClass
"333".to_date # => NoMethodError: undefined method `div' for nil:NilClass

# ActiveSupport 4.x
"asdf".to_date # => ArgumentError: invalid date
"333".to_date # => Fri, 29 Nov 2013

You can install this gem if you:

  • Rely on the old 3.x behavior and want to upgrade to ActiveSupport 4.x without dealing with it yet
  • Are on 3.x and want to see deprecation warnings about the changes that will come in 4.x

Installation

Add this line to your application's Gemfile:

gem 'stricter-string-to-date'

And then execute:

$ bundle

Or install it yourself as:

$ gem install stricter-string-to-date

FAQs

Package last updated on 05 Aug 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc