redis-settings 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +42 -23
- data/lib/redis/settings/active_record.rb +1 -1
- data/lib/redis/settings/version.rb +1 -1
- data/redis-settings.gemspec +1 -0
- data/spec/redis/settings/active_record_spec.rb +11 -9
- metadata +33 -33
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: df5f0df578352c17f953c3ab92a1e7914f632928
|
4
|
+
data.tar.gz: c5ac3638c27316261fcf2a5f910206c60cc85c25
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 20feb73ec99bb52757b4475f8155526f64589b6027ecbcde8d1696eaea78c2976f78346cfe540765a914fb8c0bb6be52c7f32f64362663131cdad2cf60be5b5e
|
7
|
+
data.tar.gz: 1787edb1ec0d95f938893bcb020f5f683935f1c9a380dd24d146c4182cc7d7aa485740f5378c56ac1978de8d8b678d48563ff366650204073e383fdb2adf3fb4
|
data/Gemfile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
source
|
1
|
+
source "https://rubygems.org"
|
2
2
|
gemspec
|
data/Gemfile.lock
CHANGED
@@ -1,48 +1,67 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
redis-settings (0.2.
|
4
|
+
redis-settings (0.2.3)
|
5
5
|
redis
|
6
6
|
|
7
7
|
GEM
|
8
|
-
remote:
|
8
|
+
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activemodel (3.2.
|
11
|
-
activesupport (= 3.2.
|
10
|
+
activemodel (3.2.13)
|
11
|
+
activesupport (= 3.2.13)
|
12
12
|
builder (~> 3.0.0)
|
13
|
-
activerecord (3.2.
|
14
|
-
activemodel (= 3.2.
|
15
|
-
activesupport (= 3.2.
|
13
|
+
activerecord (3.2.13)
|
14
|
+
activemodel (= 3.2.13)
|
15
|
+
activesupport (= 3.2.13)
|
16
16
|
arel (~> 3.0.2)
|
17
17
|
tzinfo (~> 0.3.29)
|
18
|
-
activesupport (3.2.
|
19
|
-
i18n (
|
18
|
+
activesupport (3.2.13)
|
19
|
+
i18n (= 0.6.1)
|
20
20
|
multi_json (~> 1.0)
|
21
21
|
arel (3.0.2)
|
22
|
+
awesome_print (1.1.0)
|
22
23
|
builder (3.0.4)
|
23
|
-
|
24
|
+
coderay (1.0.9)
|
25
|
+
diff-lcs (1.2.4)
|
24
26
|
i18n (0.6.1)
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
27
|
+
method_source (0.8.1)
|
28
|
+
multi_json (1.7.5)
|
29
|
+
pry (0.9.12.2)
|
30
|
+
coderay (~> 1.0.5)
|
31
|
+
method_source (~> 0.8)
|
32
|
+
slop (~> 3.4)
|
33
|
+
pry-meta (0.0.5)
|
34
|
+
awesome_print
|
35
|
+
pry
|
36
|
+
pry-nav
|
37
|
+
pry-remote
|
38
|
+
pry-nav (0.2.3)
|
39
|
+
pry (~> 0.9.10)
|
40
|
+
pry-remote (0.1.7)
|
41
|
+
pry (~> 0.9)
|
42
|
+
slop (~> 3.0)
|
43
|
+
rake (10.0.4)
|
44
|
+
redis (3.0.4)
|
45
|
+
redis-namespace (1.3.0)
|
29
46
|
redis (~> 3.0.0)
|
30
|
-
rspec (2.
|
31
|
-
rspec-core (~> 2.
|
32
|
-
rspec-expectations (~> 2.
|
33
|
-
rspec-mocks (~> 2.
|
34
|
-
rspec-core (2.
|
35
|
-
rspec-expectations (2.
|
36
|
-
diff-lcs (
|
37
|
-
rspec-mocks (2.
|
47
|
+
rspec (2.13.0)
|
48
|
+
rspec-core (~> 2.13.0)
|
49
|
+
rspec-expectations (~> 2.13.0)
|
50
|
+
rspec-mocks (~> 2.13.0)
|
51
|
+
rspec-core (2.13.1)
|
52
|
+
rspec-expectations (2.13.0)
|
53
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
54
|
+
rspec-mocks (2.13.1)
|
55
|
+
slop (3.4.5)
|
38
56
|
sqlite3 (1.3.7)
|
39
|
-
tzinfo (0.3.
|
57
|
+
tzinfo (0.3.37)
|
40
58
|
|
41
59
|
PLATFORMS
|
42
60
|
ruby
|
43
61
|
|
44
62
|
DEPENDENCIES
|
45
63
|
activerecord
|
64
|
+
pry-meta
|
46
65
|
rake
|
47
66
|
redis-namespace
|
48
67
|
redis-settings!
|
data/redis-settings.gemspec
CHANGED
@@ -1,14 +1,9 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
3
|
describe Redis::Settings::ActiveRecord do
|
4
|
-
let(:user) { User.create }
|
5
|
-
let(:admin) { Admin::User.create }
|
6
|
-
let(:root) { Redis::Settings.root_namespace }
|
7
|
-
|
8
|
-
before do
|
9
|
-
user.settings.clear
|
10
|
-
admin.settings.clear
|
11
|
-
end
|
4
|
+
let!(:user) { User.create! }
|
5
|
+
let!(:admin) { Admin::User.create! }
|
6
|
+
let!(:root) { Redis::Settings.root_namespace }
|
12
7
|
|
13
8
|
it "injects settings method" do
|
14
9
|
User.new.should respond_to(:settings)
|
@@ -20,6 +15,12 @@ describe Redis::Settings::ActiveRecord do
|
|
20
15
|
}.to raise_error(Redis::Settings::NewRecordError)
|
21
16
|
end
|
22
17
|
|
18
|
+
it "doesn't raise exception if new record was destroyed" do
|
19
|
+
expect {
|
20
|
+
User.new { |u| u.id = 7 }.destroy
|
21
|
+
}.to_not raise_error(Redis::Settings::NewRecordError)
|
22
|
+
end
|
23
|
+
|
23
24
|
it "sets namespace accordingly" do
|
24
25
|
user.settings.namespace.should == "#{root}/user/#{user.id}"
|
25
26
|
admin.settings.namespace.should == "#{root}/admin/user/#{admin.id}"
|
@@ -36,6 +37,7 @@ describe Redis::Settings::ActiveRecord do
|
|
36
37
|
it "removes all settings when destroy a record" do
|
37
38
|
user.settings[:role] = "customer"
|
38
39
|
user.destroy
|
39
|
-
Redis::Settings.connection.hgetall("#{root}/user/#{user.id}")
|
40
|
+
settings = Redis::Settings.connection.hgetall("#{root}/user/#{user.id}")
|
41
|
+
expect(settings).to be_empty
|
40
42
|
end
|
41
43
|
end
|
metadata
CHANGED
@@ -1,110 +1,111 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis-settings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Nando Vieira
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-06-03 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: redis
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rake
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - '>='
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - '>='
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rspec
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - '>='
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - '>='
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: activerecord
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - '>='
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - '>='
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: redis-namespace
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - '>='
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - '>='
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: sqlite3
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - '>='
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '0'
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - '>='
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: pry-meta
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
108
109
|
- !ruby/object:Gem::Version
|
109
110
|
version: '0'
|
110
111
|
description: Store application and user settings on Redis. Comes with ActiveRecord
|
@@ -133,26 +134,25 @@ files:
|
|
133
134
|
- spec/support/user.rb
|
134
135
|
homepage: http://github.com/fnando/redis-settings
|
135
136
|
licenses: []
|
137
|
+
metadata: {}
|
136
138
|
post_install_message:
|
137
139
|
rdoc_options: []
|
138
140
|
require_paths:
|
139
141
|
- lib
|
140
142
|
required_ruby_version: !ruby/object:Gem::Requirement
|
141
|
-
none: false
|
142
143
|
requirements:
|
143
|
-
- -
|
144
|
+
- - '>='
|
144
145
|
- !ruby/object:Gem::Version
|
145
146
|
version: '0'
|
146
147
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
147
|
-
none: false
|
148
148
|
requirements:
|
149
|
-
- -
|
149
|
+
- - '>='
|
150
150
|
- !ruby/object:Gem::Version
|
151
151
|
version: '0'
|
152
152
|
requirements: []
|
153
153
|
rubyforge_project:
|
154
|
-
rubygems_version:
|
154
|
+
rubygems_version: 2.0.3
|
155
155
|
signing_key:
|
156
|
-
specification_version:
|
156
|
+
specification_version: 4
|
157
157
|
summary: Store application and user settings on Redis. Comes with ActiveRecord support.
|
158
158
|
test_files: []
|