cryx-g5k 0.2.1 → 0.2.2
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.
- data/VERSION.yml +1 -1
- data/lib/g5k/enumerable_extensions.rb +16 -0
- data/lib/g5k.rb +4 -1
- metadata +2 -1
data/VERSION.yml
CHANGED
@@ -0,0 +1,16 @@
|
|
1
|
+
# for versions of ruby < 1.8.7
|
2
|
+
module Enumerable
|
3
|
+
def index_by
|
4
|
+
inject({}) do |accum, elem|
|
5
|
+
accum[yield(elem)] = elem
|
6
|
+
accum
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def group_by #:yield:
|
11
|
+
#h = k = e = nil
|
12
|
+
r = Hash.new
|
13
|
+
each{ |e| (r[yield(e)] ||= []) << e }
|
14
|
+
r
|
15
|
+
end
|
16
|
+
end
|
data/lib/g5k.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cryx-g5k
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyril Rohr
|
@@ -24,6 +24,7 @@ extra_rdoc_files: []
|
|
24
24
|
files:
|
25
25
|
- VERSION.yml
|
26
26
|
- lib/g5k
|
27
|
+
- lib/g5k/enumerable_extensions.rb
|
27
28
|
- lib/g5k/parsing
|
28
29
|
- lib/g5k/parsing/parser.rb
|
29
30
|
- lib/g5k/parsing.rb
|