coffee_table 0.2.11 → 0.2.12

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: 31cf154dad681cf4398fcc66ab74fc5ab96a9262
4
- data.tar.gz: e59d8bf7a66f94ead5720df0a7bad921d2711e3f
3
+ metadata.gz: fee2e1ac835d575263dd819e6fd16b08ea050767
4
+ data.tar.gz: 51f4a70b7b890bc9d84b2249ac0dc3479985c335
5
5
  SHA512:
6
- metadata.gz: 8bbd12595eef8c4aef7e69b04853c8a9b1af6db7ce3ab47ccf50739acc9e23e4dd735e68180472b698f0907d57d62d50044d4786afbb27d50528c575a6a43f8b
7
- data.tar.gz: 399f6a694a000d212ae0731e592f7d78c375aa8d29c2f6494ea41cb654aebcace24716aad31e65d06cdcf7a548c225ab2a55b494579b2e025a0429b9a0f514cf
6
+ metadata.gz: b0cad5dbb073a07ce1a78af5376deb303eb1f7a128c1c2c73d75ea89f589f8515a537fb59cb7c85799ad0b0174744a3a45e1bd0ba1718afb2cce19da3e116b5f
7
+ data.tar.gz: 0f9450b337d1c52c8b0f5ea0467d0c414a565be14d021f9a83678d35fdcad06e5561d4656b0f1220aea9403df276c04d5c3ac894d366d03c9744669f50fcc88e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- coffee_table (0.2.8)
4
+ coffee_table (0.2.11)
5
5
  activesupport
6
6
  gzip
7
7
  redis
@@ -29,14 +29,15 @@ GEM
29
29
  file-tail (1.2.0)
30
30
  tins (~> 1.0)
31
31
  gzip (1.0)
32
- i18n (0.8.6)
32
+ i18n (0.9.3)
33
+ concurrent-ruby (~> 1.0)
33
34
  mime-types (1.23)
34
- minitest (5.10.3)
35
+ minitest (5.11.3)
35
36
  mock_redis (0.17.0)
36
37
  multi_json (1.7.8)
37
- redis (3.3.3)
38
- redis-namespace (1.5.3)
39
- redis (~> 3.0, >= 3.0.4)
38
+ redis (4.0.1)
39
+ redis-namespace (1.6.0)
40
+ redis (>= 3.0.4)
40
41
  rest-client (1.6.7)
41
42
  mime-types (>= 1.16)
42
43
  rspec (2.14.1)
@@ -65,8 +66,8 @@ GEM
65
66
  spork (0.9.2)
66
67
  thor (0.18.1)
67
68
  thread_safe (0.3.6)
68
- tins (1.15.0)
69
- tzinfo (1.2.3)
69
+ tins (1.16.3)
70
+ tzinfo (1.2.4)
70
71
  thread_safe (~> 0.1)
71
72
 
72
73
  PLATFORMS
@@ -81,4 +82,4 @@ DEPENDENCIES
81
82
  spork
82
83
 
83
84
  BUNDLED WITH
84
- 1.15.4
85
+ 1.16.1
data/changelog.txt CHANGED
@@ -1,3 +1,6 @@
1
+ 0.2.12
2
+ - fixing some specs
3
+
1
4
  0.2.11
2
5
  - removed awesome_print require
3
6
 
data/lib/coffee_table.rb CHANGED
@@ -9,6 +9,8 @@ require 'redis-namespace'
9
9
  require 'active_support/inflector'
10
10
  require 'digest/md5'
11
11
  require 'gzip'
12
+ require 'awesome_print'
13
+ require 'active_support/hash_with_indifferent_access'
12
14
 
13
15
  module CoffeeTable
14
16
  class Cache
@@ -17,7 +19,7 @@ module CoffeeTable
17
19
 
18
20
  # initialize for coffee_table. takes options to setup behaviour of cache
19
21
  def initialize(options={})
20
- @options = options
22
+ @options = options.symbolize_keys
21
23
 
22
24
  default_enable_cache_to true
23
25
  default_redis_namespace_to :coffee_table
@@ -28,13 +30,19 @@ module CoffeeTable
28
30
  default_compress_content_to true
29
31
  default_compress_min_size_to 10240
30
32
 
33
+ redis_client = nil
31
34
  if !@options[:redis].nil?
32
- @redis = Redis::Namespace.new(@options[:redis_namespace], :redis => @options[:redis])
35
+ redis_client = @options[:redis]
33
36
  elsif @options.has_key?(:redis_url)
34
- @redis = Redis::Namespace.new(@options[:redis_namespace], {:url => @options[:redis_url]})
37
+ redis_client = Redis.new(:url => @options[:redis_url])
35
38
  else
36
- @redis = Redis::Namespace.new(@options[:redis_namespace], {:host => @options[:redis_server], :port => @options[:redis_port]})
39
+ redis_client = Redis.new(:host => @options[:redis_server], :port => @options[:redis_port])
37
40
  end
41
+
42
+ @redis = Redis::Namespace.new(@options[:redis_namespace], :redis => redis_client)
43
+
44
+ self
45
+
38
46
  end
39
47
 
40
48
 
@@ -1,3 +1,3 @@
1
1
  module CoffeeTable
2
- VERSION = "0.2.11"
2
+ VERSION = "0.2.12"
3
3
  end
@@ -50,8 +50,7 @@ describe CoffeeTable::Cache do
50
50
  context "compressing" do
51
51
 
52
52
  before(:each) do
53
- @redis = Redis::Namespace.new("coffee_table", {:server => "127.0.0.1", :port => 6379})
54
-
53
+ @redis = Redis::Namespace.new("coffee_table", :redis => Redis.new)
55
54
  end
56
55
 
57
56
  it "compresses on strings greater than limit" do
data/spec/spec_helper.rb CHANGED
@@ -6,7 +6,7 @@ Coveralls.wear!
6
6
 
7
7
  require 'digest/md5'
8
8
  require 'spork'
9
- require 'mock_redis'
9
+ # require 'mock_redis'
10
10
  require File.expand_path(File.dirname(__FILE__) + '/../../coffee_table/spec/lib/sample_class')
11
11
  require File.expand_path(File.dirname(__FILE__) + '/../../coffee_table/spec/lib/sample_class_without_id')
12
12
 
@@ -23,8 +23,8 @@ Spork.each_run do
23
23
  config.before(:each) {
24
24
 
25
25
 
26
- redis = double(:redis)
27
- Redis.stub(:new).and_return(MockRedis.new)
26
+ # redis = double(:redis)
27
+ # Redis.stub(:new).and_return(MockRedis.new)
28
28
  CoffeeTable::Cache.new.expire_all
29
29
 
30
30
  }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coffee_table
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.11
4
+ version: 0.2.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stewart McKee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-28 00:00:00.000000000 Z
11
+ date: 2018-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec