souls 0.68.3 → 0.68.4

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: af7698852f0121588c60883aee4a3c80b6b573ca0c08e8f33487f476de63b7f9
4
- data.tar.gz: 14ae91be145a5cd8d38453f4995c04e85860b0fbdf0fffbe109701d1e79ec069
3
+ metadata.gz: 342cb15821455bcfbb8426bd006ffc643d7f956cd4af1fc7c4642d685c3b7f51
4
+ data.tar.gz: 5be5a14ffca3368d5ecd0e996571f9151a16f4dbfa8c3bfbbac7e47d41699b97
5
5
  SHA512:
6
- metadata.gz: 7a9e9593df5f2aa7110e439f14ff67bc69c0754a701e0481c722430e3cc73203c2f3aef3a1ec248947379c17f33bc351ab070eb1e8a767951e88c50bd0786bc4
7
- data.tar.gz: da8018823d2efcc24764844befa4ad9b901504adc7a8ffa23ded174cc6bb9bc5c3fbfe7b6fe1eb18303c13dcbca67aa25501633c4da657050136683a1da600b6
6
+ metadata.gz: f18414efec39e469c91d6fa6a8c372a401b6c314bb998edd77a3a4fa27ca681f4d8e955b62d87716ce9031b9ee53c0eea3d479f031b8030284a7c9f04b5f1792
7
+ data.tar.gz: 429f1b3a171ec7e71a1664bb4c9db8559486cf517433e513ecda05bf1fd1d50068eb4b71ce8035213aac64fbef7269b67dc53849c57cd468a86fae5d6d98b0e3
@@ -0,0 +1,86 @@
1
+ module Souls
2
+ class Update < Thor
3
+ desc "create_mutation_rbs [CLASS_NAME]", "Update GraphQL Type from schema.rb"
4
+ def create_mutation_rbs(class_name)
5
+ singularized_class_name = class_name.singularize.underscore
6
+ new_cols = Souls.get_columns_num(class_name: singularized_class_name)
7
+ dir_name = "./sig/api/app/graphql/mutations/base/#{singularized_class_name}"
8
+ new_file_path = "tmp/create_mutation.rbs"
9
+ file_path = "#{dir_name}/create_#{singularized_class_name}.rbs"
10
+ argument = false
11
+ File.open(file_path) do |f|
12
+ File.open(new_file_path, "w") do |new_line|
13
+ f.each_line do |line|
14
+ new_line.write(line)
15
+ next unless line.include?("argument") && !argument
16
+
17
+ new_cols.each do |col|
18
+ type = Souls.type_check(col[:type])
19
+ type = "[#{type}]" if col[:array]
20
+ args = check_mutation_argument(class_name: class_name)
21
+ next if args.include?(col[:column_name])
22
+ next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
23
+
24
+ new_line.write(" argument :#{col[:column_name]}, #{type}, required: false\n")
25
+ end
26
+ argument = true
27
+ end
28
+ end
29
+ end
30
+ FileUtils.rm(file_path)
31
+ FileUtils.mv(new_file_path, file_path)
32
+ puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
33
+ rescue Thor::Error => e
34
+ raise(Thor::Error, e)
35
+ end
36
+
37
+ desc "update_mutation [CLASS_NAME]", "Update GraphQL Type from schema.rb"
38
+ def update_mutation(class_name)
39
+ singularized_class_name = class_name.singularize.underscore
40
+ new_cols = Souls.get_columns_num(class_name: singularized_class_name)
41
+ dir_name = "./app/graphql/mutations/base/#{singularized_class_name}"
42
+ new_file_path = "tmp/update_mutation.rb"
43
+ file_path = "#{dir_name}/update_#{singularized_class_name}.rb"
44
+ argument = false
45
+ File.open(file_path) do |f|
46
+ File.open(new_file_path, "w") do |new_line|
47
+ f.each_line do |line|
48
+ new_line.write(line)
49
+ next unless line.include?("argument") && !argument
50
+
51
+ new_cols.each do |col|
52
+ type = Souls.type_check(col[:type])
53
+ type = "[#{type}]" if col[:array]
54
+ args = check_mutation_argument(class_name: class_name, action: "update")
55
+ next if args.include?(col[:column_name])
56
+ next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
57
+
58
+ new_line.write(" argument :#{col[:column_name]}, #{type}, required: false\n")
59
+ end
60
+ argument = true
61
+ end
62
+ end
63
+ end
64
+ FileUtils.rm(file_path)
65
+ FileUtils.mv(new_file_path, file_path)
66
+ puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
67
+ rescue Thor::Error => e
68
+ raise(Thor::Error, e)
69
+ end
70
+
71
+ private
72
+
73
+ def check_mutation_argument(class_name: "user", action: "create")
74
+ singularized_class_name = class_name.singularize.underscore
75
+ dir_name = "./app/graphql/mutations/base/#{singularized_class_name}"
76
+ file_path = "#{dir_name}/#{action}_#{singularized_class_name}.rb"
77
+ args = []
78
+ File.open(file_path) do |f|
79
+ f.each_line do |line|
80
+ args << line.split(",")[0].gsub("argument :", "").strip.underscore if line.include?("argument")
81
+ end
82
+ end
83
+ args
84
+ end
85
+ end
86
+ end
File without changes
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.68.3".freeze
2
+ VERSION = "0.68.4".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.47.3
1
+ 0.47.4
@@ -1 +1 @@
1
- 0.47.3
1
+ 0.47.4
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.68.3
4
+ version: 0.68.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
8
8
  - KishiTheMechanic
9
9
  - James Neve
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
13
  date: 2021-10-05 00:00:00.000000000 Z
@@ -112,7 +112,7 @@ dependencies:
112
112
  version: 1.1.0
113
113
  description: |-
114
114
  Welcome to SOULs Serverless Application Framework!
115
- - Ruby GraphQL with RBS/Steep - Focus on business logic in serverless environment
115
+ - Ruby GraphQL with RBS/Steep - Run like Rails! - Focus on business logic in serverless environment
116
116
 
117
117
  - Maximize development efficiency with CI / CD standard schema-driven Scaffold
118
118
 
@@ -186,7 +186,9 @@ files:
186
186
  - lib/souls/cli/sync/pubsub.rb
187
187
  - lib/souls/cli/update/index.rb
188
188
  - lib/souls/cli/update/mutation.rb
189
+ - lib/souls/cli/update/mutation_rbs.rb
189
190
  - lib/souls/cli/update/resolver.rb
191
+ - lib/souls/cli/update/resolver_rbs.rb
190
192
  - lib/souls/cli/update/rspec_factory.rb
191
193
  - lib/souls/cli/update/rspec_mutation.rb
192
194
  - lib/souls/cli/update/rspec_resolver.rb
@@ -206,7 +208,7 @@ metadata:
206
208
  homepage_uri: https://souls.elsoul.nl
207
209
  source_code_uri: https://github.com/elsoul/souls
208
210
  changelog_uri: https://github.com/elsoul/souls
209
- post_install_message:
211
+ post_install_message:
210
212
  rdoc_options: []
211
213
  require_paths:
212
214
  - lib
@@ -222,10 +224,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
224
  version: '0'
223
225
  requirements: []
224
226
  rubygems_version: 3.2.22
225
- signing_key:
227
+ signing_key:
226
228
  specification_version: 4
227
- summary: Welcome to SOULs Serverless Application Framework! - Ruby GraphQL with RBS/Steep -
228
- Focus on business logic in serverless environment - Maximize development efficiency
229
- with CI / CD standard schema-driven Scaffold - Achieve global scale with lower
230
- management costs - Rails like Scaffold
229
+ summary: Welcome to SOULs Serverless Application Framework! - Ruby GraphQL with RBS/Steep
230
+ - Run like Rails! - Focus on business logic in serverless environment - Maximize
231
+ development efficiency with CI / CD standard schema-driven Scaffold - Achieve global
232
+ scale with lower management costs - Rails like Scaffold
231
233
  test_files: []