briskly 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/briskly/store.rb +5 -4
- data/lib/briskly/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df7110ca2e129d80ed1fddff2ddac4586df49e40
|
4
|
+
data.tar.gz: 0a24ed790f82bef7d4f846d3c48e624e4b0d23d7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1e85a6d1d326a130608a6b746dd02045daa334ff45e1b48b741ccaf5f29d77f5c9aeb57526b4d657de9c9f325b9294843e8b3344868d4ca078a2f17842d0c61
|
7
|
+
data.tar.gz: cec814dc4603b6820395e4da94c611352d8a55e4ec3ff22e7195db58ab315ac67163d8a441cfaf88b29bb41b1a49f83a3a353beb652dca3206445dbf5b0ab197
|
data/Gemfile.lock
CHANGED
data/lib/briskly/store.rb
CHANGED
@@ -9,11 +9,12 @@ class Briskly::Store
|
|
9
9
|
def initialize(key)
|
10
10
|
@key = key
|
11
11
|
@store = Trie.new
|
12
|
+
@elements = {}
|
12
13
|
end
|
13
14
|
|
14
15
|
def with(values)
|
15
16
|
@store = Trie.new
|
16
|
-
elements = {}
|
17
|
+
@elements = {}
|
17
18
|
|
18
19
|
values.each_with_index do |value, index|
|
19
20
|
|
@@ -27,15 +28,15 @@ class Briskly::Store
|
|
27
28
|
# We need to make sure we keep the index
|
28
29
|
# and in order to avoid loops always order
|
29
30
|
# the array after each insertion
|
30
|
-
elements[normalised] ||= []
|
31
|
-
elements[normalised].push([element, index])
|
31
|
+
@elements[normalised] ||= []
|
32
|
+
@elements[normalised].push([element, index])
|
32
33
|
.sort! { |a,b| a[1] <=> b[1] }
|
33
34
|
end
|
34
35
|
|
35
36
|
end
|
36
37
|
|
37
38
|
|
38
|
-
elements.each do |key, values|
|
39
|
+
@elements.each do |key, values|
|
39
40
|
@store.add key, values
|
40
41
|
end
|
41
42
|
end
|
data/lib/briskly/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: briskly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pedro Cunha
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: i18n
|