rolypoly 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ NmU4ZmFmOTUwZjg3YTliMmZjMGJjZGVjZmJmOGQxYTY2NTk2YmU0ZA==
5
+ data.tar.gz: !binary |-
6
+ ZjA1MmZkZmJhM2Q2NDAzZTdhNWI0YjQ5NzM3NjI2Y2MwYTQ5MDc4Yw==
7
+ SHA512:
8
+ metadata.gz: !binary |-
9
+ YjVjNjhiMWJjZmI2MzA2OGQ2YjRhNDVkYmQ2ZTE3ODVkMGFkNDFiNTFhMGIw
10
+ NDNiMmJiMjFiZGQwOGM2MjgyOTlkNWJlOGYwNWMwMTlkMTY4NTdhN2YwOTdk
11
+ YzJlZjQ5N2RjZjliNjE2M2JhNTVmNGRiMjE1MTUzNmFiMzYyMjM=
12
+ data.tar.gz: !binary |-
13
+ YTlhNWY1MzhjNDEzZDE5OTFmNWRiNzViZTY0NTM5OGQwNzI4YjIxYzc2NDNi
14
+ N2Q4MjFiYTBlNjY2MTNkYWYyZTJlOTlhOGIxZTMwMmJmZDcxNjU3ODY1ZGY0
15
+ ZGJjY2FlZDZjMTZmYzcxNTI4YmY4NWVjNGFlZjUzMGZkZWUzYWU=
@@ -18,12 +18,6 @@ module Rolypoly
18
18
  define_method(:current_user_roles) { [] }
19
19
  end
20
20
  sub.send :extend, ClassMethods
21
- sub.class_eval do # Sometimes get Stack Too Deep errors if in ClassMethods
22
- define_singleton_method :inherited do |sub|
23
- super sub
24
- sub.instance_variable_set(:@rolypoly_gatekeepers, rolypoly_gatekeepers.map(&:clone))
25
- end
26
- end
27
21
  end
28
22
 
29
23
  def rolypoly_check_role_access!
@@ -86,7 +80,14 @@ module Rolypoly
86
80
  end
87
81
 
88
82
  def rolypoly_gatekeepers
89
- @rolypoly_gatekeepers ||= []
83
+ @rolypoly_gatekeepers ||= Array(try_super(__method__))
84
+ end
85
+
86
+ def try_super(mname)
87
+ if superclass.respond_to?(mname)
88
+ super_val = superclass.send(mname)
89
+ super_val.respond_to?(:dup) ? super_val.dup : super_val
90
+ end
90
91
  end
91
92
 
92
93
  def build_gatekeeper(roles, actions)
@@ -1,3 +1,3 @@
1
1
  module Rolypoly
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rolypoly
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
5
- prerelease:
4
+ version: 0.1.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Jon Phenow
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-10-30 00:00:00.000000000 Z
11
+ date: 2013-12-02 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: bundler
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :development
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -85,33 +78,26 @@ files:
85
78
  homepage: https://github.com/sportngin/rolypoly
86
79
  licenses:
87
80
  - MIT
81
+ metadata: {}
88
82
  post_install_message:
89
83
  rdoc_options: []
90
84
  require_paths:
91
85
  - lib
92
86
  required_ruby_version: !ruby/object:Gem::Requirement
93
- none: false
94
87
  requirements:
95
88
  - - ! '>='
96
89
  - !ruby/object:Gem::Version
97
90
  version: '0'
98
- segments:
99
- - 0
100
- hash: 4081264060094388096
101
91
  required_rubygems_version: !ruby/object:Gem::Requirement
102
- none: false
103
92
  requirements:
104
93
  - - ! '>='
105
94
  - !ruby/object:Gem::Version
106
95
  version: '0'
107
- segments:
108
- - 0
109
- hash: 4081264060094388096
110
96
  requirements: []
111
97
  rubyforge_project:
112
- rubygems_version: 1.8.25
98
+ rubygems_version: 2.1.11
113
99
  signing_key:
114
- specification_version: 3
100
+ specification_version: 4
115
101
  summary: Tools for handling per-action and per-app Role authorization
116
102
  test_files:
117
103
  - spec/lib/rolypoly/controller_role_dsl_spec.rb