rolex 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -1
- data/lib/rolex.rb +6 -4
- data/lib/rolex/version.rb +1 -1
- metadata +6 -6
data/README.md
CHANGED
data/lib/rolex.rb
CHANGED
@@ -5,21 +5,23 @@ require "rolex/version"
|
|
5
5
|
module Rolex
|
6
6
|
extend ActiveSupport::Concern
|
7
7
|
|
8
|
+
SUFFIX = ENV['RAILS_ENV'] || 'development'
|
9
|
+
|
8
10
|
included do
|
9
11
|
def add_role(role)
|
10
|
-
Redis.current.sadd "user:#{id}:rolex:#{
|
12
|
+
Redis.current.sadd "user:#{id}:rolex:#{SUFFIX}", role.to_s
|
11
13
|
end
|
12
14
|
|
13
15
|
def has_role?(role)
|
14
|
-
Redis.current.smembers("user:#{id}:rolex:#{
|
16
|
+
Redis.current.smembers("user:#{id}:rolex:#{SUFFIX}").include? role.to_s
|
15
17
|
end
|
16
18
|
|
17
19
|
def roles
|
18
|
-
Redis.current.smembers("user:#{id}:rolex:#{
|
20
|
+
Redis.current.smembers("user:#{id}:rolex:#{SUFFIX}")
|
19
21
|
end
|
20
22
|
|
21
23
|
def remove_role(role)
|
22
|
-
Redis.current.srem "user:#{id}:rolex:#{
|
24
|
+
Redis.current.srem "user:#{id}:rolex:#{SUFFIX}", role.to_s
|
23
25
|
end
|
24
26
|
end
|
25
27
|
end
|
data/lib/rolex/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rolex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-05-
|
12
|
+
date: 2013-05-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
|
-
requirement: &
|
16
|
+
requirement: &70270640207960 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '0'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70270640207960
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rspec
|
27
|
-
requirement: &
|
27
|
+
requirement: &70270640205340 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70270640205340
|
36
36
|
description: ! 'Rolex: simple roles, backed by redis'
|
37
37
|
email:
|
38
38
|
- electronicbattleweapon7@gmail.com
|