perm 1.0.1 → 1.0.2

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
  SHA256:
3
- metadata.gz: 73f687eff874a61af6180a8fe22e5d3d4f8f77d24c6bcf087f23331ce0f409ec
4
- data.tar.gz: 2474b1a66cdafa69662b9ab82ee69e47cec8c9ea4ba06465c5e68ea719a256a9
3
+ metadata.gz: fd2e6f359691f587e02ea0174671618215214eed242d935c20ad182a6a470db5
4
+ data.tar.gz: e264e7dad3fedfe072b2e5857587bf6c09efba62042b6c29356b1fb8718edc47
5
5
  SHA512:
6
- metadata.gz: 4eacc1805e82f0e2d68262df3ae716df5b8f504c5327c15f44423f370a28ba831fbe9cf2b9723d56a850b7e67d9bc8f3cf4d51ec67bbf66df84a7f4dba3dd91f
7
- data.tar.gz: 5042d7948cf428aa1d96f3f0d5b4b1525a499232071cbd3989bf66a9381b89b3b39af03f67a8571deb7b91db3e358684ec99529e4fd41fc2ea6b67ffff17fda2
6
+ metadata.gz: 9f645c62a65dc11c7f84359b75cb97eac1ff13c6dd42df1f884472737a8b162bdac0c64db4cf4185deae17c8e250a6cd0df3b12201da76c9d60342f2292f529a
7
+ data.tar.gz: 7ba5cab103b113133e3490a9841730aa173e10934403947f08f5c2205029e268b7c62c7a195d1932a183467270efb2f2555fe6a61efba71cf034636ec119accb
@@ -2,11 +2,17 @@
2
2
  require "delegate"
3
3
 
4
4
  class Perm::Authorized < SimpleDelegator
5
- attr_reader :user
5
+ attr_reader :subject
6
6
 
7
- def initialize(user)
8
- raise ArgumentError.new("user cannot be nil") if user.nil?
9
- super @user = user
7
+ def initialize(subject)
8
+ raise ArgumentError.new("subject cannot be nil") if subject.nil?
9
+ super @subject = subject
10
+ end
11
+
12
+ # @deprecated Please use #subject instead
13
+ def user
14
+ warn "The #user method has been deprecated in favor of #subject"
15
+ subject
10
16
  end
11
17
 
12
18
  def method_missing(name, *args)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Perm
3
- VERSION = "1.0.1"
3
+ VERSION = "1.0.2"
4
4
  end
@@ -34,8 +34,8 @@ module Perm
34
34
  assert !@authorized_mary.respond_to?(:can_do_anything)
35
35
  end
36
36
 
37
- test "authorizers expose the wrapped user" do
38
- assert @authorized_mary.user == @mary
37
+ test "authorizers expose the wrapped subject" do
38
+ assert @authorized_mary.subject == @mary
39
39
  end
40
40
 
41
41
  test "authorizers forward non-can_*? messages to wrapped object" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: perm
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Hopkins
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-03-17 00:00:00.000000000 Z
11
+ date: 2018-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -87,7 +87,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
87
87
  version: '0'
88
88
  requirements: []
89
89
  rubyforge_project:
90
- rubygems_version: 2.7.3
90
+ rubygems_version: 2.7.6
91
91
  signing_key:
92
92
  specification_version: 4
93
93
  summary: Simple permission management