alephant-lookup 0.1.7 → 0.1.9

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: 3721f4977e35f2aa609dd85c2c9debfae8fd7dac
4
- data.tar.gz: cc50c1eee20d3a282b2c5bde7c46eb5744942b30
3
+ metadata.gz: 95e2d7b538bafec3a28aad317244e9647b9377a5
4
+ data.tar.gz: a4c35add97115d6265967e2f9643a8cb291d3eae
5
5
  SHA512:
6
- metadata.gz: 60bc1d72053a8970d0542e46d322fd9fc2535bc492fa052ad0217a68feda5477f6a7e0d86b868fc69bfa3366d396238091b2ad424cd8474834543ba7dd76c3f6
7
- data.tar.gz: de5efa73bebc058ebbb21d8c28f81fbe745c9308fc40840ae10d90e776372a0cdb4352c1ad96ef6bddc348b014f4a52f5b628d393a060ff91dfe6ece65eeaede
6
+ metadata.gz: e2a7bd5b2a401f1edbdc58a3039bde4d2b8ad56c344a2e1bb04c2bd2ebbcbff4768296ffc50ecf8fcaf6dd4eee0ac0ce4dc311f0c9e6c277dfdc3bb09d7e1260
7
+ data.tar.gz: 24d33f515d60aa81e1af038c1b4f084ccd10d68998dcdd2c340441d482e3150b6d844639dc802f34cdda188099790c635b93f93368c87cbf7cb3b3f4a2fdc5b8
@@ -2,13 +2,16 @@ require "alephant/lookup/version"
2
2
  require "alephant/lookup/lookup_helper"
3
3
  require "alephant/lookup/lookup_table"
4
4
 
5
+ require 'alephant/logger'
6
+
5
7
  module Alephant
6
8
  module Lookup
9
+ include ::Alephant::Logger
7
10
  @@lookup_tables = {}
8
11
 
9
- def self.create(table_name)
12
+ def self.create(table_name, logger = nil)
10
13
  @@lookup_tables[table_name] ||= LookupTable.new(table_name)
11
- LookupHelper.new(@@lookup_tables[table_name])
14
+ LookupHelper.new(@@lookup_tables[table_name], logger)
12
15
  end
13
16
  end
14
17
  end
@@ -1,21 +1,33 @@
1
1
  require "alephant/lookup/lookup_table"
2
2
  require "alephant/lookup/lookup_query"
3
3
 
4
+ require 'alephant/logger'
5
+
4
6
  module Alephant
5
7
  module Lookup
6
8
  class LookupHelper
9
+ include Logger
10
+
7
11
  attr_reader :lookup_table
8
12
 
9
- def initialize(lookup_table)
13
+ def initialize(lookup_table, logger)
14
+ Logger.set_logger(logger) unless logger.nil?
15
+
16
+ logger.info "LookupHelper#initialize(#{lookup_table.table_name})"
17
+
10
18
  @lookup_table = lookup_table
11
19
  @lookup_table.create
12
20
  end
13
21
 
14
22
  def read(id, opts, batch_version)
23
+ logger.info "LookupHelper#read(#{id}, #{opts}, #{batch_version})"
24
+
15
25
  LookupQuery.new(lookup_table.table_name, id, opts, batch_version).run!
16
26
  end
17
27
 
18
28
  def write(id, opts, batch_version, location)
29
+ logger.info "LookupHelper#write(#{id}, #{opts}, #{batch_version}, #{location})"
30
+
19
31
  LookupLocation.new(id, opts, batch_version, location).tap do |l|
20
32
  lookup_table.table.batch_put([
21
33
  {
@@ -1,5 +1,5 @@
1
1
  module Alephant
2
2
  module Lookup
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.9"
4
4
  end
5
5
  end
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.7
4
+ version: 0.1.9
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-02 00:00:00.000000000 Z
11
+ date: 2014-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -243,4 +243,3 @@ summary: Lookup a location in S3 using DynamoDB.
243
243
  test_files:
244
244
  - spec/lookup_spec.rb
245
245
  - spec/spec_helper.rb
246
- has_rdoc: