sir_cachealot 0.6.5 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZmRlNmUxM2YwMmNmZjExZWJlNTIwZDg0N2MyNzBhYmYzMzU2ZTQ3Ng==
4
+ NWFkMzBiZTQ3MTM5Nzk4OWRkMDMxZGFhYjRlNGY1MDBhZjY1ZDAzMg==
5
5
  data.tar.gz: !binary |-
6
- ZmJiYzhmZTZjMmNmNDRjMmU0MmMzOTk3NzM1MjFlODQxODA0MDMwZQ==
6
+ MDdhM2FlOTUxMTE4YzBlYmI1MjliOGJmNDVkMmExMWQxMzA4N2Q4MQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZWIxOWIwMjI3MWE0YzUyODIxNDI3NTdkMzE2OTJiYmEzOGI2MWRiZWJjZGUx
10
- MjUzZDhiOWQ2YmJmYmQzN2I1YmE3MzE5NDdkZTQ5Mzk5ZjU5MDRjOWMyNjRh
11
- OTk5YzI5MGQ4NzlhNGY3YWExZTQ4YzMzNDE1YTkzNDJjODcyYWQ=
9
+ YWRlNWVjNTE1NDhiYmM5ZTIxM2ZiNTg4YmVlZDU5ZTkwNGZmYWY2ZmIxNmYx
10
+ ZWYyNmZiZjNiZDJiZjgzMGI1YTk5NmExMGViYjFhNGNkZjI3NGQzNmM3NzBh
11
+ ZTMyYWE5YjAyNWQ2MzkzYWRkNjJmOWQ0ZTRhODQzNThlOTQwZDc=
12
12
  data.tar.gz: !binary |-
13
- YmM4NjA2YTRmMzA3MmVjZTM0NDNiNjFiZDA0ZTIzZmM1OGUwZTEyYTk4YjFh
14
- NjcyMTljNjc2ZGViMTRjNzY4NzQ5NmZkNmRhNzcxNDZlMWI5MmNiZmZhNmM3
15
- YzNkNmE2OWViYzE0YjE2N2M5NDJiMTYyOTNiNDk1MDFiN2JkNTQ=
13
+ MzFkNGFiYjAzZjMxMDUyNTZkMDIzOTkxMjZlZTY3OGQ1NGI2MzNlODgzM2Rl
14
+ NTk2ZGI0MmUyZjA4MjNmMGZiY2YyYTk1MjZkYTU4ZTgwOWYxY2Q3ZWI4YmZi
15
+ ZTU0MDljYzhhM2Y4YWJiMGUwZWRiMzcxOWQyZDRiZjYwYTkzNzE=
@@ -148,7 +148,7 @@ class Sir::Backends::Base
148
148
 
149
149
  def self.valid?(hash)
150
150
  return "Key must coerce to a symbol" unless hash[:key].respond_to?(:intern) if hash[:key]
151
- return "Time must coerce to a valid timestamp or timespan in seconds" unless (hash[:expiry].is_a?(Time) || hash[:expiry].is_a?(Integer)) if hash[:expiry]
151
+ return "Time must coerce to a valid timestamp or timespan in seconds" unless (hash[:expiry].is_a?(Time) || hash[:expiry].is_a?(Integer) || (defined?(Rails) && hash[:expiry].is_a?(DateTime) )) if hash[:expiry]
152
152
  end
153
153
 
154
154
  end
@@ -93,7 +93,7 @@ class Sir::Backends::RedisCache < Sir::Backends::Base
93
93
  invalid = self.valid?({ key: key })
94
94
  raise ArgumentError, invalid if invalid
95
95
 
96
- if @@redis_driver.del(self::nsed_key(key))
96
+ if @@redis.del(self::nsed_key(key))
97
97
  return true
98
98
  end
99
99
  end
data/lib/sir/backends.rb CHANGED
@@ -1,4 +1,3 @@
1
- $stderr.puts "required #{$0}"
2
1
  module Sir::Backends
3
2
  end
4
3
 
data/lib/sir/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Sir
2
- VERSION = "0.6.5"
3
- end
2
+ VERSION = "0.6.7"
3
+ end
@@ -1,12 +1,20 @@
1
1
  # -*- encoding: utf-8 -*-
2
+ dir = "#{File.expand_path(File.dirname(__FILE__))}/lib"
3
+ $LOAD_PATH.unshift(dir) unless $LOAD_PATH.include?(dir)
4
+
2
5
  require 'sir/version'
3
6
 
7
+ #$stderr.puts $LOAD_PATH
8
+
4
9
  Gem::Specification.new do |gem|
10
+
5
11
  gem.name = "sir_cachealot"
6
12
  gem.licenses = ["BSD-2-Clause"]
7
- gem.version = "0.6.5"
13
+ gem.version = Sir::VERSION
14
+
8
15
  gem.authors = ["Lyjia / Tom Corelis"]
9
16
  gem.email = ["tom@tomcorelis.com"]
17
+
10
18
  gem.description = %q{A dead simple RAM keystore}
11
19
  gem.summary = %q{ SirCachealot is a drop-in memcache-like RAM cache for Ruby. Cache entries are saved and recalled by a key string, and their values can hold (most) anything a Ruby object can hold. Values can also expire, however expiration is only checked when the key is called, or a manual sweeper is run. }
12
20
  gem.homepage = "https://github.com/lyjia/sircachealot"
@@ -16,9 +24,7 @@ Gem::Specification.new do |gem|
16
24
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
17
25
  gem.require_paths = ["lib"]
18
26
 
19
-
20
27
  gem.add_development_dependency 'redis', '~> 3.0.7'
21
-
22
28
  gem.add_development_dependency 'rspec', '~> 2.5'
23
29
  gem.add_development_dependency 'awesome_print'
24
30
 
data/spec/redis_spec.rb CHANGED
@@ -91,6 +91,13 @@ describe "SirCachealot Redis support" do
91
91
  (Sir.get(:asdoiajdoaijdaodijaodiajdoaidjaodijaodij)).should == nil
92
92
  end
93
93
 
94
+ it 'should be able to delete a key' do
95
+ k = :alasdiauhdaiudhai
96
+ Sir.put(k, "test")
97
+ Sir.kill(k)
98
+ Sir.get(k).should == nil
99
+ end
100
+
94
101
  it 'should immediately expire a 0-expiry key' do
95
102
  Sir.put(:expire, TEST, 0)
96
103
  sleep(1)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sir_cachealot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.5
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lyjia / Tom Corelis
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-06 00:00:00.000000000 Z
11
+ date: 2014-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: redis