souls 0.44.5 → 0.45.2
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/README.md +5 -2
- data/exe/souls +9 -1
- data/lib/souls/api/generate/application.rb +145 -143
- data/lib/souls/api/generate/connection.rb +1 -1
- data/lib/souls/api/generate/edge.rb +1 -1
- data/lib/souls/api/generate/model.rb +1 -1
- data/lib/souls/api/generate/mutation.rb +221 -219
- data/lib/souls/api/generate/policy.rb +1 -1
- data/lib/souls/api/generate/query.rb +49 -47
- data/lib/souls/api/generate/resolver.rb +123 -121
- data/lib/souls/api/generate/rspec_factory.rb +49 -47
- data/lib/souls/api/generate/rspec_model.rb +1 -1
- data/lib/souls/api/generate/rspec_mutation.rb +215 -213
- data/lib/souls/api/generate/rspec_policy.rb +1 -1
- data/lib/souls/api/generate/rspec_query.rb +134 -132
- data/lib/souls/api/generate/rspec_resolver.rb +159 -157
- data/lib/souls/api/generate/type.rb +4 -4
- data/lib/souls/cli/gcloud/sql/index.rb +11 -5
- data/lib/souls/version.rb +1 -1
- data/lib/souls/versions/.souls_api_version +1 -1
- data/lib/souls/versions/.souls_worker_version +1 -1
- data/lib/souls/worker/generate/mailer.rb +1 -0
- data/lib/souls/worker/generate/mutation.rb +11 -2
- metadata +1 -1
@@ -2,7 +2,7 @@ module Souls
|
|
2
2
|
module Api::Generate
|
3
3
|
class << self
|
4
4
|
## Generate Type
|
5
|
-
def create_type_head(class_name: "
|
5
|
+
def create_type_head(class_name: "user")
|
6
6
|
file_dir = "./app/graphql/types/"
|
7
7
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
8
8
|
file_path = "./app/graphql/types/#{class_name}_type.rb"
|
@@ -16,7 +16,7 @@ module Souls
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
-
def create_type_params(class_name: "
|
19
|
+
def create_type_params(class_name: "user")
|
20
20
|
file_path = "./app/graphql/types/#{class_name}_type.rb"
|
21
21
|
path = "./db/schema.rb"
|
22
22
|
@on = false
|
@@ -52,7 +52,7 @@ module Souls
|
|
52
52
|
end
|
53
53
|
end
|
54
54
|
|
55
|
-
def create_type_end(class_name: "
|
55
|
+
def create_type_end(class_name: "user")
|
56
56
|
file_path = "./app/graphql/types/#{class_name}_type.rb"
|
57
57
|
File.open(file_path, "a") do |f|
|
58
58
|
f.write(<<~TEXT)
|
@@ -63,7 +63,7 @@ module Souls
|
|
63
63
|
file_path
|
64
64
|
end
|
65
65
|
|
66
|
-
def type(class_name: "
|
66
|
+
def type(class_name: "user")
|
67
67
|
singularized_class_name = class_name.singularize
|
68
68
|
file_path = "./app/graphql/types/#{singularized_class_name}_type.rb"
|
69
69
|
return "Type already exist! #{file_path}" if File.exist?(file_path)
|
@@ -4,11 +4,9 @@ module Souls
|
|
4
4
|
class << self
|
5
5
|
def create_instance(instance_name: "", root_pass: "Postgre123!", zone: "asia-northeast1-b")
|
6
6
|
instance_name = "#{Souls.configuration.app}-db" if instance_name.blank?
|
7
|
-
current_ip = `curl inet-ip.info`
|
8
7
|
system(
|
9
8
|
"gcloud sql instances create #{instance_name} \
|
10
9
|
--database-version=POSTGRES_13 --cpu=2 --memory=7680MB --zone=#{zone} \
|
11
|
-
--assign-ip=#{current_ip} \
|
12
10
|
--root-password='#{root_pass}' --database-flags cloudsql.iam_authentication=on"
|
13
11
|
)
|
14
12
|
end
|
@@ -20,11 +18,19 @@ module Souls
|
|
20
18
|
system("gcloud beta sql instances patch #{instance_name} --project=#{project_id} --network=#{app_name}")
|
21
19
|
end
|
22
20
|
|
23
|
-
def assign_ip(instance_name: "")
|
24
|
-
|
21
|
+
def assign_ip(instance_name: "", ip: "")
|
22
|
+
ip = `curl inet-ip.info` if ip.blank?
|
25
23
|
project_id = Souls.configuration.project_id
|
26
24
|
instance_name = "#{Souls.configuration.app}-db" if instance_name.blank?
|
27
|
-
system(
|
25
|
+
system(
|
26
|
+
"
|
27
|
+
gcloud beta sql instances patch #{instance_name} \
|
28
|
+
--project=#{project_id} \
|
29
|
+
--assign-ip \
|
30
|
+
--authorized-networks=#{ip} \
|
31
|
+
--quiet
|
32
|
+
"
|
33
|
+
)
|
28
34
|
end
|
29
35
|
end
|
30
36
|
end
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.24.2
|
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.24.2
|
@@ -2,11 +2,20 @@ module Souls
|
|
2
2
|
module Worker
|
3
3
|
module Generate
|
4
4
|
class << self
|
5
|
-
def mutation(class_name: "
|
5
|
+
def mutation(class_name: "send-mailer", option: "")
|
6
|
+
case option
|
7
|
+
when "--mailer"
|
8
|
+
mailer(class_name: class_name)
|
9
|
+
else
|
10
|
+
create_mutation(class_name: class_name)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def create_mutation(class_name: "send-mailer")
|
6
15
|
file_dir = "./app/graphql/mutations/"
|
7
16
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
8
17
|
file_path = "#{file_dir}#{class_name.singularize}.rb"
|
9
|
-
raise(StandardError, "
|
18
|
+
raise(StandardError, "Mutation already exist! #{file_path}") if File.exist?(file_path)
|
10
19
|
|
11
20
|
File.open(file_path, "w") do |f|
|
12
21
|
f.write(<<~TEXT)
|