Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Remove checks for Enumerator#size method | Eugene Kenny | 2017-04-25 | 1 | -4/+2 |
| | | | | | | | | The Enumerator#size method was introduced in Ruby 2.0. These tests were added when Rails 4.1 was current, and Ruby 1.9.3 was still supported. Since Rails 5 only Ruby >= 2.2.2 is supported, so the checks are no longer necessary. | ||||
* | "Use assert_nil if expecting nil. This will fail in minitest 6." | Akira Matsuda | 2016-12-25 | 1 | -1/+1 |
| | |||||
* | Add more rubocop rules about whitespaces | Rafael Mendonça França | 2016-10-29 | 1 | -10/+10 |
| | |||||
* | Add three new rubocop rules | Rafael Mendonça França | 2016-08-16 | 1 | -8/+8 |
| | | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository. | ||||
* | applies new string literal convention in activesupport/test | Xavier Noria | 2016-08-06 | 1 | -8/+8 |
| | | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default. | ||||
* | Fix initial value effects for sum along to ruby 2.4 | Kenta Murata | 2016-04-30 | 1 | -0/+78 |
| | | | | Signed-off-by: Jeremy Daer <jeremydaer@gmail.com> | ||||
* | Ruby 2.4: compat with new Array#sum | Jeremy Daer | 2016-04-18 | 1 | -3/+21 |
| | | | | | | | | | | | | | | | | | | | | | Ruby 2.4 introduces `Array#sum`, but it only supports numeric elements, breaking our `Enumerable#sum` which supports arbitrary `Object#+`. To fix, override `Array#sum` with our compatible implementation. Native Ruby 2.4: %w[ a b ].sum # => TypeError: String can't be coerced into Fixnum With `Enumerable#sum` shim: %w[ a b ].sum # => 'ab' We tried shimming the fast path and falling back to the compatible path if it fails, but that ends up slower even in simple causes due to the cost of exception handling. Our only choice is to override the native `Array#sum` with our `Enumerable#sum`. | ||||
* | Allow Enumerable#pluck to take a splat. | Kevin Deisz | 2015-05-29 | 1 | -0/+9 |
| | | | | | | This allows easier integration with ActiveRecord, such that AR#pluck will now use Enumerable#pluck if the relation is loaded, without needing to hit the database. | ||||
* | Add Enumerable#pluck. | Kevin Deisz | 2015-05-28 | 1 | -0/+5 |
| | | | | Allows fetching the same values from arrays as from ActiveRecord associations. | ||||
* | Use include? instead of in? for Enumerable#without. | Juanito Fatas | 2015-03-02 | 1 | -1/+0 |
| | | | | [egilburg] | ||||
* | Include object inclusion for enumerable test. | Juanito Fatas | 2015-03-02 | 1 | -0/+1 |
| | |||||
* | Add Enumerable#without | Todd Bealmear | 2015-03-01 | 1 | -0/+7 |
| | |||||
* | Pass symbol as an argument instead of a block | Erik Michaels-Ober | 2014-11-29 | 1 | -2/+2 |
| | |||||
* | Return sized enumerator from Enumerable#index_by | Marc-Andre Lafortune | 2014-02-05 | 1 | -0/+4 |
| | |||||
* | Remove obsolete test (builtin group_by is now used) | Marc-Andre Lafortune | 2014-02-05 | 1 | -20/+0 |
| | |||||
* | Remove obsolete line (was needed for Ruby 1.8.7 support) | Marc-Andre Lafortune | 2014-02-05 | 1 | -1/+0 |
| | |||||
* | Further simplify enumerable group_by test | Carlos Antonio da Silva | 2013-04-04 | 1 | -3/+1 |
| | |||||
* | Replaced inject with map | Anupam Choudhury | 2013-04-04 | 1 | -2/+2 |
| | |||||
* | Removed unused comma after loop variable | Anupam Choudhury | 2013-04-04 | 1 | -1/+1 |
| | |||||
* | Fix Range#sum optimized version | Alexey Vakhov | 2012-05-25 | 1 | -0/+5 |
| | | | | | | | | | | | | | | | | | | | | | | At 1bd4d1c67459a91415ee73a8f55d2309c0d62a87 was added Range#sum optimized version for arithmetic progressions. This improvment injected a defect with not integer range boundaries. The defect was fixed by e0adfa82c05f9c975005f102b4bcaebfcd17d241. The second commit really disabled optimization at all because in Ruby integer-valued numbers are instances of Fixnum and Bignum classes. We should #use is_a? (#kind_of?) method instead #instance_of? to check if value is numerical: 1.class # => Fixnum 1.instance_of?(Integer) # => false 1.is_a?(Integer) # => true -100_000_000_000.class # => Bignum -100_000_000_000.instance_of?(Integer) # => false -100_000_000_000.is_a?(Integer) # => true Moreover original implementation of Range#sum has a defect with reverse range boundaries. If the first boundary is less than the second range is empty. Current commit fixes and tests this case too. | ||||
* | use AS::TestCase as the base class | Aaron Patterson | 2012-01-05 | 1 | -1/+1 |
| | |||||
* | Revert "Added Enumerable#pluck to wrap the common pattern of ↵ | Aaron Patterson | 2011-12-22 | 1 | -7/+0 |
| | | | | | | | | | | | | collect(&:method) *DHH*" This reverts commit 4d20de8a50d889a09e6f5642984775fe796ca943. Conflicts: activesupport/CHANGELOG.md activesupport/lib/active_support/core_ext/enumerable.rb activesupport/test/core_ext/enumerable_test.rb | ||||
* | remove Enumerable#each_with_object from core_ext as it is present in ruby 1.9 | lest | 2011-12-21 | 1 | -10/+1 |
| | |||||
* | Added Enumerable#pluck to wrap the common pattern of collect(&:method) *DHH* | David Heinemeier Hansson | 2011-12-02 | 1 | -1/+8 |
| | |||||
* | Insure that Enumerable#index_by, group_by, ... return Enumerators | Marc-Andre Lafortune | 2011-07-23 | 1 | -1/+12 |
| | |||||
* | Make Enumerable#many? iterate only over what is necessary | Marc-Andre Lafortune | 2011-07-23 | 1 | -0/+7 |
| | |||||
* | Make Enumerable#many? not rely on #size | Marc-Andre Lafortune | 2011-07-23 | 1 | -1/+1 |
| | |||||
* | Test using generic Enumerables instead of arrays. | Marc-Andre Lafortune | 2011-07-23 | 1 | -24/+38 |
| | |||||
* | Make tests more precise | Marc-Andre Lafortune | 2011-07-23 | 1 | -14/+14 |
| | |||||
* | Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵ | Santiago Pastorino | 2010-08-14 | 1 | -1/+1 |
| | | | | 's/[ \t]*$//' -i {} \;) | ||||
* | Add Enumerable#exclude? to bring parity to Enumerable#include? and avoid if ↵ | David Heinemeier Hansson | 2009-12-14 | 1 | -0/+5 |
| | | | | !x.include?/else calls [DHH] | ||||
* | Enumerable#none? is not needed for Ruby >= 1.8.7 | Xavier Noria | 2009-11-09 | 1 | -11/+0 |
| | |||||
* | Symbol#to_proc is not needed for Ruby >= 1.8.7 | Xavier Noria | 2009-11-09 | 1 | -1/+0 |
| | |||||
* | Improving test coverage for Range#sum [#2489] | José Valim | 2009-08-09 | 1 | -1/+1 |
| | | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | ||||
* | Remove unnecessary &block from Range#sum and add tests for (num..float).sum | Pratik Naik | 2009-08-09 | 1 | -0/+1 |
| | |||||
* | Make enumerable test run stand alone | Pratik Naik | 2009-08-09 | 1 | -0/+1 |
| | |||||
* | Optimize Range#sum only for integers [#2489] | José Valim | 2009-08-09 | 1 | -0/+1 |
| | |||||
* | Optimize Range#sum to use arithmetic progression when a block is not given ↵ | José Valim | 2009-08-09 | 1 | -0/+2 |
| | | | | | | [#2489]. Signed-off-by: Pratik Naik <pratiknaik@gmail.com> | ||||
* | Enumerable#sum now works will all enumerables, even if they don't respond to ↵ | Marc-Andre Lafortune | 2009-08-08 | 1 | -0/+4 |
| | | | | | | | | :size [#2489 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net> | ||||
* | Explicit test dependencies | Jeremy Kemper | 2009-03-28 | 1 | -0/+2 |
| | |||||
* | Enumerable#none? conforms to Ruby 1.8.7 behavior | Jeremy Kemper | 2008-11-19 | 1 | -1/+2 |
| | |||||
* | Added Enumerable#none? to check that none of the elements match the block ↵ | Damian Janowski | 2008-11-19 | 1 | -0/+10 |
| | | | | | | [#1408 state:committed] Signed-off-by: David Heinemeier Hansson <david@loudthinking.com> | ||||
* | Add each_with_object from 1.9 for a more convenient alternative to inject. | Adam Keys | 2008-09-03 | 1 | -0/+5 |
| | | | | | Signed-off-by: Michael Koziarski <michael@koziarski.com> [#962 state:committed] | ||||
* | Added block-handling to Enumerable#many? (Damian Janowski) [#452 state:resolved] | David Heinemeier Hansson | 2008-06-20 | 1 | -2/+7 |
| | |||||
* | Change Enumberal#several? to Enumberal#many? | David Heinemeier Hansson | 2008-06-13 | 1 | -3/+3 |
| | |||||
* | Added Enumberable#several? to encapsulate collection.size > 1 [DHH] | David Heinemeier Hansson | 2008-06-12 | 1 | -0/+6 |
| | |||||
* | Add OrderedHash#to_hash. Closes #11266 [josh] | Michael Koziarski | 2008-03-03 | 1 | -0/+1 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8974 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | Enumerable#group_by uses ActiveSupport::OrderedHash | Jeremy Kemper | 2008-01-23 | 1 | -1/+1 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8700 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | Fix up Enumerable#group_by | Jeremy Kemper | 2008-01-09 | 1 | -2/+6 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8604 5ecf4fe2-1ee6-0310-87b1-e25e094e27de | ||||
* | require abstract_unit directly since test is in load path | Jeremy Kemper | 2008-01-05 | 1 | -1/+1 |
| | | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8563 5ecf4fe2-1ee6-0310-87b1-e25e094e27de |