natural_resource 0.1.4 → 0.1.5

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: c5402f5e6d02729166968634d49e080d16eb19a4
4
- data.tar.gz: 03a9104d1886ce840291434a967a125291b7cd91
3
+ metadata.gz: 8ea31df94daa5b52a358be08a53bf9cc5dfed896
4
+ data.tar.gz: 43b4befa5d781b407a5e03209b5783383a4db93f
5
5
  SHA512:
6
- metadata.gz: 0cbd8de1d1824ed26feb61990e55684cc697bfb1a9f32ef743a22e7219a9f617e93690997a4f7f0eceaa21dbfd36c92542f9102fc8531a938b7c7abd48880b0f
7
- data.tar.gz: 82f0cee11bb5133b4c74f3eec6b5d54f8b11c465373f305c35ecd222997560e5a4f2ff3c90c1ab9e63b0671fc96ecab9522949c2c379c359613703c1b928d61b
6
+ metadata.gz: ae3e9e9d293dbf36b1707d11c0c405beebca229254c4e635775aa4abe9e97da3b72c92693f004f65ed54ecd6545f8b20636449c1353555574cc8bd67807f821e
7
+ data.tar.gz: 20c6a91a90c7275c25c7bca0357ee6353ff947aee18bea5809a98aa4fe777e247067e218b57aa041ca4a37c4a8f03aca3f67e6e9f80b142b733a2436094413b1
@@ -5,5 +5,6 @@ class Natural::InstallGenerator < Rails::Generators::Base
5
5
 
6
6
  def copy_application_policy
7
7
  template 'application_policy.rb', 'app/policies/application_policy.rb'
8
+ template 'pundit.rb', 'spec/support/pundit.rb'
8
9
  end
9
10
  end
@@ -0,0 +1,13 @@
1
+ RSpec::Matchers.define :permit_auth do |action|
2
+ match do |policy|
3
+ policy.public_send("#{action}?")
4
+ end
5
+
6
+ failure_message do |policy|
7
+ "#{policy.class} does not permit #{action} on #{policy.record} for #{policy.user.inspect}."
8
+ end
9
+
10
+ failure_message_when_negated do |policy|
11
+ "#{policy.class} does not forbid #{action} on #{policy.record} for #{policy.user.inspect}."
12
+ end
13
+ end
@@ -1,3 +1,3 @@
1
1
  module NaturalResource
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: natural_resource
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert White
@@ -135,6 +135,7 @@ files:
135
135
  - lib/generators/natural/install/USAGE
136
136
  - lib/generators/natural/install/install_generator.rb
137
137
  - lib/generators/natural/install/templates/application_policy.rb
138
+ - lib/generators/natural/install/templates/pundit.rb
138
139
  - lib/generators/natural/resource/USAGE
139
140
  - lib/generators/natural/resource/resource_generator.rb
140
141
  - lib/generators/rspec/policy_generator.rb