time_pilot 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/lib/time_pilot/time_pilot.rb +2 -2
- data/lib/time_pilot/version.rb +1 -1
- data/test/time_pilot_test.rb +5 -5
- data/time_pilot.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 395652c6669b8b9f05506489edb4987e83a0ce4c97f50b7875ebd394f3b307cb
|
4
|
+
data.tar.gz: 33e752d68a67695695e4fc6885b9b8d7b15f47b039d2c46901dd68f84018da03
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf79172d52e85f69796308deaa940988ab31b8027e153e384caafcc3c2596c4851998e0cd284db376fe91ece14c78f1780a354c362ac86f5e4f97fe95130eede
|
7
|
+
data.tar.gz: 4d25bbf76b1684e4f5e0a2ef076bb420f5954cdc7a5993e8058eaa5e7ea5db3d05ee407152c2d374e60ebbc4ded1fd0b54c2b6403b426b552ec33625affa8855
|
data/Gemfile
CHANGED
@@ -71,13 +71,13 @@ module TimePilot
|
|
71
71
|
|
72
72
|
def pilot_enable_feature(feature_name)
|
73
73
|
key_name = "#{feature_name}:#{self.class.to_s.underscore}_ids"
|
74
|
-
TimePilot.redis.sadd TimePilot.key(key_name), id
|
74
|
+
TimePilot.redis.sadd? TimePilot.key(key_name), id
|
75
75
|
instance_variable_set("@#{feature_name}_enabled", true)
|
76
76
|
end
|
77
77
|
|
78
78
|
def pilot_disable_feature(feature_name)
|
79
79
|
key_name = "#{feature_name}:#{self.class.to_s.underscore}_ids"
|
80
|
-
TimePilot.redis.srem TimePilot.key(key_name), id
|
80
|
+
TimePilot.redis.srem? TimePilot.key(key_name), id
|
81
81
|
instance_variable_set("@#{feature_name}_enabled", false)
|
82
82
|
end
|
83
83
|
|
data/lib/time_pilot/version.rb
CHANGED
data/test/time_pilot_test.rb
CHANGED
@@ -62,7 +62,7 @@ describe TimePilot do
|
|
62
62
|
end
|
63
63
|
|
64
64
|
it "defines a getter on company" do
|
65
|
-
TimePilot.redis.sadd "timepilot:planning:company_ids", @acme.id
|
65
|
+
TimePilot.redis.sadd? "timepilot:planning:company_ids", @acme.id
|
66
66
|
_(@acme.planning_enabled?).must_equal true
|
67
67
|
_(@acme.instance_variable_get("@planning_enabled")).must_equal true
|
68
68
|
end
|
@@ -82,7 +82,7 @@ describe TimePilot do
|
|
82
82
|
end
|
83
83
|
|
84
84
|
it "defines a getter on team" do
|
85
|
-
TimePilot.redis.sadd "timepilot:planning:team_ids", @healthcare.id
|
85
|
+
TimePilot.redis.sadd? "timepilot:planning:team_ids", @healthcare.id
|
86
86
|
_(@healthcare.planning_enabled?).must_equal true
|
87
87
|
end
|
88
88
|
|
@@ -101,7 +101,7 @@ describe TimePilot do
|
|
101
101
|
end
|
102
102
|
|
103
103
|
it "defines a getter on employee" do
|
104
|
-
TimePilot.redis.sadd "timepilot:planning:employee_ids", @john.id
|
104
|
+
TimePilot.redis.sadd? "timepilot:planning:employee_ids", @john.id
|
105
105
|
_(@john.planning_enabled?).must_equal true
|
106
106
|
_(@john.instance_variable_get("@planning_enabled")).must_equal true
|
107
107
|
end
|
@@ -192,7 +192,7 @@ describe TimePilot do
|
|
192
192
|
end
|
193
193
|
|
194
194
|
specify "does not call redis to get status after disabling" do
|
195
|
-
@mock.expect(:srem
|
195
|
+
@mock.expect(:srem?, true, ["timepilot:planning:company_ids", @acme.id])
|
196
196
|
|
197
197
|
@acme.disable_planning
|
198
198
|
# Call the feature again it should hit the instance variable
|
@@ -202,7 +202,7 @@ describe TimePilot do
|
|
202
202
|
end
|
203
203
|
|
204
204
|
specify "does not call redis to get status after enabling" do
|
205
|
-
@mock.expect(:sadd
|
205
|
+
@mock.expect(:sadd?, true, ["timepilot:planning:company_ids", @acme.id])
|
206
206
|
|
207
207
|
@acme.enable_planning
|
208
208
|
# Call the feature again it should hit the instance variable
|
data/time_pilot.gemspec
CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.email = ['matthijs.langenberg@nedap.com', 'mark.oudeveldhuis@nedap.com']
|
17
17
|
s.homepage = 'https://github.com/nedap/time_pilot'
|
18
18
|
|
19
|
-
s.add_dependency 'redis', '>=
|
19
|
+
s.add_dependency 'redis', '>= 4.8.0'
|
20
20
|
s.add_dependency 'activesupport', '>= 3.0.0'
|
21
21
|
s.add_development_dependency "minitest"
|
22
22
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: time_pilot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "@mlangenberg"
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-10-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: redis
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - ">="
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: 4.8.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - ">="
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version:
|
27
|
+
version: 4.8.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: activesupport
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
|
-
rubygems_version: 3.2.
|
104
|
+
rubygems_version: 3.2.22
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Configure enabled features for a specific set of users.
|