Date class is different in Ruby stdlib and Rails stdlib

I want to use the Date :: ABBR_MONTHS constant in my rails application. I see the Ruby stdlib documentation at http://www.ruby-doc.org/stdlib/ , which does not seem to have this constant. However, this constant is located at http://stdlib.rubyonrails.org/

What is the difference between these two libraries?

This constant works on my unix deployment machine, but not on my windows dev machine. Can anyone explain what is happening?

+3
source share
2 answers

ABBR_MONTHS - , ActiveSupport, Date. , - . - Rails.

+3

ABBR_MONTHS Date ActiveSupport.

. ActiveSupport Ruby- , Inflector 2.days ..

, rails - , :

require 'rubygems' #If not already done
require 'activesupport'
puts Date::Format::ABBR_MONTHS.inspect
#=> {"oct"=>10, "jul"=>7, "jan"=>1, "dec"=>12, "jun"=>6, "apr"=>4, "feb"=>2, "may"=>5, "sep"=>9, "aug"=>8, "mar"=>3, "nov"=>11}
+1

Source: https://habr.com/ru/post/1697902/


All Articles