funkr 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -91,9 +91,9 @@ class Array
91
91
  end
92
92
 
93
93
  # Constitue des groupes de n éléments
94
- def groups_of(ar, n)
94
+ def groups_of(n)
95
95
  return [] if self.empty?
96
- [self.take(n)] + groups_of(self.drop(n), n)
96
+ [self.take(n)] + self.drop(n).groups_of(n)
97
97
  end
98
98
 
99
99
 
data/lib/funkr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Funkr
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/test/tests.rb CHANGED
@@ -73,3 +73,7 @@ puts(a.bind do |x|
73
73
 
74
74
  puts "\n> group_seq_by"
75
75
  puts([1,2,4,5,7,5,8,2,10].group_seq_by{|x| x % 2}.inspect)
76
+
77
+
78
+ puts "\n> groups_of"
79
+ puts([1,2,4,5,7,5,8,2,10].groups_of(4).inspect)
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Paul Rivier