souls 1.20.12 → 1.20.13

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 03a538eeba0db92dd83d08be53af29d75e1704b1bcd8b7d3938c36b61bb8d635
4
- data.tar.gz: 64ced1fc8f2a3bdb402b2b8695275793138fa7a03ff461c375a8b741416927d9
3
+ metadata.gz: 19d1e3315776d2ef59dcb09b40ed89d0441b305a39e3c708fe49aa26c2641493
4
+ data.tar.gz: 45f6aa63a95c14bd9401682498acdcff93959ddab79ec007ab3e037df8b09fc4
5
5
  SHA512:
6
- metadata.gz: d6dd3d1ef9b9386f9002fc5e66c05e36fb8c77551ecac080d51318446ce54ca205dc57e16309e49be69ec4deabc86a055ba65f9dc508267c2efda413b524b0b7
7
- data.tar.gz: 877529dfef5c6865ca0c6f4be2b6a1af31608a4bfef9458a1af5f175887df22875848c1ecb8824cfdcfcee75ccdacfe80679c146760add0086fdebaf60e762e6
6
+ metadata.gz: c432b5d8200137c1b37ef9e38e4c4196a654286d92eb34348bfc639144fc680702007c38d0a27917c1d1cc4c59425a37e1bf4f443fe93625eafe452f5db2a589
7
+ data.tar.gz: 1b04e1898f616fdd1d1d84bd3807a0693b7506d1f8013c9dc1b5d98261d8c7912e3a639176ff66a08a7c09c3287716a93297091fdc0ea16d61f5c0e9e2456eaf
@@ -9,12 +9,12 @@ module SOULs
9
9
  query_file_name = query_file_name.gsub("_", "-")
10
10
  topic_name = "souls-#{worker_name}-#{query_file_name}"
11
11
  query = query_file_name.underscore.camelize(:lower)
12
- query_string = souls_make_graphql_query(query: query, args: args)
12
+ query_string = souls_make_graphql_query(query:, args:)
13
13
  case ENV["RACK_ENV"]
14
14
  when "production"
15
- souls_publish_pubsub_queue(topic_name: topic_name, message: query_string)
15
+ souls_publish_pubsub_queue(topic_name:, message: query_string)
16
16
  when "development"
17
- puts(souls_post_to_dev(worker_name: worker_name, query_string: query_string))
17
+ puts(souls_post_to_dev(worker_name:, query_string:))
18
18
  end
19
19
  end
20
20
 
@@ -61,7 +61,7 @@ module SOULs
61
61
  end
62
62
 
63
63
  def souls_post_to_dev(worker_name: "", query_string: "")
64
- port = souls_get_worker(worker_name: worker_name)[0][:port]
64
+ port = souls_get_worker(worker_name:)[0][:port]
65
65
  endpoint = SOULs.configuration.endpoint
66
66
  res = Net::HTTP.post_form(URI.parse("http://localhost:#{port}#{endpoint}"), { query: query_string })
67
67
  res.body
@@ -46,7 +46,7 @@ module SOULs
46
46
  File.write(file_path, Object.const_get("Template::#{runtime}").__send__(method, file_name))
47
47
  SOULs::Painter.create_file(file_path)
48
48
  end
49
- create_env_yaml(file_dir: file_dir)
49
+ create_env_yaml(file_dir:)
50
50
  endroll = <<~TEXT
51
51
 
52
52
  ♤ Deploy Cloud Functions ♤
@@ -11,17 +11,17 @@ module SOULs
11
11
 
12
12
  workers = SOULs.configuration.workers
13
13
  port = 3000 + workers.size
14
- download_worker(worker_name: worker_name)
15
- souls_conf_update(worker_name: worker_name)
16
- souls_conf_update(worker_name: worker_name, strain: "api")
17
- workflow(worker_name: worker_name)
18
- procfile(worker_name: worker_name, port: port)
19
- mother_procfile(worker_name: worker_name)
20
- souls_config_init(worker_name: worker_name)
21
- steepfile(worker_name: worker_name)
22
- souls_helper_rbs(worker_name: worker_name)
14
+ download_worker(worker_name:)
15
+ souls_conf_update(worker_name:)
16
+ souls_conf_update(worker_name:, strain: "api")
17
+ workflow(worker_name:)
18
+ procfile(worker_name:, port:)
19
+ mother_procfile(worker_name:)
20
+ souls_config_init(worker_name:)
21
+ steepfile(worker_name:)
22
+ souls_helper_rbs(worker_name:)
23
23
  system("cd #{file_dir} && bundle")
24
- souls_worker_credit(worker_name: worker_name)
24
+ souls_worker_credit(worker_name:)
25
25
  end
26
26
  true
27
27
  end
@@ -298,7 +298,7 @@ end
298
298
  red2 = ["/ ___/", :red]
299
299
  red3 = ["(__ )", :red]
300
300
  red4 = ["/____/", :red]
301
- ms = Paint % [txt2, :blue, { red1: red1, red2: red2, red3: red3, red4: red4 }]
301
+ ms = Paint % [txt2, :blue, { red1:, red2:, red3:, red4: }]
302
302
  puts(ms)
303
303
  puts(line)
304
304
  welcome = Paint["SOULs Worker is Ready!", :white]
@@ -35,7 +35,7 @@ module SOULs
35
35
  rspec_mutation(class_name)
36
36
  rspec_query(class_name)
37
37
  rspec_resolver(class_name)
38
- run_rbs_scaffold(class_name: class_name)
38
+ run_rbs_scaffold(class_name:)
39
39
  end
40
40
 
41
41
  def run_rbs_scaffold(class_name: "user")
@@ -110,7 +110,7 @@ module SOULs
110
110
  "roles/cloudtranslate.admin"
111
111
  ]
112
112
  roles.each do |role|
113
- add_service_account_role(role: role)
113
+ add_service_account_role(role:)
114
114
  end
115
115
  end
116
116
 
@@ -18,7 +18,7 @@ module SOULs
18
18
  --database-version=#{db_type} --cpu=1 --memory=4096MB --zone=#{zone} \
19
19
  --root-password='#{password}' --database-flags cloudsql.iam_authentication=on"
20
20
  )
21
- SOULs::Sql.new.env(password: password)
21
+ SOULs::Sql.new.env(password:)
22
22
  SOULs::Github.new.secret_set
23
23
  SOULs::Painter.success("Cloud SQL #{instance_name} is successfully created! You can push to deploy!")
24
24
  true
@@ -68,7 +68,7 @@ module SOULs
68
68
  SOULS_DB_USER=postgres
69
69
  SOULS_GCP_PROJECT_ID=#{project_id}
70
70
  SOULS_SECRET_KEY_BASE='#{SecureRandom.base64(64)}'
71
- TZ="#{region_to_timezone(region: region)}"
71
+ TZ="#{region_to_timezone(region:)}"
72
72
  TEXT
73
73
  end
74
74
  SOULs::Painter.create_file(file_path)
@@ -85,7 +85,7 @@ module SOULs
85
85
  SOULS_GCP_REGION=#{region}
86
86
  SOULS_GCLOUDSQL_INSTANCE="#{project_id}:#{region}:#{instance_name}"
87
87
  SOULS_SECRET_KEY_BASE='#{SecureRandom.base64(64)}'
88
- TZ="#{region_to_timezone(region: region)}"
88
+ TZ="#{region_to_timezone(region:)}"
89
89
  TEXT
90
90
  end
91
91
  SOULs::Painter.create_file(file_path)
@@ -19,7 +19,7 @@ module SOULs
19
19
  file_path = "#{file_dir}/create_#{class_name}.rbs"
20
20
  raise(Thor::Error, "Mutation RBS already exist! #{file_path}") if File.exist?(file_path)
21
21
 
22
- params = SOULs.get_relation_params(class_name: class_name, col: "mutation")
22
+ params = SOULs.get_relation_params(class_name:, col: "mutation")
23
23
  File.open(file_path, "w") do |f|
24
24
  f.write(<<~TEXT)
25
25
  class Boolean
@@ -107,7 +107,7 @@ module SOULs
107
107
  file_dir = "./sig/api/app/graphql/mutations/base/#{class_name}"
108
108
  FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
109
109
  file_path = "#{file_dir}/update_#{class_name}.rbs"
110
- params = SOULs.get_relation_params(class_name: class_name, col: "mutation")
110
+ params = SOULs.get_relation_params(class_name:, col: "mutation")
111
111
  params[:params] << { column_name: "id", type: "string", array: false }
112
112
  File.open(file_path, "w") do |f|
113
113
  f.write(<<~TEXT)
@@ -63,7 +63,7 @@ module SOULs
63
63
  new_line.write(" argument :#{name}, #{field}, required: false\n")
64
64
  end
65
65
  end
66
- @on = true if SOULs.table_check(line: line, class_name: class_name)
66
+ @on = true if SOULs.table_check(line:, class_name:)
67
67
  end
68
68
  end
69
69
  end
@@ -128,7 +128,7 @@ module SOULs
128
128
  end
129
129
  end
130
130
  end
131
- @on = true if SOULs.table_check(line: line, class_name: class_name)
131
+ @on = true if SOULs.table_check(line:, class_name:)
132
132
  end
133
133
  end
134
134
  end
@@ -45,7 +45,7 @@ module SOULs
45
45
  new_line.write(" #{name} { #{field} }\n")
46
46
  end
47
47
  end
48
- @on = true if SOULs.table_check(line: line, class_name: class_name)
48
+ @on = true if SOULs.table_check(line:, class_name:)
49
49
  end
50
50
  end
51
51
  end
@@ -75,7 +75,7 @@ module SOULs
75
75
  new_line.write(" let(:#{relation_col}) { FactoryBot.create(:#{relation_col}) }\n")
76
76
  end
77
77
  end
78
- @on = true if SOULs.table_check(line: line, class_name: class_name)
78
+ @on = true if SOULs.table_check(line:, class_name:)
79
79
  end
80
80
  end
81
81
  end
@@ -130,7 +130,7 @@ module SOULs
130
130
  end
131
131
  end
132
132
  end
133
- @on = true if SOULs.table_check(line: line, class_name: class_name)
133
+ @on = true if SOULs.table_check(line:, class_name:)
134
134
  end
135
135
  end
136
136
  end
@@ -210,7 +210,7 @@ module SOULs
210
210
  end
211
211
  end
212
212
  end
213
- @on = true if SOULs.table_check(line: line, class_name: class_name)
213
+ @on = true if SOULs.table_check(line:, class_name:)
214
214
  end
215
215
  end
216
216
  end
@@ -262,7 +262,7 @@ module SOULs
262
262
  end
263
263
  end
264
264
  end
265
- @on = true if SOULs.table_check(line: line, class_name: class_name)
265
+ @on = true if SOULs.table_check(line:, class_name:)
266
266
  end
267
267
  end
268
268
  end
@@ -72,7 +72,7 @@ module SOULs
72
72
  new_line.write(" let(:#{relation_col}) { FactoryBot.create(:#{relation_col}) }\n")
73
73
  end
74
74
  end
75
- @on = true if SOULs.table_check(line: line, class_name: class_name)
75
+ @on = true if SOULs.table_check(line:, class_name:)
76
76
  end
77
77
  end
78
78
  end
@@ -119,7 +119,7 @@ module SOULs
119
119
  new_line.write(" #{name.camelize(:lower)}\n")
120
120
  end
121
121
  end
122
- @on = true if SOULs.table_check(line: line, class_name: class_name)
122
+ @on = true if SOULs.table_check(line:, class_name:)
123
123
  end
124
124
  end
125
125
  end
@@ -161,7 +161,7 @@ module SOULs
161
161
  end
162
162
  end
163
163
  end
164
- @on = true if SOULs.table_check(line: line, class_name: class_name)
164
+ @on = true if SOULs.table_check(line:, class_name:)
165
165
  end
166
166
  end
167
167
  end
@@ -78,7 +78,7 @@ module SOULs
78
78
  new_line.write(" let(:#{relation_col}) { FactoryBot.create(:#{relation_col}) }\n")
79
79
  end
80
80
  end
81
- @on = true if SOULs.table_check(line: line, class_name: class_name)
81
+ @on = true if SOULs.table_check(line:, class_name:)
82
82
  end
83
83
  end
84
84
  end
@@ -134,7 +134,7 @@ module SOULs
134
134
  new_line.write(" #{name.camelize(:lower)}\n")
135
135
  end
136
136
  end
137
- @on = true if SOULs.table_check(line: line, class_name: class_name)
137
+ @on = true if SOULs.table_check(line:, class_name:)
138
138
  end
139
139
  end
140
140
  end
@@ -186,7 +186,7 @@ module SOULs
186
186
  end
187
187
  end
188
188
  end
189
- @on = true if SOULs.table_check(line: line, class_name: class_name)
189
+ @on = true if SOULs.table_check(line:, class_name:)
190
190
  end
191
191
  end
192
192
  end
@@ -53,7 +53,7 @@ module SOULs
53
53
  new_line.write(" field :#{name}, #{field}, null: true\n")
54
54
  end
55
55
  end
56
- if SOULs.table_check(line: line, class_name: class_name)
56
+ if SOULs.table_check(line:, class_name:)
57
57
  @on = true
58
58
  new_line.write(" global_id_field :id\n")
59
59
  end
@@ -21,10 +21,10 @@ module SOULs
21
21
  prompt = TTY::Prompt.new
22
22
  key = prompt.ask("Set Key:")
23
23
  value = prompt.ask("Set Value:")
24
- update_env_production(key: key, value: value, dqm: options[:dqm])
25
- update_api_env(key: key, value: value, dqm: options[:dqm])
26
- update_workers_env(key: key, value: value, dqm: options[:dqm])
27
- update_github_actions(key: key)
24
+ update_env_production(key:, value:, dqm: options[:dqm])
25
+ update_api_env(key:, value:, dqm: options[:dqm])
26
+ update_workers_env(key:, value:, dqm: options[:dqm])
27
+ update_github_actions(key:)
28
28
  system("gh secret set #{key} -b \"#{value.strip}\"")
29
29
  end
30
30
 
@@ -16,10 +16,10 @@ module SOULs
16
16
  raise(StandardError, "Directory already exists and is not empty") if Dir.exist?(file_dir) && !Dir.empty?(file_dir)
17
17
 
18
18
  service_name = "api"
19
- download_souls(app_name: app_name, service_name: service_name)
20
- mother_config_init(app_name: app_name)
21
- download_github_actions(app_name: app_name)
22
- initial_config_init(app_name: app_name, service_name: service_name)
19
+ download_souls(app_name:, service_name:)
20
+ mother_config_init(app_name:)
21
+ download_github_actions(app_name:)
22
+ initial_config_init(app_name:, service_name:)
23
23
  system("cd #{app_name} && git init --initial-branch=main")
24
24
 
25
25
  system(" cd #{app_name} && rbs collection init && rbs collection install ")
@@ -121,7 +121,7 @@ module SOULs
121
121
  f.write(<<~TEXT)
122
122
  source "https://rubygems.org"
123
123
 
124
- gem "activesupport", "7.0.0"
124
+ gem "activesupport", "7.0.1"
125
125
  gem "foreman", "0.87.2"
126
126
  gem "google-cloud-pubsub", "2.9.0"
127
127
  gem "paint", "2.2.1"
@@ -144,7 +144,7 @@ module SOULs
144
144
  end
145
145
 
146
146
  def download_souls(app_name: "souls", service_name: "api")
147
- version = SOULs.get_latest_version_txt(service_name: service_name).join(".")
147
+ version = SOULs.get_latest_version_txt(service_name:).join(".")
148
148
  file_name = "#{service_name}-v#{version}.tgz"
149
149
  url = "https://storage.googleapis.com/souls-bucket/boilerplates/#{service_name.pluralize}/#{file_name}"
150
150
  system("curl -OL #{url}")
@@ -184,7 +184,7 @@ module SOULs
184
184
  red2 = ["/ ___/", :red]
185
185
  red3 = ["(__ )", :red]
186
186
  red4 = ["/____/", :red]
187
- ms = Paint % [txt2, :cyan, { red1: red1, red2: red2, red3: red3, red4: red4 }]
187
+ ms = Paint % [txt2, :cyan, { red1:, red2:, red3:, red4: }]
188
188
  puts(ms)
189
189
  puts(line)
190
190
  welcome = Paint["Welcome to SOULs!", :white]
@@ -20,7 +20,7 @@ module SOULs
20
20
  choice_num = prompt.select("Select Version: ", choices)[0].to_i
21
21
  update_kinds = %w[patch minor major]
22
22
  update_kind = update_kinds[choice_num - 1]
23
- souls_new_ver = SOULs.version_detector(current_ver: current_souls_ver, update_kind: update_kind)
23
+ souls_new_ver = SOULs.version_detector(current_ver: current_souls_ver, update_kind:)
24
24
  status = Paint["Saving Repo...", :yellow]
25
25
  Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
26
26
  Whirly.status = status
@@ -37,7 +37,7 @@ module SOULs
37
37
  puts("before build")
38
38
  system("rake build")
39
39
  system("rake release")
40
- write_changelog(current_souls_ver: current_souls_ver)
40
+ write_changelog(current_souls_ver:)
41
41
  system("gh release create v#{souls_new_ver} -t v#{souls_new_ver} -F ./CHANGELOG.md")
42
42
  system("gsutil -m -q -o 'GSUtil:parallel_process_count=1' cp -r coverage gs://souls-bucket/souls-coverage")
43
43
  system("bundle exec rake upload:init_files")
@@ -168,7 +168,7 @@ module SOULs
168
168
  end
169
169
  TEXT
170
170
  end
171
- overwrite_gemfile_lock(new_version: new_version)
171
+ overwrite_gemfile_lock(new_version:)
172
172
  true
173
173
  rescue StandardError, e
174
174
  raise(StandardError, e)
@@ -8,7 +8,7 @@ module SOULs
8
8
  def model
9
9
  cp_dir = %w[db app/models spec/factories]
10
10
  cp_dir.each do |dir|
11
- cp_and_dl_files(dir: dir)
11
+ cp_and_dl_files(dir:)
12
12
  cp_env_files
13
13
  end
14
14
  SOULs::Painter.sync(cp_dir.to_s)
@@ -16,7 +16,7 @@ module SOULs
16
16
 
17
17
  worker_file_names = get_workers_file_paths
18
18
 
19
- sync_pubsub_topics_and_subscriptions(worker_file_names: worker_file_names, worker_url: url)
19
+ sync_pubsub_topics_and_subscriptions(worker_file_names:, worker_url: url)
20
20
  SOULs::Painter.sync("All Jobs with PubSub Subscription!")
21
21
  end
22
22
 
@@ -24,7 +24,7 @@ module SOULs
24
24
 
25
25
  def sync_pubsub_topics_and_subscriptions(worker_url:, worker_file_names: {})
26
26
  project_id = SOULs.configuration.project_id
27
- pubsub = Google::Cloud::Pubsub.new(project_id: project_id)
27
+ pubsub = Google::Cloud::Pubsub.new(project_id:)
28
28
  topics = pubsub.topics
29
29
  worker_name = FileUtils.pwd.split("/").last
30
30
 
@@ -45,18 +45,18 @@ module SOULs
45
45
  return if souls_topics.blank?
46
46
 
47
47
  souls_topics.each do |topic_id|
48
- delete_topic(topic_id: topic_id)
49
- delete_subscription(topic_id: topic_id)
48
+ delete_topic(topic_id:)
49
+ delete_subscription(topic_id:)
50
50
  end
51
51
  else
52
52
  worker_file_names.each do |key, value|
53
53
  topic_id = key.to_s.gsub("_", "-")
54
54
  if value == 1
55
- create_topic(topic_id: topic_id)
56
- create_push_subscription(worker_url: worker_url, topic_id: topic_id)
55
+ create_topic(topic_id:)
56
+ create_push_subscription(worker_url:, topic_id:)
57
57
  end
58
- delete_topic(topic_id: topic_id) if value == -1
59
- delete_subscription(topic_id: topic_id) if value == -1
58
+ delete_topic(topic_id:) if value == -1
59
+ delete_subscription(topic_id:) if value == -1
60
60
  end
61
61
  end
62
62
  worker_file_names
@@ -64,14 +64,14 @@ module SOULs
64
64
 
65
65
  def create_topic(topic_id: "worker-mailer")
66
66
  project_id = SOULs.configuration.project_id
67
- pubsub = Google::Cloud::Pubsub.new(project_id: project_id)
67
+ pubsub = Google::Cloud::Pubsub.new(project_id:)
68
68
  topic = pubsub.create_topic(topic_id.to_s)
69
69
  SOULs::Painter.success("Topic #{topic.name} created.")
70
70
  end
71
71
 
72
72
  def delete_topic(topic_id: "worker-mailer")
73
73
  project_id = SOULs.configuration.project_id
74
- pubsub = Google::Cloud::Pubsub.new(project_id: project_id)
74
+ pubsub = Google::Cloud::Pubsub.new(project_id:)
75
75
  topic = pubsub.topic(topic_id.to_s)
76
76
  topic.delete
77
77
  SOULs::Painter.warning("Topic #{topic_id} deleted.", "✨")
@@ -79,7 +79,7 @@ module SOULs
79
79
 
80
80
  def delete_subscription(topic_id: "worker-mailer")
81
81
  project_id = SOULs.configuration.project_id
82
- pubsub = Google::Cloud::Pubsub.new(project_id: project_id)
82
+ pubsub = Google::Cloud::Pubsub.new(project_id:)
83
83
  subscription_id = "#{topic_id}-sub"
84
84
  subscription = pubsub.subscription(subscription_id)
85
85
  subscription.delete
@@ -91,10 +91,10 @@ module SOULs
91
91
  endpoint = "#{worker_url}#{souls_endpoint}"
92
92
 
93
93
  project_id = SOULs.configuration.project_id
94
- pubsub = Google::Cloud::Pubsub.new(project_id: project_id)
94
+ pubsub = Google::Cloud::Pubsub.new(project_id:)
95
95
 
96
96
  topic = pubsub.topic(topic_id)
97
- sub = topic.subscribe(subscription_id, endpoint: endpoint, deadline: 20)
97
+ sub = topic.subscribe(subscription_id, endpoint:, deadline: 20)
98
98
  sub.expires_in = nil
99
99
  SOULs::Painter.success("Push subscription #{subscription_id} created.")
100
100
  end
@@ -14,7 +14,7 @@ module SOULs
14
14
  end
15
15
 
16
16
  mutation_argument = check_mutation_argument(class_name: "user", action: "create")
17
- overwrite_class_file(mutation_argument: mutation_argument, file_path: file_path, new_cols: new_cols)
17
+ overwrite_class_file(mutation_argument:, file_path:, new_cols:)
18
18
  SOULs::Painter.update_file(file_path.to_s)
19
19
  end
20
20
 
@@ -29,8 +29,8 @@ module SOULs
29
29
  return
30
30
  end
31
31
 
32
- mutation_argument = check_mutation_argument(class_name: class_name, action: "update")
33
- overwrite_class_file(mutation_argument: mutation_argument, file_path: file_path, new_cols: new_cols)
32
+ mutation_argument = check_mutation_argument(class_name:, action: "update")
33
+ overwrite_class_file(mutation_argument:, file_path:, new_cols:)
34
34
 
35
35
  SOULs::Painter.update_file(file_path.to_s)
36
36
  end
@@ -7,8 +7,8 @@ module SOULs
7
7
  dir_name = "./app/graphql/resolvers"
8
8
  new_file_path = "tmp/update_resolver.rb"
9
9
  file_path = "#{dir_name}/#{singularized_class_name}_search.rb"
10
- args = check_resolver_argument(class_name: class_name)
11
- scope_args = check_resolver_argument(class_name: class_name, action: "scope")
10
+ args = check_resolver_argument(class_name:)
11
+ scope_args = check_resolver_argument(class_name:, action: "scope")
12
12
  argument = false
13
13
  scope = false
14
14
  File.open(file_path) do |f|
@@ -20,7 +20,7 @@ module SOULs
20
20
 
21
21
  type = SOULs.get_test_type(col[:type])
22
22
  type = "[#{type}]" if col[:array]
23
- args = check_factory_argument(class_name: class_name)
23
+ args = check_factory_argument(class_name:)
24
24
 
25
25
  new_line.write(" #{col[:column_name]} { #{type} }\n") unless args.include?(col[:column_name])
26
26
  end
@@ -32,12 +32,12 @@ module SOULs
32
32
  " #{col[:column_name].camelize(:lower)}" \
33
33
  ": \#{#{class_name}[:#{col[:column_name].underscore}]}\n"
34
34
  end
35
- args = check_rspec_mutation_argument(class_name: class_name)
35
+ args = check_rspec_mutation_argument(class_name:)
36
36
  new_line.write(type_line) unless args.include?(col[:column_name].underscore)
37
37
  end
38
38
  argument = true
39
39
  elsif node_res && !line.include?("{")
40
- node_args = check_rspec_mutation_argument(class_name: class_name, action: "node_args")
40
+ node_args = check_rspec_mutation_argument(class_name:, action: "node_args")
41
41
  new_cols.each do |col|
42
42
  unless node_args.include?(col[:column_name])
43
43
  new_line.write(" #{col[:column_name].camelize(:lower)}\n")
@@ -45,7 +45,7 @@ module SOULs
45
45
  end
46
46
  node_res = false
47
47
  elsif test_res && line.include?("=> be_")
48
- test_args = check_rspec_mutation_argument(class_name: class_name, action: "test_args")
48
+ test_args = check_rspec_mutation_argument(class_name:, action: "test_args")
49
49
  new_cols.each do |col|
50
50
  type = SOULs.type_check(col[:type])
51
51
  text =
@@ -19,7 +19,7 @@ module SOULs
19
19
  test_res = false if test_res && line.strip == ")"
20
20
 
21
21
  if node_res && !line.include?("{")
22
- node_args = check_rspec_resolver_argument(class_name: class_name, action: "node_args")
22
+ node_args = check_rspec_resolver_argument(class_name:, action: "node_args")
23
23
  new_cols.each do |col|
24
24
  unless node_args.include?(col[:column_name])
25
25
  new_line.write(" #{col[:column_name].camelize(:lower)}\n")
@@ -27,7 +27,7 @@ module SOULs
27
27
  end
28
28
  node_res = false
29
29
  elsif test_res && line.include?("=> be_")
30
- test_args = check_rspec_resolver_argument(class_name: class_name, action: "test_args")
30
+ test_args = check_rspec_resolver_argument(class_name:, action: "test_args")
31
31
  new_cols.each do |col|
32
32
  type = SOULs.type_check(col[:type])
33
33
  text =
@@ -17,7 +17,7 @@ module SOULs
17
17
  new_cols.each do |col|
18
18
  type = SOULs.get_type(col[:type])
19
19
  type = "[#{type}]" if col[:array]
20
- args = check_type_argument(class_name: class_name)
20
+ args = check_type_argument(class_name:)
21
21
  unless args.include?(col[:column_name])
22
22
  new_line.write(" field :#{col[:column_name]}, #{type}, null: true\n")
23
23
  end
@@ -110,7 +110,7 @@ module SOULs
110
110
  {
111
111
  gems: updated_gems,
112
112
  lines: updated_lines,
113
- updated_gem_versions: updated_gem_versions
113
+ updated_gem_versions:
114
114
  }
115
115
  end
116
116
  end
@@ -122,9 +122,9 @@ module SOULs
122
122
  Dir.chdir(SOULs.get_api_path.to_s) do
123
123
  cols =
124
124
  if col == "mutation"
125
- get_columns_num_no_timestamp(class_name: class_name)
125
+ get_columns_num_no_timestamp(class_name:)
126
126
  else
127
- get_columns_num(class_name: class_name)
127
+ get_columns_num(class_name:)
128
128
  end
129
129
  relation_params = cols.select { |n| n[:column_name].match?(/_id$/) }
130
130
  user_check =
@@ -132,7 +132,7 @@ module SOULs
132
132
  param[:column_name] == "user_id"
133
133
  end
134
134
  user_exist = user_check.include?(true)
135
- return { user_exist: user_exist, params: cols, relation_params: relation_params }
135
+ return { user_exist:, params: cols, relation_params: }
136
136
  end
137
137
  end
138
138
 
@@ -149,7 +149,7 @@ module SOULs
149
149
 
150
150
  types = SOULs.get_type_and_name(line)
151
151
  array = line.include?("array: true")
152
- cols << { column_name: types[1], type: types[0], array: array }
152
+ cols << { column_name: types[1], type: types[0], array: }
153
153
  end
154
154
  end
155
155
  end
@@ -169,7 +169,7 @@ module SOULs
169
169
 
170
170
  types = SOULs.get_type_and_name(line)
171
171
  array = line.include?("array: true")
172
- cols << { column_name: types[1], type: types[0], array: array } unless %w[
172
+ cols << { column_name: types[1], type: types[0], array: } unless %w[
173
173
  created_at
174
174
  updated_at
175
175
  ].include?(types[1])
@@ -197,7 +197,7 @@ module SOULs
197
197
  types = SOULs.get_type_and_name(line)
198
198
  types.map { |n| n.gsub!(":", "") }
199
199
  array = line.include?("array: true")
200
- response << { column_name: types[1], type: types[0], array: array }
200
+ response << { column_name: types[1], type: types[0], array: }
201
201
  end
202
202
  end
203
203
  end
@@ -208,7 +208,7 @@ module SOULs
208
208
 
209
209
  new_columns =
210
210
  file_paths.map do |file_path|
211
- get_col_name_and_type(class_name: class_name, file_path: file_path, action: action)
211
+ get_col_name_and_type(class_name:, file_path:, action:)
212
212
  end
213
213
  new_columns.flatten
214
214
  end
@@ -230,17 +230,17 @@ module SOULs
230
230
  raise(StandardError, "Wrong class_name!Please Check your migration file!")
231
231
  end
232
232
 
233
- response << { column_name: types[1], type: types[2], array: array }
233
+ response << { column_name: types[1], type: types[2], array: }
234
234
  end
235
235
  end
236
236
  response
237
237
  end
238
238
 
239
239
  def check_schema(class_name: "user")
240
- schema_data = get_columns_num(class_name: class_name)
241
- create_migration_data = get_create_migration_type(class_name: class_name)
242
- add_migration_data = get_migration_type(class_name: class_name, action: "add")
243
- remove_migration_data = get_migration_type(class_name: class_name, action: "remove")
240
+ schema_data = get_columns_num(class_name:)
241
+ create_migration_data = get_create_migration_type(class_name:)
242
+ add_migration_data = get_migration_type(class_name:, action: "add")
243
+ remove_migration_data = get_migration_type(class_name:, action: "remove")
244
244
  migration_data = create_migration_data + add_migration_data - remove_migration_data
245
245
  return "Already Up to date!" if schema_data.size == migration_data.size
246
246
 
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module SOULs
2
- VERSION = "1.20.12".freeze
2
+ VERSION = "1.20.13".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.20.12
1
+ 1.20.13
@@ -1 +1 @@
1
- 1.20.12
1
+ 1.20.13
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.20.12
4
+ version: 1.20.13
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: 2022-01-10 00:00:00.000000000 Z
13
+ date: 2022-01-17 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -18,14 +18,14 @@ dependencies:
18
18
  requirements:
19
19
  - - ">="
20
20
  - !ruby/object:Gem::Version
21
- version: 7.0.0
21
+ version: 7.0.1
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- version: 7.0.0
28
+ version: 7.0.1
29
29
  - !ruby/object:Gem::Dependency
30
30
  name: foreman
31
31
  requirement: !ruby/object:Gem::Requirement
@@ -307,14 +307,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
307
307
  requirements:
308
308
  - - ">="
309
309
  - !ruby/object:Gem::Version
310
- version: 3.0.0
310
+ version: 3.1.0
311
311
  required_rubygems_version: !ruby/object:Gem::Requirement
312
312
  requirements:
313
313
  - - ">="
314
314
  - !ruby/object:Gem::Version
315
315
  version: '0'
316
316
  requirements: []
317
- rubygems_version: 3.2.32
317
+ rubygems_version: 3.3.3
318
318
  signing_key:
319
319
  specification_version: 4
320
320
  summary: Ruby Serverless Framework 'SOULs' | Ruby サーバーレスフレームワーク SOULs. Powered by