self_enumerable 0.1.0 → 0.2.0
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.
- checksums.yaml +4 -4
- data/benchmark/benchmark_self_enumerable.rb +4 -4
- data/lib/self_enumerable.rb +3 -3
- data/lib/self_enumerable/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a1491da02acde05a9accd72a89fa2cc8a69f1ebb
|
4
|
+
data.tar.gz: c856dacc8e6eb6bc527dbe472b24d8909dca85b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 999057fe28b5a195b365dd192316c972bc5894407b6688b55cfa3610964fbf855c80494f27905de6b0d8961c666990ba33bcf69d6fc3671759b571103fb0b919
|
7
|
+
data.tar.gz: 4083d8209cb005f96a68f9b00c3c6e7e3f88f54514d23ba1e3e5767c76e84320281cd2c9e2b8431eeff4fe5e417991a232960b449cb36ddf340cb40870e8bf1c
|
@@ -37,12 +37,12 @@ class BenchmarkSelfEnumerable
|
|
37
37
|
Benchmark.ips do |x|
|
38
38
|
callable = -> (_el) { _el }
|
39
39
|
|
40
|
-
x.report("Enumerable#
|
41
|
-
enumerable_data_set.
|
40
|
+
x.report("Enumerable#select") do
|
41
|
+
enumerable_data_set.select(&callable)
|
42
42
|
end
|
43
43
|
|
44
|
-
x.report("SelfEnumerable#
|
45
|
-
self_enumerable_data_set.
|
44
|
+
x.report("SelfEnumerable#select") do
|
45
|
+
self_enumerable_data_set.select(&callable)
|
46
46
|
end
|
47
47
|
|
48
48
|
x.compare!
|
data/lib/self_enumerable.rb
CHANGED
@@ -2,10 +2,10 @@ require "self_enumerable/version"
|
|
2
2
|
|
3
3
|
module SelfEnumerable
|
4
4
|
WRAPPED_METHODS = [
|
5
|
-
:collect, :collect_concat, :drop, :drop_while, :first, :find_all,
|
6
|
-
:grep, :
|
5
|
+
:collect, :collect_concat, :drop, :drop_while, :first, :find_all,
|
6
|
+
:grep, :max, :min, :min_by, :partition, :reject, :select, :sort, :sort_by,
|
7
7
|
:take, :take_while
|
8
|
-
]
|
8
|
+
] # map/flat_map are disabled because its often used to map something into another format
|
9
9
|
|
10
10
|
def self.included(klass)
|
11
11
|
klass.class_eval <<-eoruby
|