walruz 0.0.14 → 0.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +3 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +10 -0
- data/VERSION.yml +1 -1
- data/lib/walruz/policy.rb +3 -1
- data/spec/walruz/walruz_spec.rb +9 -0
- data/walruz.gemspec +1 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -2,14 +2,23 @@ GEM
|
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
remote: http://gems.github.com/
|
4
4
|
specs:
|
5
|
+
columnize (0.3.4)
|
5
6
|
git (1.2.5)
|
6
7
|
jeweler (1.6.4)
|
7
8
|
bundler (~> 1.0)
|
8
9
|
git (>= 1.2.5)
|
9
10
|
rake
|
11
|
+
linecache (0.46)
|
12
|
+
rbx-require-relative (> 0.0.4)
|
10
13
|
rake (0.9.2)
|
14
|
+
rbx-require-relative (0.0.5)
|
11
15
|
rdoc (2.4.3)
|
12
16
|
rspec (1.3.2)
|
17
|
+
ruby-debug (0.10.4)
|
18
|
+
columnize (>= 0.1)
|
19
|
+
ruby-debug-base (~> 0.10.4.0)
|
20
|
+
ruby-debug-base (0.10.4)
|
21
|
+
linecache (>= 0.3)
|
13
22
|
yard (0.7.2)
|
14
23
|
|
15
24
|
PLATFORMS
|
@@ -19,4 +28,5 @@ DEPENDENCIES
|
|
19
28
|
jeweler
|
20
29
|
rdoc (~> 2.4.2)
|
21
30
|
rspec (= 1.3.2)
|
31
|
+
ruby-debug
|
22
32
|
yard
|
data/VERSION.yml
CHANGED
data/lib/walruz/policy.rb
CHANGED
@@ -173,7 +173,9 @@ module Walruz
|
|
173
173
|
# - label: Symbol that represents the policy
|
174
174
|
#
|
175
175
|
def self.set_policy_label(label)
|
176
|
-
if self.
|
176
|
+
if self.policy_label.nil? ||
|
177
|
+
self.policy_label.to_s.empty? ||
|
178
|
+
Walruz.policies[self.policy_label].nil?
|
177
179
|
Walruz.policies[label] = self
|
178
180
|
else
|
179
181
|
Walruz.policies[label] = Walruz.policies.delete(self.policy_label)
|
data/spec/walruz/walruz_spec.rb
CHANGED
@@ -33,8 +33,17 @@ describe Walruz do
|
|
33
33
|
new_policy = Walruz::Utils.any(AuthorInColaborationPolicy,
|
34
34
|
ColaboratingWithJohnPolicy)
|
35
35
|
new_policy.set_policy_label(:crazy_policy)
|
36
|
+
Walruz.fetch_policy(:crazy_policy).should_not be_nil
|
36
37
|
Walruz.fetch_policy(:crazy_policy).should == new_policy
|
37
38
|
end
|
39
|
+
|
40
|
+
it 'should fetch composed policies with a specified label' do
|
41
|
+
NewPolicy = Walruz::Utils.any(AuthorInColaborationPolicy,
|
42
|
+
ColaboratingWithJohnPolicy)
|
43
|
+
NewPolicy.set_policy_label(:crazy_policy)
|
44
|
+
Walruz.fetch_policy(:crazy_policy).should_not be_nil
|
45
|
+
Walruz.fetch_policy(:crazy_policy).should == NewPolicy
|
46
|
+
end
|
38
47
|
|
39
48
|
end
|
40
49
|
|
data/walruz.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: walruz
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 15
|
10
|
+
version: 0.0.15
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Roman Gonzalez
|