dkastner-moneta 1.0.6 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  begin
2
4
  require "mongo"
3
5
  rescue LoadError
@@ -36,7 +38,7 @@ module Moneta
36
38
 
37
39
  def [](key)
38
40
  res = @cache.find_one('_id' => key_for(key))
39
- res && deserialize(res['data'].to_s)
41
+ res ? res['data'] : nil
40
42
  end
41
43
 
42
44
  def delete(key, *)
@@ -49,9 +51,8 @@ module Moneta
49
51
 
50
52
  def store(key, value, *)
51
53
  key = key_for(key)
52
- buffer = BSON::ByteBuffer.new serialize(value)
53
54
  @cache.update({ '_id' => key },
54
- { '_id' => key, 'data' => buffer.to_s },
55
+ { '_id' => key, 'data' => value },
55
56
  { :upsert => true })
56
57
  end
57
58
 
@@ -1,3 +1,3 @@
1
1
  module Moneta
2
- VERSION = '1.0.6'
2
+ VERSION = '1.1.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dkastner-moneta
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -14,7 +14,7 @@ date: 2011-02-10 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
17
- requirement: &2153963480 !ruby/object:Gem::Requirement
17
+ requirement: &2154443400 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: '0'
23
23
  type: :development
24
24
  prerelease: false
25
- version_requirements: *2153963480
25
+ version_requirements: *2154443400
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rake
28
- requirement: &2153962860 !ruby/object:Gem::Requirement
28
+ requirement: &2154442860 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ! '>='
@@ -33,10 +33,10 @@ dependencies:
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
- version_requirements: *2153962860
36
+ version_requirements: *2154442860
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: rspec
39
- requirement: &2153962280 !ruby/object:Gem::Requirement
39
+ requirement: &2154441780 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
42
  - - ! '>='
@@ -44,7 +44,7 @@ dependencies:
44
44
  version: '0'
45
45
  type: :development
46
46
  prerelease: false
47
- version_requirements: *2153962280
47
+ version_requirements: *2154441780
48
48
  description: A unified interface to key/value stores
49
49
  email:
50
50
  - wycats@gmail.com
@@ -122,7 +122,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
122
122
  version: '0'
123
123
  segments:
124
124
  - 0
125
- hash: -1965399956378123003
125
+ hash: -3990472740534807466
126
126
  required_rubygems_version: !ruby/object:Gem::Requirement
127
127
  none: false
128
128
  requirements:
@@ -131,7 +131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  version: '0'
132
132
  segments:
133
133
  - 0
134
- hash: -1965399956378123003
134
+ hash: -3990472740534807466
135
135
  requirements: []
136
136
  rubyforge_project:
137
137
  rubygems_version: 1.8.5