souls 1.12.2 → 1.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/lib/souls/app/index.rb +1 -0
  3. data/lib/souls/app/utils/firebase_id_token.rb +1 -1
  4. data/lib/souls/app/utils/painter.rb +33 -0
  5. data/lib/souls/app/utils/souls_logger.rb +1 -1
  6. data/lib/souls/cli/create/index.rb +14 -12
  7. data/lib/souls/cli/db/create_migration_rbs.rb +1 -1
  8. data/lib/souls/cli/db/index.rb +1 -0
  9. data/lib/souls/cli/db/model.rb +1 -1
  10. data/lib/souls/cli/db/model_rbs.rb +1 -1
  11. data/lib/souls/cli/db/rspec_model.rb +1 -1
  12. data/lib/souls/cli/delete/connection_rbs.rb +1 -1
  13. data/lib/souls/cli/delete/edge.rb +1 -1
  14. data/lib/souls/cli/delete/job.rb +1 -1
  15. data/lib/souls/cli/delete/job_rbs.rb +1 -1
  16. data/lib/souls/cli/delete/manager.rb +1 -1
  17. data/lib/souls/cli/delete/manager_rbs.rb +1 -1
  18. data/lib/souls/cli/delete/migration_file.rb +24 -0
  19. data/lib/souls/cli/delete/mutation.rb +1 -1
  20. data/lib/souls/cli/delete/mutation_rbs.rb +1 -1
  21. data/lib/souls/cli/delete/query.rb +1 -1
  22. data/lib/souls/cli/delete/query_rbs.rb +1 -1
  23. data/lib/souls/cli/delete/resolver.rb +1 -1
  24. data/lib/souls/cli/delete/resolver_rbs.rb +1 -1
  25. data/lib/souls/cli/delete/rspec_factory.rb +1 -1
  26. data/lib/souls/cli/delete/rspec_job.rb +1 -1
  27. data/lib/souls/cli/delete/rspec_manager.rb +1 -1
  28. data/lib/souls/cli/delete/rspec_mutation.rb +1 -1
  29. data/lib/souls/cli/delete/rspec_query.rb +1 -1
  30. data/lib/souls/cli/delete/rspec_resolver.rb +1 -1
  31. data/lib/souls/cli/delete/type.rb +1 -1
  32. data/lib/souls/cli/delete/type_rbs.rb +1 -1
  33. data/lib/souls/cli/gcloud/compute/index.rb +2 -2
  34. data/lib/souls/cli/gcloud/iam/index.rb +8 -2
  35. data/lib/souls/cli/gcloud/sql/index.rb +46 -38
  36. data/lib/souls/cli/generate/connection.rb +1 -1
  37. data/lib/souls/cli/generate/connection_rbs.rb +1 -1
  38. data/lib/souls/cli/generate/edge.rb +1 -1
  39. data/lib/souls/cli/generate/edge_rbs.rb +2 -2
  40. data/lib/souls/cli/generate/job.rb +4 -4
  41. data/lib/souls/cli/generate/job_rbs.rb +1 -1
  42. data/lib/souls/cli/generate/manager.rb +7 -4
  43. data/lib/souls/cli/generate/manager_rbs.rb +2 -2
  44. data/lib/souls/cli/generate/mutation.rb +4 -4
  45. data/lib/souls/cli/generate/mutation_rbs.rb +4 -4
  46. data/lib/souls/cli/generate/query.rb +2 -2
  47. data/lib/souls/cli/generate/query_rbs.rb +2 -2
  48. data/lib/souls/cli/generate/resolver.rb +1 -1
  49. data/lib/souls/cli/generate/resolver_rbs.rb +2 -2
  50. data/lib/souls/cli/generate/rspec_factory.rb +1 -1
  51. data/lib/souls/cli/generate/rspec_job.rb +1 -1
  52. data/lib/souls/cli/generate/rspec_manager.rb +1 -1
  53. data/lib/souls/cli/generate/rspec_mutation.rb +1 -1
  54. data/lib/souls/cli/generate/rspec_query.rb +1 -1
  55. data/lib/souls/cli/generate/rspec_resolver.rb +1 -1
  56. data/lib/souls/cli/generate/type.rb +1 -1
  57. data/lib/souls/cli/generate/type_rbs.rb +1 -1
  58. data/lib/souls/cli/github/index.rb +10 -7
  59. data/lib/souls/cli/release/release.rb +1 -1
  60. data/lib/souls/cli/sync/conf.rb +5 -7
  61. data/lib/souls/cli/sync/model.rb +1 -1
  62. data/lib/souls/cli/sync/pubsub.rb +1 -1
  63. data/lib/souls/cli/update/mutation.rb +6 -10
  64. data/lib/souls/cli/update/mutation_rbs.rb +2 -2
  65. data/lib/souls/cli/update/resolver.rb +1 -1
  66. data/lib/souls/cli/update/rspec_factory.rb +1 -1
  67. data/lib/souls/cli/update/rspec_mutation.rb +1 -1
  68. data/lib/souls/cli/update/rspec_resolver.rb +1 -1
  69. data/lib/souls/cli/update/type.rb +1 -1
  70. data/lib/souls/cli/update/type_rbs.rb +1 -1
  71. data/lib/souls/cli/upgrade/config.rb +3 -0
  72. data/lib/souls/version.rb +1 -1
  73. data/lib/souls/versions/.souls_api_version +1 -1
  74. data/lib/souls/versions/.souls_worker_version +1 -1
  75. metadata +4 -2
@@ -37,7 +37,7 @@ module Souls
37
37
  end
38
38
  TEXT
39
39
  end
40
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
40
+ Souls::Painter.create_file(file_path.to_s)
41
41
  file_path
42
42
  end
43
43
 
@@ -56,7 +56,7 @@ module Souls
56
56
  end
57
57
  TEXT
58
58
  end
59
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
59
+ Souls::Painter.create_file(file_path.to_s)
60
60
  file_path
61
61
  end
62
62
 
@@ -95,7 +95,7 @@ module Souls
95
95
  end
96
96
  TEXT
97
97
  end
98
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
98
+ Souls::Painter.create_file(file_path.to_s)
99
99
  file_path
100
100
  end
101
101
 
@@ -114,7 +114,7 @@ module Souls
114
114
  end
115
115
  TEXT
116
116
  end
117
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
117
+ Souls::Painter.create_file(file_path.to_s)
118
118
  file_path
119
119
  end
120
120
  end
@@ -32,7 +32,7 @@ module Souls
32
32
  end
33
33
  TEXT
34
34
  end
35
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
35
+ Souls::Painter.create_file(file_path.to_s)
36
36
  puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [type_file_path.to_s, :white] }])
37
37
  end
38
38
  file_path
@@ -4,6 +4,11 @@ module Souls
4
4
  method_option :mutation, aliases: "--mutation", required: true, desc: "Mutation File Name"
5
5
  def manager(class_name)
6
6
  singularized_class_name = class_name.underscore.singularize
7
+ current_path = FileUtils.pwd
8
+ unless current_path.split("/").last == "api" || current_path.split("/").last == "souls"
9
+ raise(StandardError, "You Are at Wrong Directory! Please Go to Api Directory!")
10
+ end
11
+
7
12
  create_manager(class_name, options[:mutation])
8
13
  Souls::Generate.new.invoke(:manager_rbs, [singularized_class_name], { mutation: options[:mutation] })
9
14
  Souls::Generate.new.invoke(:rspec_manager, [singularized_class_name], { mutation: options[:mutation] })
@@ -25,22 +30,20 @@ module Souls
25
30
  class #{mutation.underscore.camelize} < BaseMutation
26
31
  description "#{mutation} description"
27
32
  ## Edit `argument` and `field`
28
- argument :argument, String, required: true
33
+ argument :argument, String, required: false
29
34
 
30
35
  field :response, String, null: false
31
36
 
32
37
  def resolve(args)
33
38
  # Define Here
34
39
  { response: "success!" }
35
- rescue StandardError => e
36
- GraphQL::ExecutionError.new(e.message)
37
40
  end
38
41
  end
39
42
  end
40
43
  end
41
44
  TEXT
42
45
  end
43
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
46
+ Souls::Painter.create_file(file_path.to_s)
44
47
  file_path
45
48
  end
46
49
  end
@@ -13,7 +13,7 @@ module Souls
13
13
  f.write(<<~TEXT)
14
14
  module Mutations
15
15
  module Managers
16
- module #{singularized_class_name.camelize}Manager
16
+ module #{singularized_class_name.camelize}Manager < BaseMutation
17
17
  class #{options[:mutation].singularize.camelize}
18
18
  def self.description: (String)-> untyped
19
19
  def self.argument: (untyped, untyped, untyped)-> untyped
@@ -23,7 +23,7 @@ module Souls
23
23
  end
24
24
  end
25
25
  TEXT
26
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
26
+ Souls::Painter.create_file(file_path.to_s)
27
27
  end
28
28
  end
29
29
  file_path
@@ -83,7 +83,7 @@ module Souls
83
83
  end
84
84
  TEXT
85
85
  end
86
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
86
+ Souls::Painter.create_file(file_path.to_s)
87
87
  file_path
88
88
  end
89
89
 
@@ -155,7 +155,7 @@ module Souls
155
155
  end
156
156
  TEXT
157
157
  end
158
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
158
+ Souls::Painter.create_file(file_path.to_s)
159
159
  file_path
160
160
  end
161
161
 
@@ -183,7 +183,7 @@ module Souls
183
183
  end
184
184
  TEXT
185
185
  end
186
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
186
+ Souls::Painter.create_file(file_path.to_s)
187
187
  file_path
188
188
  end
189
189
 
@@ -211,7 +211,7 @@ module Souls
211
211
  end
212
212
  TEXT
213
213
  end
214
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
214
+ Souls::Painter.create_file(file_path.to_s)
215
215
  file_path
216
216
  rescue StandardError => e
217
217
  puts(e)
@@ -97,7 +97,7 @@ module Souls
97
97
  TEXT
98
98
  end
99
99
  end
100
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
100
+ Souls::Painter.create_file(file_path.to_s)
101
101
  file_path
102
102
  end
103
103
 
@@ -176,7 +176,7 @@ module Souls
176
176
  TEXT
177
177
  end
178
178
  end
179
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
179
+ Souls::Painter.create_file(file_path.to_s)
180
180
  file_path
181
181
  end
182
182
 
@@ -204,7 +204,7 @@ module Souls
204
204
  end
205
205
  TEXT
206
206
  end
207
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
207
+ Souls::Painter.create_file(file_path.to_s)
208
208
  end
209
209
  file_path
210
210
  end
@@ -233,7 +233,7 @@ module Souls
233
233
  end
234
234
  TEXT
235
235
  end
236
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
236
+ Souls::Painter.create_file(file_path.to_s)
237
237
  end
238
238
  file_path
239
239
  end
@@ -28,7 +28,7 @@ module Souls
28
28
  end
29
29
  TEXT
30
30
  end
31
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
31
+ Souls::Painter.create_file(file_path.to_s)
32
32
  file_path
33
33
  rescue StandardError => e
34
34
  raise(StandardError, e)
@@ -52,7 +52,7 @@ module Souls
52
52
  end
53
53
  end
54
54
  TEXT
55
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
55
+ Souls::Painter.create_file(file_path.to_s)
56
56
  file_path
57
57
  rescue StandardError => e
58
58
  raise(StandardError, e)
@@ -31,7 +31,7 @@ module Souls
31
31
  end
32
32
  TEXT
33
33
  end
34
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
34
+ Souls::Painter.create_file(file_path.to_s)
35
35
  end
36
36
  file_path
37
37
  end
@@ -55,7 +55,7 @@ module Souls
55
55
  end
56
56
  TEXT
57
57
  end
58
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
58
+ Souls::Painter.create_file(file_path.to_s)
59
59
  end
60
60
  file_path
61
61
  end
@@ -11,7 +11,7 @@ module Souls
11
11
  resolver_after_params(class_name: singularized_class_name)
12
12
  resolver_before_end(class_name: singularized_class_name)
13
13
  resolver_end(class_name: singularized_class_name)
14
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
14
+ Souls::Painter.create_file(file_path.to_s)
15
15
  file_path
16
16
  end
17
17
 
@@ -24,7 +24,7 @@ module Souls
24
24
  def decode_global_key: (String value) -> Integer
25
25
  def apply_filter: (untyped scope, untyped value) -> untyped
26
26
 
27
- class #{singularized_class_name.camelize}Filter
27
+ class #{singularized_class_name.camelize}Filter < Souls::Types::BaseInputObject
28
28
  String: String
29
29
  Boolean: Boolean
30
30
  Integer: Integer
@@ -33,7 +33,7 @@ module Souls
33
33
  TEXT
34
34
  end
35
35
  end
36
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
36
+ Souls::Painter.create_file(file_path.to_s)
37
37
  file_path
38
38
  end
39
39
  end
@@ -9,7 +9,7 @@ module Souls
9
9
  rspec_factory_head(class_name: singularized_class_name)
10
10
  rspec_factory_params(class_name: singularized_class_name)
11
11
  rspec_factory_end(class_name: singularized_class_name)
12
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
12
+ Souls::Painter.create_file(file_path.to_s)
13
13
  file_path
14
14
  end
15
15
 
@@ -69,7 +69,7 @@ module Souls
69
69
  TEXT
70
70
  end
71
71
  end
72
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
72
+ Souls::Painter.create_file(file_path.to_s)
73
73
  file_path
74
74
  end
75
75
  end
@@ -40,7 +40,7 @@ module Souls
40
40
  end
41
41
  TEXT
42
42
  end
43
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
43
+ Souls::Painter.create_file(file_path.to_s)
44
44
  file_path
45
45
  end
46
46
  end
@@ -11,7 +11,7 @@ module Souls
11
11
  rspec_mutation_params(class_name: singularized_class_name)
12
12
  rspec_mutation_params_response(class_name: singularized_class_name)
13
13
  rspec_mutation_end(class_name: singularized_class_name)
14
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
14
+ Souls::Painter.create_file(file_path.to_s)
15
15
  file_path
16
16
  rescue StandardError => e
17
17
  raise(StandardError, e)
@@ -10,7 +10,7 @@ module Souls
10
10
  rspec_query_after_head(singularized_class_name)
11
11
  rspec_query_params(singularized_class_name)
12
12
  rspec_query_end(singularized_class_name)
13
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
13
+ Souls::Painter.create_file(file_path.to_s)
14
14
  file_path
15
15
  end
16
16
 
@@ -10,7 +10,7 @@ module Souls
10
10
  rspec_resolver_after_head(singularized_class_name)
11
11
  rspec_resolver_params(singularized_class_name)
12
12
  rspec_resolver_end(singularized_class_name)
13
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
13
+ Souls::Painter.create_file(file_path.to_s)
14
14
  file_path
15
15
  end
16
16
 
@@ -9,7 +9,7 @@ module Souls
9
9
  create_type_head(class_name: singularized_class_name)
10
10
  create_type_params(class_name: singularized_class_name)
11
11
  create_type_end(class_name: singularized_class_name)
12
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
12
+ Souls::Painter.create_file(file_path.to_s)
13
13
  file_path
14
14
  end
15
15
 
@@ -49,7 +49,7 @@ module Souls
49
49
  TEXT
50
50
  end
51
51
  end
52
- puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
52
+ Souls::Painter.create_file(file_path.to_s)
53
53
  file_path
54
54
  end
55
55
  end
@@ -33,14 +33,16 @@ module Souls
33
33
  remote_url = `git remote get-url origin`
34
34
  split_url = %r{(https://|git@)(github.com)(:|/)([^.]+/[^.]+)(\.git)?}.match(remote_url)
35
35
  if split_url.nil? || split_url.size != 6
36
- raise(CLIException, "Cannot access Github, please check your credentials")
36
+ Souls::Painter.error("Cannot access Github, please check your credentials")
37
+ return
37
38
  end
38
39
 
39
40
  api_request = "gh api -X GET 'repos/#{split_url[4]}/actions/runs'"
40
41
  workflows = JSON.parse(`#{api_request}`)
41
42
 
42
43
  if workflows.nil? || !workflows.key?("workflow_runs")
43
- raise(CLIException, "Failed to parse JSON response from Github")
44
+ Souls::Painter.error("Failed to parse JSON response from Github")
45
+ return
44
46
  end
45
47
 
46
48
  wf_info =
@@ -51,7 +53,8 @@ module Souls
51
53
  wf_id =
52
54
  case wf_info.size
53
55
  when 0
54
- raise(CLIException, "No workflow is running")
56
+ Souls::Painter.error("No workflow is running")
57
+ return
55
58
  when 1
56
59
  wf_info[0].values[0]
57
60
  else
@@ -70,7 +73,7 @@ module Souls
70
73
  File.open(file_path, "a") do |line|
71
74
  dqm ? line.write("\n#{key.upcase}=\"#{value}\"") : line.write("\n#{key.upcase}=#{value}")
72
75
  end
73
- puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
76
+ Souls::Painter.update_file(file_path.to_s)
74
77
  end
75
78
  end
76
79
 
@@ -80,7 +83,7 @@ module Souls
80
83
  File.open(file_path, "a") do |line|
81
84
  dqm ? line.write("\n#{key.upcase}=\"#{value}\"") : line.write("\n#{key.upcase}=#{value}")
82
85
  end
83
- puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
86
+ Souls::Painter.update_file(file_path.to_s)
84
87
  end
85
88
  end
86
89
 
@@ -93,7 +96,7 @@ module Souls
93
96
  File.open(file_path, "a") do |line|
94
97
  dqm ? line.write("\n#{key.upcase}=\"#{value}\"") : line.write("\n#{key.upcase}=#{value}")
95
98
  end
96
- puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
99
+ Souls::Painter.update_file(file_path.to_s)
97
100
  end
98
101
  end
99
102
  end
@@ -106,7 +109,7 @@ module Souls
106
109
  worker_workflow[worker_workflow.size - 1] = worker_workflow.last.chomp
107
110
  worker_workflow << " \\\n --set-env-vars=\"#{key.upcase}=${{ secrets.#{key.upcase} }}\""
108
111
  File.open(file_path, "w") { |f| f.write(worker_workflow.join) }
109
- puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
112
+ Souls::Painter.update_file(file_path.to_s)
110
113
  end
111
114
  end
112
115
  end
@@ -4,7 +4,7 @@ module Souls
4
4
  class CLI < Thor
5
5
  desc "release", "Release Gem"
6
6
  def release
7
- raise(StandardError, "hey! It's Broken!") unless system("rspec")
7
+ Souls::Painter.error("hey! It's Broken!") unless system("rspec")
8
8
 
9
9
  system("gem install souls")
10
10
  sleep(3)
@@ -5,15 +5,13 @@ module Souls
5
5
  Souls::Gcloud.new.config_set
6
6
  update_conf
7
7
  update_conf(strain: "api")
8
- puts(
9
- Paint % [
10
- "Synced! : %{white_text}",
11
- :green,
12
- { white_text: ["`config/souls.rb`, `apps/api/config/souls.rb`", :white] }
13
- ]
14
- )
8
+ Souls::Painter.sync("`config/souls.rb`, `apps/api/config/souls.rb`")
15
9
  end
16
10
 
11
+ # rubocop:disable Style/StringHashKeys
12
+ map "config" => "conf"
13
+ # rubocop:enable Style/StringHashKeys
14
+
17
15
  private
18
16
 
19
17
  def update_conf(strain: "mother")
@@ -11,7 +11,7 @@ module Souls
11
11
  cp_and_dl_files(dir: dir)
12
12
  cp_env_files
13
13
  end
14
- puts(Paint % ["Synced! : %{white_text}", :green, { white_text: [cp_dir.to_s, :white] }])
14
+ Souls::Painter.sync(cp_dir.to_s)
15
15
  end
16
16
 
17
17
  private
@@ -5,7 +5,7 @@ module Souls
5
5
  get_worker_endpoints
6
6
  Souls::Gcloud.new.config_set
7
7
  get_topics(workers: get_workers)
8
- puts(Paint["All Jobs Synced with PubSub Subscription!", :green])
8
+ Souls::Painter.sync("All Jobs with PubSub Subscription!")
9
9
  end
10
10
 
11
11
  private
@@ -9,15 +9,13 @@ module Souls
9
9
  dir_name = "./app/graphql/mutations/base/#{singularized_class_name}"
10
10
  file_path = "#{dir_name}/create_#{singularized_class_name}.rb"
11
11
  unless File.exist?(file_path)
12
- raise(
13
- Souls::CLIException,
14
- "File #{file_path} is missing. Please recreate it and then run this command again."
15
- )
12
+ Souls::Painter.error("File #{file_path} is missing. Please recreate it and then run this command again.")
13
+ return
16
14
  end
17
15
 
18
16
  mutation_argument = check_mutation_argument(class_name: "user", action: "create")
19
17
  overwrite_class_file(mutation_argument: mutation_argument, file_path: file_path, new_cols: new_cols)
20
- puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
18
+ Souls::Painter.update_file(file_path.to_s)
21
19
  end
22
20
 
23
21
  desc "update_mutation [CLASS_NAME]", "Update GraphQL Type from schema.rb"
@@ -27,16 +25,14 @@ module Souls
27
25
  dir_name = "./app/graphql/mutations/base/#{singularized_class_name}"
28
26
  file_path = "#{dir_name}/update_#{singularized_class_name}.rb"
29
27
  unless File.exist?(file_path)
30
- raise(
31
- Souls::CLIException,
32
- "File #{file_path} is missing. Please recreate it and then run this command again."
33
- )
28
+ Souls::Painter.error("File #{file_path} is missing. Please recreate it and then run this command again.")
29
+ return
34
30
  end
35
31
 
36
32
  mutation_argument = check_mutation_argument(class_name: class_name, action: "update")
37
33
  overwrite_class_file(mutation_argument: mutation_argument, file_path: file_path, new_cols: new_cols)
38
34
 
39
- puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
35
+ Souls::Painter.update_file(file_path.to_s)
40
36
  end
41
37
 
42
38
  private
@@ -56,7 +56,7 @@ module Souls
56
56
  end
57
57
  end
58
58
  File.open(file_path, "w") { |f| f.write(write_txt) }
59
- puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
59
+ Souls::Painter.update_file(file_path.to_s)
60
60
  end
61
61
 
62
62
  desc "update_mutation [CLASS_NAME]", "Update GraphQL Type from schema.rb"
@@ -120,7 +120,7 @@ module Souls
120
120
  end
121
121
  FileUtils.rm(file_path)
122
122
  FileUtils.mv(new_file_path, file_path)
123
- puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
123
+ Souls::Painter.update_file(file_path.to_s)
124
124
  end
125
125
  end
126
126
  end
@@ -45,7 +45,7 @@ module Souls
45
45
  end
46
46
  FileUtils.rm(file_path)
47
47
  FileUtils.mv(new_file_path, file_path)
48
- puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
48
+ Souls::Painter.update_file(file_path.to_s)
49
49
  end
50
50
 
51
51
  private
@@ -30,7 +30,7 @@ module Souls
30
30
  end
31
31
  FileUtils.rm(file_path)
32
32
  FileUtils.mv(new_file_path, file_path)
33
- puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
33
+ Souls::Painter.update_file(file_path.to_s)
34
34
  end
35
35
 
36
36
  private
@@ -68,7 +68,7 @@ module Souls
68
68
  end
69
69
  FileUtils.rm(file_path)
70
70
  FileUtils.mv(new_file_path, file_path)
71
- puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
71
+ Souls::Painter.update_file(file_path.to_s)
72
72
  end
73
73
 
74
74
  private
@@ -50,7 +50,7 @@ module Souls
50
50
  end
51
51
  FileUtils.rm(file_path)
52
52
  FileUtils.mv(new_file_path, file_path)
53
- puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
53
+ Souls::Painter.update_file(file_path.to_s)
54
54
  end
55
55
 
56
56
  private
@@ -28,7 +28,7 @@ module Souls
28
28
  end
29
29
  FileUtils.rm(file_path)
30
30
  FileUtils.mv(new_file_path, file_path)
31
- puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
31
+ Souls::Painter.update_file(file_path.to_s)
32
32
  end
33
33
 
34
34
  private
@@ -38,7 +38,7 @@ module Souls
38
38
  end
39
39
  FileUtils.rm(file_path)
40
40
  FileUtils.mv(new_file_path, file_path)
41
- puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
41
+ Souls::Painter.update_file(file_path.to_s)
42
42
  end
43
43
  end
44
44
  end
@@ -25,5 +25,8 @@ module Souls
25
25
  File.open(api_conf_path, "w") { |f| f.write(api_conf.join) }
26
26
  end
27
27
  end
28
+ # rubocop:disable Style/StringHashKeys
29
+ map "conf" => "config"
30
+ # rubocop:enable Style/StringHashKeys
28
31
  end
29
32
  end
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "1.12.2".freeze
2
+ VERSION = "1.13.0".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.12.2
1
+ 1.13.0
@@ -1 +1 @@
1
- 1.12.2
1
+ 1.13.0
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: 1.12.2
4
+ version: 1.13.0
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-12-10 00:00:00.000000000 Z
13
+ date: 2021-12-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -170,6 +170,7 @@ files:
170
170
  - lib/souls/app/graphql/types/index.rb
171
171
  - lib/souls/app/index.rb
172
172
  - lib/souls/app/utils/firebase_id_token.rb
173
+ - lib/souls/app/utils/painter.rb
173
174
  - lib/souls/app/utils/souls_logger.rb
174
175
  - lib/souls/cli.rb
175
176
  - lib/souls/cli/cli_exception.rb
@@ -191,6 +192,7 @@ files:
191
192
  - lib/souls/cli/delete/job_rbs.rb
192
193
  - lib/souls/cli/delete/manager.rb
193
194
  - lib/souls/cli/delete/manager_rbs.rb
195
+ - lib/souls/cli/delete/migration_file.rb
194
196
  - lib/souls/cli/delete/mutation.rb
195
197
  - lib/souls/cli/delete/mutation_rbs.rb
196
198
  - lib/souls/cli/delete/query.rb