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 CHANGED
@@ -1,3 +1,6 @@
1
+ * 0.0.15 (Jul 27, 2011)
2
+ * Fixing bug regarding policy labeling on composite policy classes
3
+
1
4
  * 0.0.14 (Jul 27, 2011)
2
5
  * Fixing a bug regarding policy label not being found on anonymous
3
6
  (composite) policy classes
data/Gemfile CHANGED
@@ -7,5 +7,6 @@ gem 'rdoc', '~> 2.4.2'
7
7
 
8
8
  group :test do
9
9
  gem 'rspec', '= 1.3.2'
10
+ gem 'ruby-debug'
10
11
  end
11
12
 
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
@@ -2,4 +2,4 @@
2
2
  :build:
3
3
  :major: 0
4
4
  :minor: 0
5
- :patch: 14
5
+ :patch: 15
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.name.nil? || self.name.empty?
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)
@@ -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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{walruz}
8
- s.version = "0.0.14"
8
+ s.version = "0.0.15"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Roman Gonzalez"]
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: 3
4
+ hash: 1
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 14
10
- version: 0.0.14
9
+ - 15
10
+ version: 0.0.15
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roman Gonzalez