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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 95e2d7b538bafec3a28aad317244e9647b9377a5
4
- data.tar.gz: a4c35add97115d6265967e2f9643a8cb291d3eae
3
+ metadata.gz: 2dd351965cd12a44c7c28fa7d1ff14a0b63ea3ee
4
+ data.tar.gz: 6699863b7fc4d97b4dfd4cc987c832d86aa455cf
5
5
  SHA512:
6
- metadata.gz: e2a7bd5b2a401f1edbdc58a3039bde4d2b8ad56c344a2e1bb04c2bd2ebbcbff4768296ffc50ecf8fcaf6dd4eee0ac0ce4dc311f0c9e6c277dfdc3bb09d7e1260
7
- data.tar.gz: 24d33f515d60aa81e1af038c1b4f084ccd10d68998dcdd2c340441d482e3150b6d844639dc802f34cdda188099790c635b93f93368c87cbf7cb3b3f4a2fdc5b8
6
+ metadata.gz: de5dfae1a098baebd2a25cbc418e4e8b696339a172acb95536c4ad9afd83addc4b574b284ffcc9e6ec9c31eff2887f5fcf924a1778c506f28dc85e32878800c4
7
+ data.tar.gz: 3dea58769882c33d0159b6a6a64b61708e99780ff62ca5273608244b70cfb09843846ad8ad1bf7a3adf4ae59adee87c3c8e8217e4cb445e2b621b7230f343013
data/.hound.yml ADDED
@@ -0,0 +1,3 @@
1
+ StringLiterals:
2
+ EnforcedStyle: double_quotes
3
+ Enabled: true
@@ -6,12 +6,12 @@ require 'alephant/logger'
6
6
 
7
7
  module Alephant
8
8
  module Lookup
9
- include ::Alephant::Logger
9
+ include Logger
10
10
  @@lookup_tables = {}
11
11
 
12
- def self.create(table_name, logger = nil)
12
+ def self.create(table_name)
13
13
  @@lookup_tables[table_name] ||= LookupTable.new(table_name)
14
- LookupHelper.new(@@lookup_tables[table_name], logger)
14
+ LookupHelper.new(@@lookup_tables[table_name], Logger.get_logger)
15
15
  end
16
16
  end
17
17
  end
@@ -11,7 +11,7 @@ module Alephant
11
11
  attr_reader :lookup_table
12
12
 
13
13
  def initialize(lookup_table, logger)
14
- Logger.set_logger(logger) unless logger.nil?
14
+ Logger.set_logger(logger)
15
15
 
16
16
  logger.info "LookupHelper#initialize(#{lookup_table.table_name})"
17
17
 
@@ -1,5 +1,5 @@
1
1
  module Alephant
2
2
  module Lookup
3
- VERSION = "0.1.9"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  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
@@ -3,4 +3,5 @@ $: << File.join(File.dirname(__FILE__),"..", "lib")
3
3
  require 'pry'
4
4
  require 'alephant/lookup'
5
5
  require 'crimp'
6
+ require 'logger'
6
7
 
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.1.9
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-08 00:00:00.000000000 Z
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: