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.
@@ -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: "souls")
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: "souls")
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: "souls")
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: "souls")
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
- current_ip = `curl inet-ip.info`
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("gcloud beta sql instances patch #{instance_name} --project=#{project_id} --assign-ip=#{current_ip}")
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,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.44.5".freeze
2
+ VERSION = "0.45.2".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.23.5
1
+ 0.24.2
@@ -1 +1 @@
1
- 0.23.5
1
+ 0.24.2
@@ -43,6 +43,7 @@ module Souls
43
43
  rescue StandardError => e
44
44
  GraphQL::ExecutionError.new(e.to_s)
45
45
  end
46
+ end
46
47
  end
47
48
  TEXT
48
49
  end
@@ -2,11 +2,20 @@ module Souls
2
2
  module Worker
3
3
  module Generate
4
4
  class << self
5
- def mutation(class_name: "csv_export")
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, "Mailer already exist! #{file_path}") if File.exist?(file_path)
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)
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.44.5
4
+ version: 0.45.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI