mongo-i18n 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mongo-i18n/store.rb +6 -2
- data/lib/mongo-i18n/version.rb +1 -1
- data/spec/mongo-i18n/store_spec.rb +5 -0
- metadata +24 -12
data/lib/mongo-i18n/store.rb
CHANGED
@@ -27,7 +27,11 @@ module MongoI18n
|
|
27
27
|
end
|
28
28
|
keys
|
29
29
|
end
|
30
|
-
|
30
|
+
|
31
|
+
def del(key)
|
32
|
+
collection.remove({:_id => key})
|
33
|
+
end
|
34
|
+
|
31
35
|
# Thankfully borrowed from Jodosha's redis-store
|
32
36
|
# https://github.com/jodosha/redis-store/blob/master/lib/i18n/backend/redis.rb
|
33
37
|
def available_locales
|
@@ -38,4 +42,4 @@ module MongoI18n
|
|
38
42
|
locales
|
39
43
|
end
|
40
44
|
end
|
41
|
-
end
|
45
|
+
end
|
data/lib/mongo-i18n/version.rb
CHANGED
@@ -30,6 +30,11 @@ describe MongoI18n::Store do
|
|
30
30
|
store['foo'].should == 'bar'
|
31
31
|
end
|
32
32
|
|
33
|
+
it "should remove foo" do
|
34
|
+
store.del("foo")
|
35
|
+
store.keys.include?('foo').should be_false
|
36
|
+
end
|
37
|
+
|
33
38
|
it "should always set key as string" do
|
34
39
|
store[:baz] = 'wick'
|
35
40
|
doc = collection.find_one(:_id => 'baz')
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo-i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alexander Ulizko
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-10-02 00:00:00 +04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -24,20 +24,32 @@ dependencies:
|
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 3
|
30
30
|
segments:
|
31
|
-
-
|
32
|
-
|
33
|
-
- 4
|
34
|
-
version: 1.1.4
|
31
|
+
- 0
|
32
|
+
version: "0"
|
35
33
|
type: :runtime
|
36
34
|
version_requirements: *id001
|
37
35
|
- !ruby/object:Gem::Dependency
|
38
|
-
name:
|
36
|
+
name: bson_ext
|
39
37
|
prerelease: false
|
40
38
|
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id002
|
49
|
+
- !ruby/object:Gem::Dependency
|
50
|
+
name: rspec
|
51
|
+
prerelease: false
|
52
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
41
53
|
none: false
|
42
54
|
requirements:
|
43
55
|
- - ~>
|
@@ -49,7 +61,7 @@ dependencies:
|
|
49
61
|
- 0
|
50
62
|
version: 2.3.0
|
51
63
|
type: :development
|
52
|
-
version_requirements: *
|
64
|
+
version_requirements: *id003
|
53
65
|
description: MongoDB backend implementation for I18n gem.
|
54
66
|
email:
|
55
67
|
- alexander@ulizko.com
|