souls 0.22.1 → 0.22.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/Gemfile.lock +1 -1
- data/README.md +1 -3
- data/exe/souls +18 -1
- data/lib/souls.rb +3 -1
- data/lib/souls/generate.rb +2 -0
- data/lib/souls/generate/application.rb +26 -21
- data/lib/souls/generate/connection.rb +21 -0
- data/lib/souls/generate/edge.rb +21 -0
- data/lib/souls/generate/model.rb +3 -0
- data/lib/souls/generate/mutation.rb +10 -11
- data/lib/souls/generate/policy.rb +7 -7
- data/lib/souls/generate/query.rb +10 -4
- data/lib/souls/generate/resolver.rb +4 -1
- data/lib/souls/generate/rspec_factory.rb +4 -0
- data/lib/souls/generate/rspec_model.rb +3 -0
- data/lib/souls/generate/rspec_mutation.rb +4 -0
- data/lib/souls/generate/rspec_policy.rb +8 -13
- data/lib/souls/generate/rspec_query.rb +4 -0
- data/lib/souls/generate/rspec_resolver.rb +4 -0
- data/lib/souls/generate/type.rb +7 -22
- data/lib/souls/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31d8488e511d45874592ff305a5a77da39ec599b44afb2d3629bb151dd0e1e33
|
4
|
+
data.tar.gz: 046501ad71ad1ea73aa1f5fa313c426b1addae671205bcf616270e35726b3e91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3bd14e22d6a08d6df13b3c797cdb3d9a146b2ac41cd3114f8bb8c45f11b394168f7c4f8bfeb08ed64f0644e757a4647207e69229c5cb8171ec1dbeb7c7f5ee8
|
7
|
+
data.tar.gz: 8badb5f86ff514c1e5e1d8bc1136d1eb96dd335d56dca2dab2b96961cfe7471aab150b477d5c9ab7521732bae3b7592dff19cda7211f8483eaad4dfddd63843f
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -21,9 +21,7 @@
|
|
21
21
|
|
22
22
|
Welcome to SOULs Framework!
|
23
23
|
|
24
|
-
|
25
|
-
This is Cloud Based APP Framework. Easy Deployment.
|
26
|
-
Microservices on Multi Cloud Platform such as Google Cloud Platform, Amazon Web Services, and Alibaba Cloud. Auto deploy with scalable condition.
|
24
|
+
SOULs is a Serverless Application Framework. SOULs has four strains, API, Worker, Console, Media, and can be used in combination according to the purpose. SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google Cloud and Amazon Web Services
|
27
25
|
You can focus on business logic. No more infra problems.
|
28
26
|
|
29
27
|
SOULs creates 4 types of framework.
|
data/exe/souls
CHANGED
@@ -74,6 +74,10 @@ begin
|
|
74
74
|
Souls::Generate.query class_name: ARGV[2]
|
75
75
|
when "type"
|
76
76
|
Souls::Generate.type class_name: ARGV[2]
|
77
|
+
when "edge"
|
78
|
+
Souls::Generate.edge class_name: ARGV[2]
|
79
|
+
when "connection"
|
80
|
+
Souls::Generate.connection class_name: ARGV[2]
|
77
81
|
when "resolver"
|
78
82
|
Souls::Generate.resolver class_name: ARGV[2]
|
79
83
|
when "policy"
|
@@ -99,7 +103,8 @@ begin
|
|
99
103
|
when "migrate_all"
|
100
104
|
Souls::Generate.migrate_all
|
101
105
|
when "migration"
|
102
|
-
|
106
|
+
class_name = ARGV[2].underscore.pluralize
|
107
|
+
system "rake db:create_migration NAME=create_#{class_name}"
|
103
108
|
when "update"
|
104
109
|
Souls::Generate.update_delete class_name: ARGV[2]
|
105
110
|
Souls::Generate.single_migrate class_name: ARGV[2]
|
@@ -136,6 +141,18 @@ begin
|
|
136
141
|
else
|
137
142
|
system "rake db:migrate:reset && rake db:migrate:reset RACK_ENV=test"
|
138
143
|
end
|
144
|
+
when "db:update"
|
145
|
+
strain = Souls.configuration.strain
|
146
|
+
case strain
|
147
|
+
when "api"
|
148
|
+
other_app = Souls.configuration.worker_name
|
149
|
+
when "worker"
|
150
|
+
other_app = Souls.configuration.api_name
|
151
|
+
else
|
152
|
+
raise StandardError, "Unknown app name!"
|
153
|
+
end
|
154
|
+
system "rm -rf ../#{other_app}/db/*"
|
155
|
+
system "cp -r ./db/* ../#{other_app}/db/*"
|
139
156
|
when "t", "test"
|
140
157
|
system "rubocop -a"
|
141
158
|
system "bundle exec rspec"
|
data/lib/souls.rb
CHANGED
@@ -59,12 +59,14 @@ module Souls
|
|
59
59
|
end
|
60
60
|
|
61
61
|
class Configuration
|
62
|
-
attr_accessor :app, :strain, :project_id
|
62
|
+
attr_accessor :app, :strain, :project_id, :worker_name, :api_name
|
63
63
|
|
64
64
|
def initialize
|
65
65
|
@app = nil
|
66
66
|
@project_id = nil
|
67
67
|
@strain = nil
|
68
|
+
@worker_name = nil
|
69
|
+
@api_name = nil
|
68
70
|
end
|
69
71
|
end
|
70
72
|
end
|
data/lib/souls/generate.rb
CHANGED
@@ -12,6 +12,8 @@ require_relative "./generate/rspec_policy"
|
|
12
12
|
require_relative "./generate/rspec_query"
|
13
13
|
require_relative "./generate/rspec_resolver"
|
14
14
|
require_relative "./generate/type"
|
15
|
+
require_relative "./generate/edge"
|
16
|
+
require_relative "./generate/connection"
|
15
17
|
require_relative "./generate/application"
|
16
18
|
|
17
19
|
module Souls
|
@@ -16,7 +16,8 @@ module Souls
|
|
16
16
|
"./app/graphql/queries/#{pluralized_class_name}.rb",
|
17
17
|
"./app/graphql/resolvers/#{singularized_class_name}_search.rb",
|
18
18
|
"./app/graphql/types/#{singularized_class_name}_type.rb",
|
19
|
-
"./app/graphql/types/#{singularized_class_name}
|
19
|
+
"./app/graphql/types/edges/#{singularized_class_name}_edge.rb",
|
20
|
+
"./app/graphql/types/connections/#{singularized_class_name}_connection.rb",
|
20
21
|
"./spec/factories/#{pluralized_class_name}.rb",
|
21
22
|
"./spec/mutations/#{singularized_class_name}_spec.rb",
|
22
23
|
"./spec/models/#{singularized_class_name}_spec.rb",
|
@@ -67,8 +68,8 @@ module Souls
|
|
67
68
|
string: "String",
|
68
69
|
float: "Float",
|
69
70
|
text: "String",
|
70
|
-
datetime: "
|
71
|
-
date: "
|
71
|
+
datetime: "String",
|
72
|
+
date: "String",
|
72
73
|
boolean: "Boolean",
|
73
74
|
integer: "Integer"
|
74
75
|
}[type.to_sym]
|
@@ -96,20 +97,22 @@ module Souls
|
|
96
97
|
|
97
98
|
def migrate class_name: "souls"
|
98
99
|
singularized_class_name = class_name.singularize
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
100
|
+
model(class_name: singularized_class_name)
|
101
|
+
type(class_name: singularized_class_name)
|
102
|
+
edge(class_name: singularized_class_name)
|
103
|
+
connection(class_name: singularized_class_name)
|
104
|
+
resolver(class_name: singularized_class_name)
|
105
|
+
rspec_factory(class_name: singularized_class_name)
|
106
|
+
rspec_model(class_name: singularized_class_name)
|
107
|
+
rspec_mutation(class_name: singularized_class_name)
|
108
|
+
rspec_query(class_name: singularized_class_name)
|
109
|
+
rspec_resolver(class_name: singularized_class_name)
|
110
|
+
query(class_name: singularized_class_name)
|
111
|
+
mutation(class_name: singularized_class_name)
|
112
|
+
policy(class_name: singularized_class_name)
|
113
|
+
rspec_policy(class_name: singularized_class_name)
|
114
|
+
rescue StandardError => e
|
115
|
+
raise StandardError, e
|
113
116
|
end
|
114
117
|
|
115
118
|
def delete_all class_name: "souls"
|
@@ -122,7 +125,8 @@ module Souls
|
|
122
125
|
FileUtils.rm "./app/graphql/queries/#{pluralized_class_name}.rb"
|
123
126
|
FileUtils.rm "./app/graphql/resolvers/#{singularized_class_name}_search.rb"
|
124
127
|
FileUtils.rm "./app/graphql/types/#{singularized_class_name}_type.rb"
|
125
|
-
FileUtils.rm "./app/graphql/types/#{singularized_class_name}
|
128
|
+
FileUtils.rm "./app/graphql/types/edges/#{singularized_class_name}_edge.rb"
|
129
|
+
FileUtils.rm "./app/graphql/types/connections/#{singularized_class_name}_connection.rb"
|
126
130
|
FileUtils.rm "./spec/factories/#{pluralized_class_name}.rb"
|
127
131
|
FileUtils.rm "./spec/mutations/#{singularized_class_name}_spec.rb"
|
128
132
|
FileUtils.rm "./spec/models/#{singularized_class_name}_spec.rb"
|
@@ -142,7 +146,8 @@ module Souls
|
|
142
146
|
FileUtils.rm "./app/graphql/queries/#{pluralized_class_name}.rb"
|
143
147
|
FileUtils.rm "./app/graphql/resolvers/#{singularized_class_name}_search.rb"
|
144
148
|
FileUtils.rm "./app/graphql/types/#{singularized_class_name}_type.rb"
|
145
|
-
FileUtils.rm "./app/graphql/types/#{singularized_class_name}
|
149
|
+
FileUtils.rm "./app/graphql/types/edges/#{singularized_class_name}_edge.rb"
|
150
|
+
FileUtils.rm "./app/graphql/types/connections/#{singularized_class_name}_connection.rb"
|
146
151
|
FileUtils.rm "./spec/mutations/#{singularized_class_name}_spec.rb"
|
147
152
|
FileUtils.rm "./spec/queries/#{singularized_class_name}_spec.rb"
|
148
153
|
FileUtils.rm "./spec/resolvers/#{singularized_class_name}_search_spec.rb"
|
@@ -161,14 +166,14 @@ module Souls
|
|
161
166
|
end
|
162
167
|
|
163
168
|
def migrate_all
|
164
|
-
puts "◆◆◆
|
169
|
+
puts "◆◆◆ SOULs CRUD Assist ◆◆◆\n"
|
165
170
|
get_tables.each do |class_name|
|
166
171
|
migrate class_name: class_name.singularize
|
167
172
|
puts "Generated #{class_name.camelize} CRUD Files\n"
|
168
173
|
Souls::Generate.generated_paths(class_name: class_name).each { |f| puts f }
|
169
174
|
puts "\n"
|
170
175
|
end
|
171
|
-
puts "\nAll files created from ./db/schema.rb"
|
176
|
+
puts "\nAll files created from ./db/schema.rb\n\n You're all set ;)"
|
172
177
|
end
|
173
178
|
end
|
174
179
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Souls
|
2
|
+
module Generate
|
3
|
+
class << self
|
4
|
+
def connection class_name: "souls"
|
5
|
+
singularized_class_name = class_name.underscore.singularize
|
6
|
+
file_path = "./app/graphql/types/connections/#{singularized_class_name}_connection.rb"
|
7
|
+
File.open(file_path, "w") do |f|
|
8
|
+
f.write <<~EOS
|
9
|
+
class Types::#{singularized_class_name.camelize}Connection < Types::BaseConnection
|
10
|
+
edge_type(Types::#{singularized_class_name.camelize}Edge)
|
11
|
+
end
|
12
|
+
EOS
|
13
|
+
end
|
14
|
+
puts "Created file! : #{file_path}"
|
15
|
+
file_path
|
16
|
+
rescue StandardError => e
|
17
|
+
raise StandardError, e
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Souls
|
2
|
+
module Generate
|
3
|
+
class << self
|
4
|
+
def edge class_name: "souls"
|
5
|
+
singularized_class_name = class_name.underscore.singularize
|
6
|
+
file_path = "./app/graphql/types/edges/#{singularized_class_name}_edge.rb"
|
7
|
+
File.open(file_path, "w") do |f|
|
8
|
+
f.write <<~EOS
|
9
|
+
class Types::#{singularized_class_name.camelize}Edge < Types::BaseEdge
|
10
|
+
node_type(Types::#{singularized_class_name.camelize}Type)
|
11
|
+
end
|
12
|
+
EOS
|
13
|
+
end
|
14
|
+
puts "Created file! : #{file_path}"
|
15
|
+
file_path
|
16
|
+
rescue StandardError => e
|
17
|
+
raise StandardError, e
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
data/lib/souls/generate/model.rb
CHANGED
@@ -13,7 +13,7 @@ module Souls
|
|
13
13
|
module Mutations
|
14
14
|
module #{singularized_class_name.camelize}
|
15
15
|
class Create#{singularized_class_name.camelize} < BaseMutation
|
16
|
-
field :#{singularized_class_name}_edge, Types::#{singularized_class_name.camelize}
|
16
|
+
field :#{singularized_class_name}_edge, Types::#{singularized_class_name.camelize}.edge_type, null: false
|
17
17
|
field :error, String, null: true
|
18
18
|
|
19
19
|
EOS
|
@@ -108,7 +108,7 @@ module Souls
|
|
108
108
|
module Mutations
|
109
109
|
module #{class_name.camelize}
|
110
110
|
class Update#{class_name.camelize} < BaseMutation
|
111
|
-
field :#{class_name}_edge, Types::#{class_name.camelize}
|
111
|
+
field :#{class_name}_edge, Types::#{class_name.camelize}.edge_type, null: false
|
112
112
|
|
113
113
|
argument :id, String, required: true
|
114
114
|
EOS
|
@@ -268,15 +268,14 @@ module Souls
|
|
268
268
|
create_mutation_head class_name: singularized_class_name
|
269
269
|
relation_params = create_mutation_params class_name: singularized_class_name
|
270
270
|
create_mutation_after_params class_name: singularized_class_name, relation_params: relation_params
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
puts error
|
271
|
+
create_mutation_end(class_name: singularized_class_name)
|
272
|
+
update_mutation(class_name: singularized_class_name)
|
273
|
+
delete_mutation(class_name: singularized_class_name)
|
274
|
+
destroy_delete_mutation(class_name: singularized_class_name)
|
275
|
+
puts "Created file! : #{file_path}"
|
276
|
+
file_path
|
277
|
+
rescue StandardError => e
|
278
|
+
raise StandardError, e
|
280
279
|
end
|
281
280
|
end
|
282
281
|
end
|
@@ -19,11 +19,11 @@ module Souls
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def create?
|
22
|
-
|
22
|
+
user_permissions?
|
23
23
|
end
|
24
24
|
|
25
25
|
def update?
|
26
|
-
|
26
|
+
user_permissions?
|
27
27
|
end
|
28
28
|
|
29
29
|
def delete?
|
@@ -32,8 +32,8 @@ module Souls
|
|
32
32
|
|
33
33
|
private
|
34
34
|
|
35
|
-
def
|
36
|
-
@user.master? or @user.admin? or @user.
|
35
|
+
def user_permissions?
|
36
|
+
@user.master? or @user.admin? or @user.user?
|
37
37
|
end
|
38
38
|
|
39
39
|
def admin_permissions?
|
@@ -42,10 +42,10 @@ module Souls
|
|
42
42
|
end
|
43
43
|
EOS
|
44
44
|
end
|
45
|
+
puts "Created file! : #{file_path}"
|
45
46
|
file_path
|
46
|
-
rescue StandardError =>
|
47
|
-
|
48
|
-
puts error.backtrace
|
47
|
+
rescue StandardError => e
|
48
|
+
raise StandardError, e
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
data/lib/souls/generate/query.rb
CHANGED
@@ -20,7 +20,10 @@ module Souls
|
|
20
20
|
end
|
21
21
|
EOS
|
22
22
|
end
|
23
|
+
puts "Created file! : #{file_path}"
|
23
24
|
file_path
|
25
|
+
rescue StandardError => e
|
26
|
+
raise StandardError, e
|
24
27
|
end
|
25
28
|
|
26
29
|
def create_query class_name: "souls"
|
@@ -42,16 +45,19 @@ module Souls
|
|
42
45
|
end
|
43
46
|
end
|
44
47
|
EOS
|
48
|
+
puts "Created file! : #{file_path}"
|
45
49
|
file_path
|
50
|
+
rescue StandardError => e
|
51
|
+
raise StandardError, e
|
46
52
|
end
|
47
53
|
end
|
48
54
|
|
49
55
|
def query class_name: "souls"
|
50
56
|
singularized_class_name = class_name.singularize
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
57
|
+
create_query(class_name: singularized_class_name)
|
58
|
+
create_queries(class_name: singularized_class_name)
|
59
|
+
rescue StandardError => e
|
60
|
+
raise StandardError, e
|
55
61
|
end
|
56
62
|
end
|
57
63
|
end
|
@@ -144,8 +144,11 @@ module Souls
|
|
144
144
|
resolver_params class_name: singularized_class_name
|
145
145
|
resolver_after_params class_name: singularized_class_name
|
146
146
|
resolver_before_end class_name: singularized_class_name
|
147
|
-
# puts "File Created!\n#{file_path}"
|
148
147
|
resolver_end class_name: singularized_class_name
|
148
|
+
puts "Created file! : #{file_path}"
|
149
|
+
file_path
|
150
|
+
rescue StandardError => e
|
151
|
+
raise StandardError, e
|
149
152
|
end
|
150
153
|
end
|
151
154
|
end
|
@@ -58,6 +58,10 @@ module Souls
|
|
58
58
|
rspec_factory_head class_name: singularized_class_name
|
59
59
|
rspec_factory_params class_name: singularized_class_name
|
60
60
|
rspec_factory_end class_name: singularized_class_name
|
61
|
+
puts "Created file! : #{file_path}"
|
62
|
+
file_path
|
63
|
+
rescue StandardError => e
|
64
|
+
raise StandardError, e
|
61
65
|
end
|
62
66
|
end
|
63
67
|
end
|
@@ -243,6 +243,10 @@ module Souls
|
|
243
243
|
rspec_mutation_params class_name: singularized_class_name
|
244
244
|
rspec_mutation_params_response class_name: singularized_class_name
|
245
245
|
rspec_mutation_end class_name: singularized_class_name
|
246
|
+
puts "Created file! : #{file_path}"
|
247
|
+
file_path
|
248
|
+
rescue StandardError => e
|
249
|
+
raise StandardError, e
|
246
250
|
end
|
247
251
|
end
|
248
252
|
end
|
@@ -15,36 +15,31 @@ module Souls
|
|
15
15
|
let(:#{class_name.underscore}) { FactoryBot.create(:#{class_name.underscore}) }
|
16
16
|
|
17
17
|
context "being a visitor" do
|
18
|
-
let(:user) { FactoryBot.create(:user) }
|
18
|
+
let(:user) { FactoryBot.create(:user, user_role: :normal) }
|
19
19
|
|
20
20
|
it { is_expected.to permit_action(:index) }
|
21
21
|
it { is_expected.to permit_action(:show) }
|
22
22
|
it { is_expected.to forbid_actions([:create, :update, :delete]) }
|
23
23
|
end
|
24
24
|
|
25
|
-
context "being a
|
26
|
-
let(:user) { FactoryBot.create(:user, user_role:
|
27
|
-
|
28
|
-
it { is_expected.to permit_action(:index) }
|
29
|
-
it { is_expected.to permit_action(:show) }
|
30
|
-
it { is_expected.to forbid_actions([:create, :update, :delete]) }
|
31
|
-
end
|
32
|
-
|
33
|
-
context "being a staff" do
|
34
|
-
let(:user) { FactoryBot.create(:user, user_role: 3) }
|
25
|
+
context "being a user" do
|
26
|
+
let(:user) { FactoryBot.create(:user, user_role: :user) }
|
35
27
|
|
36
28
|
it { is_expected.to permit_actions([:create, :update]) }
|
37
29
|
end
|
38
30
|
|
39
|
-
context "being an
|
40
|
-
let(:user) { FactoryBot.create(:user, user_role:
|
31
|
+
context "being an admin" do
|
32
|
+
let(:user) { FactoryBot.create(:user, user_role: :admin) }
|
41
33
|
|
42
34
|
it { is_expected.to permit_actions([:create, :update, :delete]) }
|
43
35
|
end
|
44
36
|
end
|
45
37
|
EOS
|
46
38
|
end
|
39
|
+
puts "Created file! : #{file_path}"
|
47
40
|
file_path
|
41
|
+
rescue StandardError => e
|
42
|
+
raise StandardError, e
|
48
43
|
end
|
49
44
|
end
|
50
45
|
end
|
@@ -164,6 +164,10 @@ break
|
|
164
164
|
rspec_query_after_head class_name: singularized_class_name
|
165
165
|
rspec_query_params class_name: singularized_class_name
|
166
166
|
rspec_query_end class_name: singularized_class_name
|
167
|
+
puts "Created file! : #{file_path}"
|
168
|
+
file_path
|
169
|
+
rescue StandardError => e
|
170
|
+
raise StandardError, e
|
167
171
|
end
|
168
172
|
end
|
169
173
|
end
|
@@ -183,6 +183,10 @@ module Souls
|
|
183
183
|
rspec_resolver_after_head class_name: singularized_class_name
|
184
184
|
rspec_resolver_params class_name: singularized_class_name
|
185
185
|
rspec_resolver_end class_name: singularized_class_name
|
186
|
+
puts "Created file! : #{file_path}"
|
187
|
+
file_path
|
188
|
+
rescue StandardError => e
|
189
|
+
raise StandardError, e
|
186
190
|
end
|
187
191
|
end
|
188
192
|
end
|
data/lib/souls/generate/type.rb
CHANGED
@@ -1,9 +1,7 @@
|
|
1
1
|
module Souls
|
2
2
|
module Generate
|
3
3
|
class << self
|
4
|
-
## Generate
|
5
|
-
## 1. Type
|
6
|
-
## 2. Node Type
|
4
|
+
## Generate Type
|
7
5
|
def create_type_head class_name: "souls"
|
8
6
|
file_path = "./app/graphql/types/#{class_name}_type.rb"
|
9
7
|
File.open(file_path, "w") do |f|
|
@@ -55,30 +53,17 @@ module Souls
|
|
55
53
|
file_path
|
56
54
|
end
|
57
55
|
|
58
|
-
def node_type class_name: "souls"
|
59
|
-
file_path = "./app/graphql/types/#{class_name.singularize}_node_type.rb"
|
60
|
-
File.open(file_path, "w") do |f|
|
61
|
-
f.write <<~EOS
|
62
|
-
module Types
|
63
|
-
class #{class_name.camelize}NodeType < BaseObject
|
64
|
-
field :node, Types::#{class_name.camelize}Type, null: true
|
65
|
-
end
|
66
|
-
end
|
67
|
-
EOS
|
68
|
-
end
|
69
|
-
file_path
|
70
|
-
end
|
71
|
-
|
72
56
|
def type class_name: "souls"
|
73
57
|
singularized_class_name = class_name.singularize
|
74
|
-
file_path = "./app/graphql/types/#{singularized_class_name}
|
58
|
+
file_path = "./app/graphql/types/#{singularized_class_name}_type.rb"
|
75
59
|
return "Type already exist! #{file_path}" if File.exist? file_path
|
76
60
|
create_type_head class_name: singularized_class_name
|
77
61
|
create_type_params class_name: singularized_class_name
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
62
|
+
create_type_end class_name: singularized_class_name
|
63
|
+
puts "Created file! : #{file_path}"
|
64
|
+
file_path
|
65
|
+
rescue StandardError => e
|
66
|
+
raise StandardError, e
|
82
67
|
end
|
83
68
|
end
|
84
69
|
end
|
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.22.
|
4
|
+
version: 0.22.2
|
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-07-
|
13
|
+
date: 2021-07-13 00:00:00.000000000 Z
|
14
14
|
dependencies: []
|
15
15
|
description: SOULs is a Serverless Application Framework. SOULs has four strains,
|
16
16
|
API, Worker, Console, Media, and can be used in combination according to the purpose.
|
@@ -49,6 +49,8 @@ files:
|
|
49
49
|
- lib/souls/gcloud/iam.rb
|
50
50
|
- lib/souls/generate.rb
|
51
51
|
- lib/souls/generate/application.rb
|
52
|
+
- lib/souls/generate/connection.rb
|
53
|
+
- lib/souls/generate/edge.rb
|
52
54
|
- lib/souls/generate/model.rb
|
53
55
|
- lib/souls/generate/mutation.rb
|
54
56
|
- lib/souls/generate/policy.rb
|