pundit_scaffold_generator 0.1.1 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/generators/policy_generator/rspec/rspec_generator.rb +5 -7
- data/lib/generators/policy_generator/scaffold/scaffold_generator.rb +0 -1
- data/lib/generators/scaffold/scaffold_generator.rb +1 -1
- data/lib/pundit_scaffold_generator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5558d45b38aa8befeb21c0e96d7b5634409410bc0e3475425bf98467db464e7d
|
4
|
+
data.tar.gz: 27bd55ea337c2104b5965022d102e54b01e36aad4066d291f77eaeada541f8fa
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8a4843742d9e2c6f45dd25a0f43cf7d01711105e0ee496ccbcb42b48137d79e5bafae68dd8b6b69a76b3e19c2436654958363a72a9f368afa691e22e7cabecb
|
7
|
+
data.tar.gz: 9f7f690a04fdbbcf532f530a7b4ad02e635829636e49c28e94a1c668f812822ba0739664b15801cf9a385c570f8b47a396467790d99ff3d17a2f8f0302eecfa9
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,11 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Rspec
|
4
|
-
|
5
|
-
|
6
|
-
source_root File.expand_path("templates", __dir__)
|
4
|
+
class PolicyGenerator < ::Rails::Generators::NamedBase
|
5
|
+
source_root File.expand_path("templates", __dir__)
|
7
6
|
|
8
|
-
|
9
|
-
|
10
|
-
end
|
7
|
+
def create_policy_spec
|
8
|
+
template "policy_spec.rb", File.join("spec/policies", class_path, "#{file_name}_policy_spec.rb")
|
11
9
|
end
|
12
|
-
|
10
|
+
end
|
13
11
|
end
|
@@ -2,7 +2,6 @@ module PolicyGenerator
|
|
2
2
|
module Generators
|
3
3
|
class ScaffoldGenerator < Rails::Generators::NamedBase
|
4
4
|
source_root File.expand_path('../templates', __FILE__)
|
5
|
-
puts "PolicyGenerator::Generators::ScaffoldGenerator"
|
6
5
|
|
7
6
|
def create_policy
|
8
7
|
template "policy.rb", File.join("app/policies", class_path, "#{file_name}_policy.rb")
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'rails/generators/rails/scaffold/scaffold_generator'
|
2
2
|
|
3
3
|
class Rails::Generators::ScaffoldGenerator
|
4
|
-
class_option :policy_generator, desc: '
|
4
|
+
class_option :policy_generator, desc: 'Generates the pundit policy',
|
5
5
|
default: 'policy_generator'
|
6
6
|
hook_for :policy_generator, required: true
|
7
7
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pundit_scaffold_generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Kulikov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
When your project uses pundit gem for authorization this gem generates
|