petergate 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f4330bb8847b44741c3442f03d701fa756372a6
4
- data.tar.gz: ba5fb9ff204bbe36e988bef4d9f3055c60620ac5
3
+ metadata.gz: 477d5115ba11244c1736a528c9e853ec9f1b9f56
4
+ data.tar.gz: f75c1c312bc7ef5e18aee99cf83664348c5d2795
5
5
  SHA512:
6
- metadata.gz: fc8779806e314e296c7186fd1347482423d8e93e835f99d948d4c32bdcd9a27ce867bfc66b712174b4f9d26d0a5e53f3a7759d5526fd6e37ad5dcc09beea0284
7
- data.tar.gz: 6f54ecfda7034ae01ccd61ca2bf3b479fa3c5691527d1230cda7b57802ad55d05a11567a84f96f9841e22f097150c4b9e6c2342866cdbe2c2062fce633d792b2
6
+ metadata.gz: 0f01776df6390edb2bfe35ed1f6a6bfef61eb495e530785091de0676c965f425033673004d2fd8707f019a7462b404ac8562a7246e03039340db9660ffacb06b
7
+ data.tar.gz: a3a38fa8b950adb78f1d54ef5b66479c7af5456c7c7849e27cf24cc8bdcd4a2c83d1890f0d1cc891751b0f2292afd0ab44fb7fa91b9def712ae98e64e7b057ad
data/lib/petergate.rb CHANGED
@@ -8,8 +8,19 @@ module PeterGate
8
8
  b_rules = block.call
9
9
  rules = rules.merge(b_rules) if b_rules.is_a?(Hash)
10
10
  end
11
- def check_access
12
- perms(rules)
11
+
12
+ instance_eval do
13
+ @_controller_rules = rules
14
+
15
+ def controller_rules
16
+ @_controller_rules
17
+ end
18
+ end
19
+
20
+ class_eval do
21
+ def check_access
22
+ perms(self.class.controller_rules)
23
+ end
13
24
  end
14
25
  end
15
26
  end
@@ -1,3 +1,3 @@
1
1
  module Petergate
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: petergate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Sloan