role_model 0.3.2 → 0.4.0

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/README.rdoc CHANGED
@@ -46,7 +46,7 @@ It works like this:
46
46
  => [:admin, :manager]
47
47
 
48
48
  # ... check for individual roles
49
- >> u.has_role? :author
49
+ >> u.has_role? :author # has_role? is also aliased to is?
50
50
  => false
51
51
 
52
52
  # see the internal bitmask representation (3 = 0b0011)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.4.0
@@ -16,6 +16,7 @@ module RoleModel
16
16
  def has_role?(role)
17
17
  roles.include?(role.to_sym)
18
18
  end
19
+ alias is? has_role?
19
20
 
20
21
  end
21
22
  end
data/role_model.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{role_model}
8
- s.version = "0.3.2"
8
+ s.version = "0.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Martin Rehfeld"]
12
- s.date = %q{2010-08-04}
12
+ s.date = %q{2010-08-07}
13
13
  s.description = %q{Ever needed to assign roles to a model, say a User, and build conditional behaviour on top of that? Enter RoleModel -- roles have never been easier! Just declare your roles and you are done. Assigned roles will be stored as a bitmask.}
14
14
  s.email = %q{martin.rehfeld@glnetworks.de}
15
15
  s.extra_rdoc_files = [
@@ -180,7 +180,7 @@ describe RoleModel do
180
180
  end
181
181
  end
182
182
 
183
- [:has_role?].each do |check_role_assignment_method|
183
+ [:has_role?, :is?].each do |check_role_assignment_method|
184
184
  describe "##{check_role_assignment_method}" do
185
185
  subject { model_class.new }
186
186
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: role_model
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 3
9
- - 2
10
- version: 0.3.2
8
+ - 4
9
+ - 0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Martin Rehfeld
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-04 00:00:00 +02:00
18
+ date: 2010-08-07 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency