pundit_helpers 0.1.0 → 1.0.0

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: ac42cf3f0853e9afe356ba5a054815a46649b48c
4
- data.tar.gz: 31344d02e93ca2b853446b13bb1e74fa9870e31f
3
+ metadata.gz: 5a2c918a4ce721d081f323108d9f9830044fd87a
4
+ data.tar.gz: 9fface794f302352233d3d5619be061aa3021f3e
5
5
  SHA512:
6
- metadata.gz: 21014937447000f7ddc72e97aa413c47e1cb6b5197af73112949d503d9f4d00b58b5d0b8bad130b9153d7ce12d952dd6cebfeb7276d94690fec180f3c1315c6b
7
- data.tar.gz: 8ee9e7efa46bceebeab247ed0e32373c5f3fd461384d37035da0137293c9de68090d4cbb20cd8093e54b4c8921dc5ba4438662d932213fb86c2eff2a5886bdff
6
+ metadata.gz: d50d8f6b6799208d26696852a5752e4f341ec6a1b50c425be39d25cc806ff049e49bc963d6da1f80a6f70ea829817ab2da9dffecb36385d307c9224e7c28c6a9
7
+ data.tar.gz: 6207bc04306bb95083495a2fa3c2530505586e292a01a6a47f109413f28cd92606458d43611ebe109226db61559b53dbb2aef9fe631d7f448fc3c505ec0807e5
data/CHANGELOG.md ADDED
@@ -0,0 +1,3 @@
1
+ ## 1.0.0
2
+
3
+ - Change `current_user` usage to `pundit_user`
@@ -45,7 +45,7 @@ module PunditHelpers
45
45
  # @return [Boolean]
46
46
  def can?(query, record)
47
47
  query = "#{query}?"
48
- policy = Pundit.policy!(current_user, record)
48
+ policy = Pundit.policy!(pundit_user, record)
49
49
  !! policy.public_send(query)
50
50
  end
51
51
  end
@@ -1,3 +1,3 @@
1
1
  module PunditHelpers
2
- VERSION = "0.1.0"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
18
18
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
19
  spec.require_paths = ["lib"]
20
20
 
21
- spec.add_dependency "pundit", "~> 0.2"
21
+ spec.add_dependency "pundit", ">= 0.2.2", "~> 0.2"
22
22
 
23
23
  spec.add_development_dependency "bundler", "~> 1.5"
24
24
  spec.add_development_dependency "rake"
@@ -6,8 +6,8 @@ class Harness
6
6
  @helper_methods = []
7
7
  end
8
8
 
9
- def current_user
10
- :spec_current_user
9
+ def pundit_user
10
+ :spec_pundit_user
11
11
  end
12
12
 
13
13
  def self.helper_methods
@@ -47,7 +47,7 @@ describe PunditHelpers, "#can?" do
47
47
  policy = double(:edit? => true)
48
48
  harness = Harness.new
49
49
 
50
- expect(Pundit).to receive(:policy!).with(:spec_current_user, record).and_return(policy)
50
+ expect(Pundit).to receive(:policy!).with(:spec_pundit_user, record).and_return(policy)
51
51
  expect(harness.can?(:edit, record)).to be_true
52
52
  end
53
53
 
@@ -56,7 +56,7 @@ describe PunditHelpers, "#can?" do
56
56
  policy = double(:edit? => false)
57
57
  harness = Harness.new
58
58
 
59
- expect(Pundit).to receive(:policy!).with(:spec_current_user, record).and_return(policy)
59
+ expect(Pundit).to receive(:policy!).with(:spec_pundit_user, record).and_return(policy)
60
60
  expect(harness.can?(:edit, record)).to be_false
61
61
  end
62
62
 
metadata CHANGED
@@ -1,19 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pundit_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brendon Murphy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-10 00:00:00.000000000 Z
11
+ date: 2015-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pundit
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.2.2
17
20
  - - "~>"
18
21
  - !ruby/object:Gem::Version
19
22
  version: '0.2'
@@ -21,6 +24,9 @@ dependencies:
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: 0.2.2
24
30
  - - "~>"
25
31
  - !ruby/object:Gem::Version
26
32
  version: '0.2'
@@ -74,6 +80,7 @@ extensions: []
74
80
  extra_rdoc_files: []
75
81
  files:
76
82
  - ".gitignore"
83
+ - CHANGELOG.md
77
84
  - Gemfile
78
85
  - LICENSE.txt
79
86
  - README.md