cancan-permits 0.2.9 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.9
1
+ 0.3.0
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{cancan-permits}
8
- s.version = "0.2.9"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kristian Mandrup"]
12
- s.date = %q{2010-11-24}
12
+ s.date = %q{2010-11-25}
13
13
  s.description = %q{Role specific Permits for use with CanCan permission system}
14
14
  s.email = %q{kmandrup@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -1,4 +1,5 @@
1
1
  require 'cancan-permits/permit/util'
2
+ require 'sugar-high/array'
2
3
 
3
4
  module Permit
4
5
  class Base
@@ -10,9 +11,14 @@ module Permit
10
11
  begin
11
12
  module_name = "#{name.camelize}License"
12
13
  clazz = module_name.constantize
14
+ rescue
15
+ raise "License #{module_name} is not defined"
16
+ end
17
+
18
+ begin
13
19
  clazz.new(self).enforce!
14
20
  rescue
15
- raise "License #{module_name} not found"
21
+ raise "License #{clazz} could not be enforced using #{self.inspect}"
16
22
  end
17
23
  end
18
24
  end
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 2
8
- - 9
9
- version: 0.2.9
7
+ - 3
8
+ - 0
9
+ version: 0.3.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Kristian Mandrup
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-24 00:00:00 +01:00
17
+ date: 2010-11-25 00:00:00 +01:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency