alephant-lookup 0.1.9 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.hound.yml +3 -0
- data/lib/alephant/lookup.rb +3 -3
- data/lib/alephant/lookup/lookup_helper.rb +1 -1
- data/lib/alephant/lookup/version.rb +1 -1
- data/spec/lookup_spec.rb +6 -4
- data/spec/spec_helper.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dd351965cd12a44c7c28fa7d1ff14a0b63ea3ee
|
4
|
+
data.tar.gz: 6699863b7fc4d97b4dfd4cc987c832d86aa455cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de5dfae1a098baebd2a25cbc418e4e8b696339a172acb95536c4ad9afd83addc4b574b284ffcc9e6ec9c31eff2887f5fcf924a1778c506f28dc85e32878800c4
|
7
|
+
data.tar.gz: 3dea58769882c33d0159b6a6a64b61708e99780ff62ca5273608244b70cfb09843846ad8ad1bf7a3adf4ae59adee87c3c8e8217e4cb445e2b621b7230f343013
|
data/.hound.yml
ADDED
data/lib/alephant/lookup.rb
CHANGED
@@ -6,12 +6,12 @@ require 'alephant/logger'
|
|
6
6
|
|
7
7
|
module Alephant
|
8
8
|
module Lookup
|
9
|
-
include
|
9
|
+
include Logger
|
10
10
|
@@lookup_tables = {}
|
11
11
|
|
12
|
-
def self.create(table_name
|
12
|
+
def self.create(table_name)
|
13
13
|
@@lookup_tables[table_name] ||= LookupTable.new(table_name)
|
14
|
-
LookupHelper.new(@@lookup_tables[table_name],
|
14
|
+
LookupHelper.new(@@lookup_tables[table_name], Logger.get_logger)
|
15
15
|
end
|
16
16
|
end
|
17
17
|
end
|
data/spec/lookup_spec.rb
CHANGED
@@ -17,8 +17,9 @@ describe Alephant::Lookup do
|
|
17
17
|
describe "#initialize(table_name)" do
|
18
18
|
it "calls create on lookup_table" do
|
19
19
|
table = double()
|
20
|
+
table.should_receive(:table_name)
|
20
21
|
table.should_receive(:create)
|
21
|
-
subject.new(table)
|
22
|
+
subject.new(table, Logger.new(STDOUT))
|
22
23
|
end
|
23
24
|
end
|
24
25
|
|
@@ -63,7 +64,7 @@ describe Alephant::Lookup do
|
|
63
64
|
table = double().as_null_object
|
64
65
|
table.stub(:table_name).and_return("table_name")
|
65
66
|
|
66
|
-
instance = subject.new(table)
|
67
|
+
instance = subject.new(table, Logger.new(STDOUT))
|
67
68
|
lookup = instance.read("id", 0, {:variant => "foo"})
|
68
69
|
|
69
70
|
expect(lookup.location).to eq("/location")
|
@@ -98,7 +99,7 @@ describe Alephant::Lookup do
|
|
98
99
|
.stub(:lookup_table)
|
99
100
|
.and_return(lookup_table)
|
100
101
|
|
101
|
-
instance = subject.new(lookup_table)
|
102
|
+
instance = subject.new(lookup_table, Logger.new(STDOUT))
|
102
103
|
instance.write("id",{},"0","/location")
|
103
104
|
end
|
104
105
|
end
|
@@ -107,9 +108,10 @@ describe Alephant::Lookup do
|
|
107
108
|
it "deletes all table rows" do
|
108
109
|
table = double()
|
109
110
|
table.stub(:create)
|
111
|
+
table.should_receive(:table_name)
|
110
112
|
table.should_receive(:truncate!)
|
111
113
|
|
112
|
-
subject = Alephant::Lookup::LookupHelper.new(table)
|
114
|
+
subject = Alephant::Lookup::LookupHelper.new(table, Logger.new(STDOUT))
|
113
115
|
subject.truncate!
|
114
116
|
end
|
115
117
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: alephant-lookup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robert Kenny
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -200,6 +200,7 @@ extensions: []
|
|
200
200
|
extra_rdoc_files: []
|
201
201
|
files:
|
202
202
|
- .gitignore
|
203
|
+
- .hound.yml
|
203
204
|
- .ruby-version
|
204
205
|
- .travis.yml
|
205
206
|
- Gemfile
|
@@ -243,3 +244,4 @@ summary: Lookup a location in S3 using DynamoDB.
|
|
243
244
|
test_files:
|
244
245
|
- spec/lookup_spec.rb
|
245
246
|
- spec/spec_helper.rb
|
247
|
+
has_rdoc:
|