souls 0.16.9 → 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 +13 -3
- data/lib/souls/generate.rb +62 -0
- data/lib/souls/init.rb +2 -2
- data/lib/souls/version.rb +1 -1
- metadata +6 -6
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
@@ -35,7 +35,7 @@ begin
|
|
35
35
|
else
|
36
36
|
case ARGV[1]
|
37
37
|
when "RACK_ENV=production"
|
38
|
-
system "bundle exec irb
|
38
|
+
system "RACK_ENV=production bundle exec irb"
|
39
39
|
else
|
40
40
|
system "bundle exec irb"
|
41
41
|
end
|
@@ -67,6 +67,8 @@ begin
|
|
67
67
|
case ARGV[1]
|
68
68
|
when "test_dir"
|
69
69
|
Souls::Init.test_dir
|
70
|
+
when "policy"
|
71
|
+
Souls::Init.policy class_name: ARGV[2]
|
70
72
|
when "node_type"
|
71
73
|
Souls::Init.node_type class_name: ARGV[2]
|
72
74
|
when "resolver"
|
@@ -103,7 +105,10 @@ begin
|
|
103
105
|
"SOULs!"
|
104
106
|
end
|
105
107
|
when "d"
|
106
|
-
Souls::Init.
|
108
|
+
Souls::Init.add_delete class_name: ARGV[1]
|
109
|
+
when "update"
|
110
|
+
Souls::Init.add_delete class_name: ARGV[1]
|
111
|
+
Souls::Init.single_migrate class_name: ARGV[1]
|
107
112
|
when "db:create"
|
108
113
|
system "rake db:create && rake db:create RACK_ENV=test"
|
109
114
|
when "db:migrate"
|
@@ -114,7 +119,12 @@ begin
|
|
114
119
|
system "rake db:migrate && rake db:migrate RACK_ENV=test"
|
115
120
|
end
|
116
121
|
when "db:seed"
|
117
|
-
|
122
|
+
case ARGV[1]
|
123
|
+
when "RACK_ENV=production"
|
124
|
+
system "rake db:seed RACK_ENV=production"
|
125
|
+
else
|
126
|
+
system "rake db:seed"
|
127
|
+
end
|
118
128
|
when "db:migrate:reset"
|
119
129
|
case ARGV[1]
|
120
130
|
when "RACK_ENV=production"
|
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,28 @@ end
|
|
366
406
|
rspec_resolver_end class_name: singularized_class_name
|
367
407
|
end
|
368
408
|
|
409
|
+
|
410
|
+
|
411
|
+
|
412
|
+
def add_delete class_name: "souls"
|
413
|
+
singularized_class_name = class_name.singularize.underscore
|
414
|
+
pluralized_class_name = class_name.pluralize.underscore
|
415
|
+
FileUtils.rm_rf "./app/graphql/mutations/#{singularized_class_name}"
|
416
|
+
FileUtils.rm "./app/graphql/queries/#{singularized_class_name}.rb"
|
417
|
+
FileUtils.rm "./app/graphql/queries/#{pluralized_class_name}.rb"
|
418
|
+
FileUtils.rm "./app/graphql/resolvers/#{singularized_class_name}_search.rb"
|
419
|
+
FileUtils.rm "./app/graphql/types/#{singularized_class_name}_type.rb"
|
420
|
+
FileUtils.rm "./app/graphql/types/#{singularized_class_name}_node_type.rb"
|
421
|
+
FileUtils.rm "./spec/factories/#{pluralized_class_name}.rb"
|
422
|
+
FileUtils.rm "./spec/mutations/#{singularized_class_name}_spec.rb"
|
423
|
+
FileUtils.rm "./spec/models/#{singularized_class_name}_spec.rb"
|
424
|
+
FileUtils.rm "./spec/queries/#{singularized_class_name}_spec.rb"
|
425
|
+
FileUtils.rm "./spec/resolvers/#{singularized_class_name}_search_spec.rb"
|
426
|
+
puts "deleted #{class_name.camelize} CRUD!"
|
427
|
+
rescue StandardError => error
|
428
|
+
puts error
|
429
|
+
end
|
430
|
+
|
369
431
|
def delete_all class_name: "souls"
|
370
432
|
singularized_class_name = class_name.singularize.underscore
|
371
433
|
pluralized_class_name = class_name.pluralize.underscore
|
data/lib/souls/init.rb
CHANGED
data/lib/souls/version.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: souls
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.17.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
8
8
|
- KishiTheMechanic
|
9
9
|
- James Neve
|
10
|
-
autorequire:
|
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.
|
@@ -55,7 +55,7 @@ metadata:
|
|
55
55
|
homepage_uri: https://github.com/elsoul/souls
|
56
56
|
source_code_uri: https://github.com/elsoul/souls
|
57
57
|
changelog_uri: https://github.com/elsoul/souls
|
58
|
-
post_install_message:
|
58
|
+
post_install_message:
|
59
59
|
rdoc_options: []
|
60
60
|
require_paths:
|
61
61
|
- lib
|
@@ -70,8 +70,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
70
70
|
- !ruby/object:Gem::Version
|
71
71
|
version: '0'
|
72
72
|
requirements: []
|
73
|
-
rubygems_version: 3.2.
|
74
|
-
signing_key:
|
73
|
+
rubygems_version: 3.2.3
|
74
|
+
signing_key:
|
75
75
|
specification_version: 4
|
76
76
|
summary: SOULS is a GraphQL Based Web Application Framework for Microservices on Multi
|
77
77
|
Cloud Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud.
|