aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/core_ext/array
Commit message (Collapse)AuthorAgeFilesLines
* Fix including/excluding flatteningGabriel Sobrinho2019-03-061-0/+2
|
* Added Array#including, Array#excluding, Enumerable#including, ↵David Heinemeier Hansson2019-03-051-0/+10
| | | | Enumerable#excluding
* Use native `Array#append`, `Array#prepend`, `Hash#transform_keys`, and ↵Ryuta Kamizono2018-12-201-7/+4
| | | | | | | | | | `Hash#transform_keys!` Since Rails 6 requires Ruby 2.5. https://github.com/ruby/ruby/blob/ruby_2_5/NEWS Follow up #34754.
* Change the empty block style to have space inside of the blockRafael Mendonça França2018-09-251-1/+1
|
* Add `Array#extract!`bogdanvlviv2018-08-141-0/+44
| | | | | | | | | | | The method removes and returns the elements for which the block returns a true value. If no block is given, an Enumerator is returned instead. ``` numbers = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] odd_numbers = numbers.extract! { |number| number.odd? } # => [1, 3, 5, 7, 9] numbers # => [0, 2, 4, 6, 8] ```
* Rails 6 requires Ruby 2.4.1+Jeremy Daer2018-02-171-9/+0
| | | | | | Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug. References #32028
* Suppress `warning: BigDecimal.new is deprecated`Yasuo Honda2017-12-151-3/+3
| | | | | | | | | | | | | | | | | | | | `BigDecimal.new` has been deprecated in BigDecimal 1.3.3 which will be a default for Ruby 2.5. Refer https://github.com/ruby/bigdecimal/commit/533737338db915b00dc7168c3602e4b462b23503 * This commit has been made as follows: ``` cd rails git grep -l BigDecimal.new | grep -v guides/source/5_0_release_notes.md | grep -v activesupport/test/xml_mini_test.rb | xargs sed -i -e "s/BigDecimal.new/BigDecimal/g" ``` - `activesupport/test/xml_mini_test.rb` Editmanually to remove `.new` and `::` - guides/source/5_0_release_notes.md This is a Rails 5.0 release notes.
* Enable `Layout/SpaceBeforeComma` rubocop rule, and fixed moreRyuta Kamizono2017-12-121-1/+1
| | | | Follow up of #31390.
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-116-0/+6
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-096-0/+6
|
* Expectation firstAkira Matsuda2017-07-021-1/+1
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-026-6/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-016-0/+6
|
* Revert "Merge pull request #25811 from oss92/to_sentence_fallback_string"Rafael Mendonça França2016-11-141-6/+1
| | | | | | | | This reverts commit bad3a120f1690f393d8f6204b3ceee60f0ce707b, reversing changes made to 2384317465ccb1dfca456a2b7798714b99f32711. Reason: Adding a new option in the API for something that can be done with a `#presence` check could do.
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-1/+1
|
* Fixnum and Bignum are deprecated in Ruby trunkMatthew Draper2016-10-081-2/+2
| | | | https://bugs.ruby-lang.org/issues/12739
* improve error message when include assertions failMichael Grosser2016-09-161-23/+23
| | | | | | assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong
* applies new string literal convention in activesupport/testXavier Noria2016-08-066-52/+52
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Added :fallback_string option to Array#to_sentenceoss922016-07-131-1/+6
|
* Support for unified Integer class in Ruby 2.4+Jeremy Daer2016-05-182-5/+6
| | | | | | | | Ruby 2.4 unifies Fixnum and Bignum into Integer: https://bugs.ruby-lang.org/issues/12005 * Forward compat with new unified Integer class in Ruby 2.4+. * Backward compat with separate Fixnum/Bignum in Ruby 2.2 & 2.3. * Drops needless Fixnum distinction in docs, preferring Integer.
* Little perfomance fix for Array#split.lvl0nax2016-04-261-0/+8
| | | | | | | | | Calculating ------------------------------------- before 40.770k i/100ms after 58.464k i/100ms ------------------------------------------------- before 629.568k (± 5.0%) i/s - 3.180M after 1.159M (± 4.5%) i/s - 5.788M
* rename to 'second_to_last' and 'third_to_last'Brian Christian2016-02-101-2/+2
|
* allow Array.penultimate and Array.antepenultiate access methodsBrian Christian2016-02-091-0/+2
|
* Make sure Array#to_sentence always returns a StringDavid Cornu2015-03-231-0/+6
|
* Move Array#without from Grouping to Access concern and add dedicated test ↵David Heinemeier Hansson2015-03-021-0/+4
| | | | (relates to #19157)
* Raise a descriptive error if non-positive integer passed to in_groups_of.Xavier Shay2014-07-301-0/+6
| | | | | | | | | | This is more consistent than the current behaviour of raising a `ZeroDivisionError: divided by 0` error when 0 is given, which can be non-obvious especially if `in_groups_of` is part of a longer chain of methods. The negative case was ok - "ArgumentError: invalid slice size" - but this error is clearer still.
* Add missing test case for Array#to_sentence, collect all test cases for ↵Akshay Vishnoi2014-07-291-22/+8
| | | | Object#to_param at one place and avoid repitition
* Move array test files under arrayAkshay Vishnoi2014-07-296-0/+495