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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cc09fb91d10b8b72f768bdda7498d3b245ecb4c4
4
- data.tar.gz: a643a2fbb0bc19a203baf9e267377e66b730c889
3
+ metadata.gz: df7110ca2e129d80ed1fddff2ddac4586df49e40
4
+ data.tar.gz: 0a24ed790f82bef7d4f846d3c48e624e4b0d23d7
5
5
  SHA512:
6
- metadata.gz: b95555fac955a3aa13adafb120ac63dfedd561d585bb9dedadbd53484fb1c91cb0dfd26f31b18c8df2f50c2d791215f8ddfe1ef1bc1a1a5532765d65f7cbdc18
7
- data.tar.gz: 738eb8736657105116025df1e2403ead482eeb6e8f311c479918a34e66bc7e29ade269bf6572f64a7e3c7461c3c63dafee1390c82b085e8ce0d10ac585607ba1
6
+ metadata.gz: f1e85a6d1d326a130608a6b746dd02045daa334ff45e1b48b741ccaf5f29d77f5c9aeb57526b4d657de9c9f325b9294843e8b3344868d4ca078a2f17842d0c61
7
+ data.tar.gz: cec814dc4603b6820395e4da94c611352d8a55e4ec3ff22e7195db58ab315ac67163d8a441cfaf88b29bb41b1a49f83a3a353beb652dca3206445dbf5b0ab197
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- briskly (0.1.2)
4
+ briskly (0.1.3)
5
5
  fast_trie
6
6
  i18n
7
7
 
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
@@ -1,6 +1,6 @@
1
1
  require 'pathname'
2
2
 
3
3
  module Briskly
4
- VERSION = '0.1.2'
4
+ VERSION = '0.1.3'
5
5
  GEMDIR = Pathname.new(__FILE__).parent.parent.parent
6
6
  end
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.2
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-17 00:00:00.000000000 Z
11
+ date: 2014-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n