look_up_table 0.1.0.rc7 → 0.1.0.rc8

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module LookUpTable
2
- VERSION = "0.1.0.rc7"
2
+ VERSION = "0.1.0.rc8"
3
3
  end
data/lib/look_up_table.rb CHANGED
@@ -18,6 +18,7 @@ module LookUpTable
18
18
  def look_up_table(lut_name, options={}, &block)
19
19
  options = {
20
20
  :batch_size => 10000,
21
+ :prefix => "",
21
22
  :read_on_init => false,
22
23
  :skip_memcached => false,
23
24
  :sql_mode => true,
@@ -193,7 +194,8 @@ module LookUpTable
193
194
 
194
195
  # Reads a single item of a LookUpTable from Cache
195
196
  def lut_read_cache_item(name, item)
196
- Rails.cache.read("#{name}/#{item}")
197
+ prefix = lut_options(name)[:prefix]
198
+ Rails.cache.read("#{prefix}#{name}/#{item}")
197
199
  end
198
200
 
199
201
  # Write a LookUpTable into Cache
@@ -257,7 +259,8 @@ module LookUpTable
257
259
 
258
260
  # Write a single Item into LookUpTable-Cache
259
261
  def lut_write_cache_item(name, lut_item, lut_data)
260
- status = Rails.cache.write("#{name}/#{lut_item}", lut_data)
262
+ prefix = lut_options(name)[:prefix]
263
+ status = Rails.cache.write("#{prefix}#{name}/#{lut_item}", lut_data)
261
264
  raise "Cache::write failed - Try lower :batch_size" unless status
262
265
  end
263
266
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: look_up_table
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.rc7
4
+ version: 0.1.0.rc8
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2011-11-01 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
16
- requirement: &79309320 !ruby/object:Gem::Requirement
16
+ requirement: &74205900 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.1.1
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *79309320
24
+ version_requirements: *74205900
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sqlite3
27
- requirement: &79309060 !ruby/object:Gem::Requirement
27
+ requirement: &74205620 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *79309060
35
+ version_requirements: *74205620
36
36
  description: A simple LookUpTable to cache large (!) and static(!) data
37
37
  email:
38
38
  - ph@werbeboten.de
@@ -102,7 +102,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
102
102
  version: '0'
103
103
  segments:
104
104
  - 0
105
- hash: 43198579
105
+ hash: 223916253
106
106
  required_rubygems_version: !ruby/object:Gem::Requirement
107
107
  none: false
108
108
  requirements: