rubocop-action_policy 0.1.0 → 0.1.1

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: 32f3126b7aedbe9b08e36167f89ead0604b26b3d85391dbf83d7fe6a1f54b910
4
- data.tar.gz: 4c5a58d710d46aa49f539426700f200e5b0db27f840120abc85804f0836393e2
3
+ metadata.gz: 067e993c329a5fe58f1bb57369cfefcec167614e94bd2c8898c4e4145f210d79
4
+ data.tar.gz: 98e44c09ede0f2b6f521f7802248ac7b4908ca01878b3c66b4b1062e3f12f772
5
5
  SHA512:
6
- metadata.gz: 6abd9fa19b68096fe6155110b5209fa349bc296264b517c15d89499f764f5751f10428e94587454fdd56ea4094a09e12a9683e24eeca8a66df2032b8d42c0bdd
7
- data.tar.gz: acbd47dfcd3641a40ec4d71f149eb9cca3136b2b997227ff3a053d5e4ee45ea420a2d38f09ab06a0c17bc6693e8446ad781ae509e02f78cd609003e49c797476
6
+ metadata.gz: 1fe12b92950404457886f97b6a6fe10f3569e698c1bd9ed9a0bd5c5b60a1d0137b1de03fea5196f3400dcf46a5c9bb7a2d1436502f2488b8b03d46dab23e01af
7
+ data.tar.gz: 1a99fd04367f2f4c530adc9f7ccaf89a4593defb870e2e847e7a24a183f0e94684a7240cc2668b9720bc88773f3939e721ffa5ae68eb668bf3b3e1cdcf393a31
data/CHANGELOG.md CHANGED
@@ -1,5 +1,5 @@
1
1
  ## [Unreleased]
2
2
 
3
- ## [0.1.0] - 2022-10-12
3
+ ## [0.1.1] - 2022-10-12
4
4
 
5
5
  - Initial release
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Rubocop
4
+ module ActionPolicy
5
+ module Version
6
+ STRING = "0.1.1"
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "rubocop-rails"
4
+
5
+ module Rubocop
6
+ module Cop
7
+ module ActionPolicy
8
+ # Checks that your policies are subclasses of `ApplicationPolicy`.
9
+ #
10
+ # @safety
11
+ # This cop's autocorrection is unsafe because it may let the logic from `ApplicationPolicy`
12
+ # sneak into a policy that is not purposed to inherit logic common among other policies.
13
+ #
14
+ # @example
15
+ #
16
+ # # good
17
+ # class MyPolicy < ApplicationPolicy
18
+ # # ...
19
+ # end
20
+ #
21
+ # # bad
22
+ # class MyPolicy < ActionPolicy::Base
23
+ # # ...
24
+ # end
25
+ class ApplicationPolicy < RuboCop::Cop::Base
26
+ extend RuboCop::Cop::AutoCorrector
27
+
28
+ MSG = "Policies should subclass `ApplicationPolicy`."
29
+ SUPERCLASS = "ApplicationPolicy"
30
+ BASE_PATTERN = "(const (const nil? :ActionPolicy) :Base)"
31
+
32
+ include RuboCop::Cop::EnforceSuperclass
33
+ end
34
+ end
35
+ end
36
+ end
@@ -1,9 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative "rubocop-action_policy/version"
4
- require_relative "rubocop-action_policy/action_policy/application_policy"
5
-
6
- module RubocopActionPolicy
7
- class Error < StandardError; end
8
- # Your code goes here...
9
- end
3
+ require_relative "rubocop/action_policy/version"
4
+ require_relative "rubocop/cop/action_policy/application_policy"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-action_policy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thorsten Kohpeiss
@@ -67,8 +67,8 @@ files:
67
67
  - README.md
68
68
  - Rakefile
69
69
  - lib/rubocop-action_policy.rb
70
- - lib/rubocop-action_policy/action_policy/application_policy.rb
71
- - lib/rubocop-action_policy/version.rb
70
+ - lib/rubocop/action_policy/version.rb
71
+ - lib/rubocop/cop/action_policy/application_policy.rb
72
72
  - sig/rubocop-action_policy.rbs
73
73
  homepage: https://github.com/Nordplaner/rubocop-action_policy
74
74
  licenses:
@@ -1,34 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "rubocop-rails"
4
-
5
- module RubocopActionPolicy
6
- module ActionPolicy
7
- # Checks that your policies are subclasses of `ApplicationPolicy`.
8
- #
9
- # @safety
10
- # This cop's autocorrection is unsafe because it may let the logic from `ApplicationPolicy`
11
- # sneak into a policy that is not purposed to inherit logic common among other policies.
12
- #
13
- # @example
14
- #
15
- # # good
16
- # class MyPolicy < ApplicationPolicy
17
- # # ...
18
- # end
19
- #
20
- # # bad
21
- # class MyPolicy < ActionPolicy::Base
22
- # # ...
23
- # end
24
- class ApplicationPolicy < RuboCop::Cop::Base
25
- extend RuboCop::Cop::AutoCorrector
26
-
27
- MSG = "Policies should subclass `ApplicationPolicy`."
28
- SUPERCLASS = "ApplicationPolicy"
29
- BASE_PATTERN = "(const (const nil? :ActionPolicy) :Base)"
30
-
31
- include RuboCop::Cop::EnforceSuperclass
32
- end
33
- end
34
- end
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module RubocopActionPolicy
4
- VERSION = "0.1.0"
5
- end