aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/array/grouping.rb
Commit message (Collapse)AuthorAgeFilesLines
* [Active Support] `rubocop -a --only Layout/EmptyLineAfterMagicComment`Koichi ITO2017-07-111-0/+1
|
* Use frozen-string-literal in ActiveSupportKir Shatrov2017-07-091-0/+1
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* `self.` is not needed when calling its own instance methodAkira Matsuda2017-01-051-1/+1
| | | | Actually, private methods cannot be called with `self.`, so it's not just redundant, it's a bad habit in Ruby
* Array#split refactoring for case with blocklvl0nax2016-05-061-11/+6
| | | | | | | | | | | | | Calculating ------------------------------------- before 26.319k i/100ms after 29.414k i/100ms ------------------------------------------------- before 350.623k (± 1.6%) i/s - 1.763M after 416.227k (± 1.4%) i/s - 2.088M Comparison: after: 416226.8 i/s before: 350622.8 i/s - 1.19x slower
* Little perfomance fix for Array#split.lvl0nax2016-04-261-10/+6
| | | | | | | | | 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
* Move Array#without from Grouping to Access concern and add dedicated test ↵David Heinemeier Hansson2015-03-021-12/+0
| | | | (relates to #19157)
* Add Enumerable#withoutTodd Bealmear2015-03-011-0/+12
|
* Raise a descriptive error if non-positive integer passed to in_groups_of.Xavier Shay2014-07-301-0/+5
| | | | | | | | | | 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.
* Merge pull request #12842 from kuldeepaggarwal/array_splitGuillermo Iguaran2013-11-111-3/+3
|\ | | | | Speed up Array#split when block is passed
| * Speed up Array#splitKD2013-11-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Ruby 2.0.0p247 Rehearsal --------------------------------------- old 10.670000 0.150000 10.820000 ( 10.822651) new 8.520000 0.050000 8.570000 ( 8.571825) ----------------------------- total: 19.390000sec user system total real old 10.620000 0.170000 10.790000 ( 10.790409) new 8.570000 0.110000 8.680000 ( 8.686051)
* | Merge pull request #12841 from kuldeepaggarwal/in-group-documentationYves Senn2013-11-101-1/+1
|\ \ | |/ |/| Array#in_groups: documentation updated [ci skip]
| * Array#in_groups: documentation updatedKD2013-11-111-1/+1
| |
* | Array#split preserving the calling arrayKD2013-11-111-2/+2
|/
* Simplify Array#in_groups_of codeAkira Matsuda2013-07-101-3/+1
|
* Speed up Array#splitAkira Matsuda2013-07-101-6/+20
| | | | | | | Benchmark: user system total real old 0.510000 0.000000 0.510000 ( 0.506749) new 0.330000 0.000000 0.330000 ( 0.336187)
* Use faster Array.new instead of []*paddingVipul A M2013-05-021-1/+1
|
* Simplify (and optimize)Marc-Andre Lafortune2012-11-161-3/+3
|
* Use Integer#div instead of Integer#/ to avoid side effects from mathnMarc-Andre Lafortune2012-11-161-1/+1
|
* update AS/core_ext docs [ci skip]Francesco Rodriguez2012-09-121-2/+2
|
* Update examples of Array #in_groups and #in_groups_ofAlexey Vakhov2012-05-251-10/+13
| | | | | Examples should be not square to visually underline a difference between Array#in_groups and Array#in_groups_of.
* AS core_ext refactoring pt.2Alexey Gaziev2012-04-291-4/+2
|
* requiring enumerator is not nessessary in ruby 1.9Sergey Nartimov2011-12-201-2/+0
|
* Fix a bunch of minor spelling mistakesEvgeniy Dolzhenko2010-06-111-1/+1
|
* Convert array extension modules to class reopensJeremy Kemper2009-03-211-93/+87
|
* Merge docrailsPratik Naik2008-09-131-6/+6
|
* Performance: grouping helpers should use yield instead of block as argument. ↵miloops2008-07-301-5/+5
| | | | [#723 state:resolved]
* Add in_groups to ActiveSupport::CoreExtensions::Array::Grouping. [#579 ↵Adrian Mugnolo2008-07-151-2/+45
| | | | | | state:resolved] Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Improve documentation.Pratik Naik2008-04-051-8/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9226 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Improve documentation.Pratik Naik2008-03-261-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9093 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Clarify Array#in_groups_of implementation, don't dup unless needed, only ↵Jeremy Kemper2007-11-171-7/+20
| | | | | | require enumerator once. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8161 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't pad remaining places with in_groups_of if specified padding value is ↵Marcel Molina2006-09-021-2/+11
| | | | | | false. [Marcel Molina Jr.] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4900 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added Array#to_s(:db) that'll produce a comma-separated list of ids [DHH] ↵David Heinemeier Hansson2006-05-311-0/+46
Split Grouping into its own file git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4387 5ecf4fe2-1ee6-0310-87b1-e25e094e27de