souls 0.68.2 → 0.68.6

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: 420bd82f0189ae76a1ff615426954b652d4459d913ba302d96e4be139df4cac0
4
- data.tar.gz: 94d6355a219f279444b7de60585b9e95cfae580dcc378d9091f91248c75b2b5f
3
+ metadata.gz: 2c82689bc6d741389543a8c4f1a30938f0e517dc784d66e7acc19a7d787c5e2e
4
+ data.tar.gz: 96ce10b2a5f6ef62806e9a1933a91bb85d33cf545232be946bce48bb670babb7
5
5
  SHA512:
6
- metadata.gz: 516c7692c53c20a8a11d2aa1acc3524482b72a54022073cedb1ccc15e4a052be488fd0a6e42ebf60edc6b4002438067f193fdcc57579e11c8d418fdd9e46dc28
7
- data.tar.gz: e9db926ca043aa388f5202a426e412a0c0cbf6d573f0eb9344a04f356cf47540fe21a577a572108eb417eae59f486e4ee9a808a76b672c07f6f06bb52741e2b6
6
+ metadata.gz: 39bf1ef6c6e444c7346c5f79494647aa166478019904133ede408aebb2fdb87cf23956c2f78c2ffca6a2d257e4b56eae6abea73ef0c680e891c183e87f628590
7
+ data.tar.gz: 16422f4a70febe17b558c89e6acaa366205c5e32a981f9170a099f3bd55f8a24151676bd2791f7a1a17f632678f67831fb4cd866373eba62fa2969d935d749b8
data/README.md CHANGED
@@ -17,10 +17,18 @@
17
17
  </a>
18
18
  </p>
19
19
 
20
+ ## SOULs Serverless Application Framework Document
21
+
22
+ - [Go to SOULs Document](https://souls.elsoul.nl/)
23
+
24
+
20
25
  ## What's SOULs?
21
26
 
22
27
  Welcome to SOULs Serverless Application Framework!
23
28
 
29
+ Build Serverless Apps faster like Rails.
30
+ Powered by Ruby GraphQL, RBS/Steep, Active Record, RSpec, RuboCop, and Google Cloud.
31
+
24
32
  - Focus on business logic in serverless environment
25
33
  - Maximize development efficiency with CI / CD standard schema-driven Scaffold
26
34
  - Achieve global scale with lower management costs
@@ -81,9 +89,6 @@ Check your GraphQL PlayGround
81
89
  [localhost:4000/playground](localhost:4000/playground)
82
90
 
83
91
 
84
- ## SOULs Serverless Application Framework Document
85
-
86
- - [SOULs Document](https://souls.elsoul.nl/)
87
92
 
88
93
  ## Development
89
94
 
@@ -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.2".freeze
2
+ VERSION = "0.68.6".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.47.2
1
+ 0.47.6
@@ -1 +1 @@
1
- 0.47.2
1
+ 0.47.6
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.68.2
4
+ version: 0.68.6
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
- date: 2021-10-03 00:00:00.000000000 Z
13
+ date: 2021-10-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -110,14 +110,8 @@ dependencies:
110
110
  - - ">="
111
111
  - !ruby/object:Gem::Version
112
112
  version: 1.1.0
113
- description: |-
114
- Welcome to SOULs Serverless Application Framework!
115
-
116
- - Focus on business logic in serverless environment
117
-
118
- - Maximize development efficiency with CI / CD standard schema-driven Scaffold
119
-
120
- - Achieve global scale with lower management costs
113
+ description: "Build Serverless Apps faster like Rails.\n Powered by Ruby GraphQL,
114
+ RBS/Steep, Active Record, RSpec, RuboCop, and Google Cloud. "
121
115
  email:
122
116
  - f.kawasaki@elsoul.nl
123
117
  - s.kishi@elsoul.nl
@@ -187,7 +181,9 @@ files:
187
181
  - lib/souls/cli/sync/pubsub.rb
188
182
  - lib/souls/cli/update/index.rb
189
183
  - lib/souls/cli/update/mutation.rb
184
+ - lib/souls/cli/update/mutation_rbs.rb
190
185
  - lib/souls/cli/update/resolver.rb
186
+ - lib/souls/cli/update/resolver_rbs.rb
191
187
  - lib/souls/cli/update/rspec_factory.rb
192
188
  - lib/souls/cli/update/rspec_mutation.rb
193
189
  - lib/souls/cli/update/rspec_resolver.rb
@@ -207,7 +203,7 @@ metadata:
207
203
  homepage_uri: https://souls.elsoul.nl
208
204
  source_code_uri: https://github.com/elsoul/souls
209
205
  changelog_uri: https://github.com/elsoul/souls
210
- post_install_message:
206
+ post_install_message:
211
207
  rdoc_options: []
212
208
  require_paths:
213
209
  - lib
@@ -223,9 +219,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
219
  version: '0'
224
220
  requirements: []
225
221
  rubygems_version: 3.2.22
226
- signing_key:
222
+ signing_key:
227
223
  specification_version: 4
228
- summary: Welcome to SOULs Serverless Application Framework! - Focus on business logic
229
- in serverless environment - Maximize development efficiency with CI / CD standard
230
- schema-driven Scaffold - Achieve global scale with lower management costs
224
+ summary: Build Serverless Apps faster like Rails. Powered by Ruby GraphQL, RBS/Steep,
225
+ Active Record, RSpec, RuboCop, and Google Cloud.
231
226
  test_files: []