aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/integer
Commit message (Collapse)AuthorAgeFilesLines
* Faster multiple_of? methodrigani2018-09-121-1/+1
|
* Simplify API documentation of methods that return a Durationbogdanvlviv2017-10-241-16/+5
| | | | Related to #30972
* Make clear that Time core extensions are split between Numeric and IntegerJoão Fernandes2017-10-241-0/+2
| | | | | | | The documentation wrongly suggests that Time extensions to Numeric include methods months and years, when these belong to Integer. Update both classes and guides.
* [Active Support] require_relative => requireAkira Matsuda2017-10-212-3/+3
| | | | This basically reverts 8da30ad6be34339124ba4cb4e36aea260dda12bc
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-113-0/+3
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-093-0/+3
|
* [Active Support] require => require_relativeAkira Matsuda2017-07-012-3/+3
|
* Add duration constructors for use in Numeric extensionsAndrew White2017-01-121-2/+2
| | | | | The Numeric extensions like 1.day, 1.month, etc. shouldn't know how the internals of ActiveSupport::Duration works.
* Fix inconsistent results when parsing large durations and constructing ↵Andrey Novikov2017-01-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | durations from code ActiveSupport::Duration.parse('P3Y') == 3.years # It should be true Duration parsing made independent from any moment of time: Fixed length in seconds is assigned to each duration part during parsing. Changed duration of months and years in seconds to more accurate and logical: 1. The value of 365.2425 days in Gregorian year is more accurate as it accounts for every 400th non-leap year. 2. Month's length is bound to year's duration, which makes sensible comparisons like `12.months == 1.year` to be `true` and nonsensical ones like `30.days == 1.month` to be `false`. Calculations on times and dates with durations shouldn't be affected as duration's numeric value isn't used in calculations, only parts are used. Methods on `Numeric` like `2.days` now use these predefined durations to avoid duplicating of duration constants through the codebase and eliminate creation of intermediate durations.
* applies new string literal convention in activesupport/libXavier Noria2016-08-062-3/+3
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Change Integer#year to return a Fixnum instead of a Float to improve consistencyKonstantinos Rousis2015-10-221-1/+1
|
* Move Integer#positive? and Integer#negative? query methods to Numeric classMehmet Emin İNAÇ2015-05-131-19/+0
| | | | By this way Integer, Rational, Float, Fixnum, Bignum classes have the same behaviour
* Minor comment fix. [ci skip]Zoltan Kiss2015-05-131-4/+4
|
* Add Integer#positive? and Integer#negative? query methods in the vein of ↵David Heinemeier Hansson2015-05-131-0/+19
| | | | Fixnum#zero?
* Remove reference to Numeric#from_now, as it is no longer supportednerdinand2015-03-231-15/+0
|
* updated documentation for IntegerKuldeep Aggarwal2013-11-121-3/+3
|
* Add missing requires to core_ext/integer/timePablo Torres2012-12-161-0/+3
|
* update AS/core_ext docs [ci skip]Francesco Rodriguez2012-09-122-11/+11
|
* fix incorrect example [ci skip]Vijay Dev2012-05-121-1/+1
|
* added examples to Integer#multiple_of?Francesco Rodriguez2012-05-111-0/+4
|
* update stdlib doc urls in comments - ↵Trevor Wennblom2012-04-071-3/+3
| | | | | | active_support/core_ext/[integer|numeric]/time.rb http://stdlib.rubyonrails.org/ last updated in 2005
* Add ActiveSupport::Inflector.ordinal and Integer#ordinalTim Gildea2012-02-041-0/+14
|
* included examples for negative ordinalizeVijay Dev2011-05-081-4/+7
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-2/+2
| | | | 's/[ \t]*$//' -i {} \;)
* Let Integer#multiple_of? accept zero as argumentXavier Noria2010-01-021-1/+1
| | | | | | [#2982 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Integer#even? and Integer#odd? are not needed for Ruby >= 1.8.7Xavier Noria2009-11-092-16/+6
|
* Prefer behavior check to RUBY_VERSION to catch 1.8 backportsJeremy Kemper2009-04-291-2/+2
|
* Convert Integer time extension module to class reopenJeremy Kemper2009-03-281-42/+36
|
* Fix dangling Inflector referenceJeremy Kemper2009-03-211-1/+1
|
* Convert integer extension modules to class reopensJeremy Kemper2009-03-212-42/+23
|
* Deprecated Float#years and Float#months, moved Numeric#years and ↵Tom Lea2008-10-131-0/+45
| | | | Numeric#months into Integer.
* Merge docrails.Pratik Naik2008-05-251-4/+8
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Improve documentation.Pratik Naik2008-04-052-5/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9226 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Improve documentation.Pratik Naik2008-03-262-6/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9093 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ruby 1.9 compat: prefer builtin String#starts_ and ends_with? if available ↵Jeremy Kemper2007-12-151-4/+4
| | | | | | [chuyeow] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8397 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Document Inflector.ordinalize and merge docs from String inflections. Closes ↵Jeremy Kemper2007-01-141-4/+10
| | | | | | #7023. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5924 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r3215@asus: jeremy | 2005-11-20 02:05:56 -0800Jeremy Kemper2005-11-211-1/+1
| | | | | | | Eliminate double-requires due to Ruby seeing different paths to the same file. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3127 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Factor Fixnum and Bignum extensions into Integer classNicholas Seckar2005-07-192-0/+39
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1863 5ecf4fe2-1ee6-0310-87b1-e25e094e27de