souls 0.17.3 → 0.17.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/souls +2 -0
- data/lib/souls/generate.rb +43 -0
- data/lib/souls/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: 3d75356f72b972890fc8381fc9b0bafeb5785fb8d6dcc7a6d7e20b4c2e6bba27
|
|
4
|
+
data.tar.gz: 2f91cc0387b40bb24f2cbc4ce95d9c8c60c51f32683472957b56d69ee942b111
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f77af6d106b7d7fe8ea44d79902712e8f4121b98f3a15dff038fda23d54f518866485be26d8ff3455786386bd7cab4c47b0ffcf5825764656b660dc754f9f79d
|
|
7
|
+
data.tar.gz: dfc7a4779c8fc36341a56dc52facc8ad3c5274575aa176270d32d76d78e598552178ce4c5c17e90bd2f69b08860468f33639c07f4de0140ea5545b71b556e950
|
data/exe/souls
CHANGED
data/lib/souls/generate.rb
CHANGED
|
@@ -19,6 +19,46 @@ module Souls
|
|
|
19
19
|
[file_path]
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
def policy class_name: "souls"
|
|
23
|
+
file_path = "./app/policy/#{class_name.singularize}_policy.rb"
|
|
24
|
+
File.open(file_path, "w") do |f|
|
|
25
|
+
f.write <<~EOS
|
|
26
|
+
class #{class_name.camelize}Policy < ApplicationPolicy
|
|
27
|
+
def show?
|
|
28
|
+
true
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def index?
|
|
32
|
+
true
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def create?
|
|
36
|
+
staff_permissions?
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def update?
|
|
40
|
+
staff_permissions?
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def delete?
|
|
44
|
+
staff_permissions?
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
private
|
|
48
|
+
|
|
49
|
+
def staff_permissions?
|
|
50
|
+
@user.master? or @user.admin? or @user.staff?
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
def admin_permissions?
|
|
54
|
+
@user.master? or @user.admin?
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
EOS
|
|
58
|
+
end
|
|
59
|
+
[file_path]
|
|
60
|
+
end
|
|
61
|
+
|
|
22
62
|
def resolver_head class_name: "souls"
|
|
23
63
|
FileUtils.mkdir_p "./app/graphql/resolvers" unless Dir.exist? "./app/graphql/resolvers"
|
|
24
64
|
file_path = "./app/graphql/resolvers/#{class_name.singularize}_search.rb"
|
|
@@ -366,6 +406,9 @@ end
|
|
|
366
406
|
rspec_resolver_end class_name: singularized_class_name
|
|
367
407
|
end
|
|
368
408
|
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
|
|
369
412
|
def add_delete class_name: "souls"
|
|
370
413
|
singularized_class_name = class_name.singularize.underscore
|
|
371
414
|
pluralized_class_name = class_name.pluralize.underscore
|
data/lib/souls/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: souls
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.17.
|
|
4
|
+
version: 0.17.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- POPPIN-FUMI
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: exe
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2021-
|
|
13
|
+
date: 2021-04-01 00:00:00.000000000 Z
|
|
14
14
|
dependencies: []
|
|
15
15
|
description: SOULS is a Web Application Framework for Microservices on Multi Cloud
|
|
16
16
|
Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud.
|