souls 0.68.3 → 0.68.7

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: 2a000c6c2a80104c810c414e9543c093c9fd94657ccf00568849f334305c73f4
4
+ data.tar.gz: 0dffafcbc0438b7c6a5cb79e631ca1627a83741f903f37dbac3c27c7d67df58a
5
5
  SHA512:
6
- metadata.gz: 7a9e9593df5f2aa7110e439f14ff67bc69c0754a701e0481c722430e3cc73203c2f3aef3a1ec248947379c17f33bc351ab070eb1e8a767951e88c50bd0786bc4
7
- data.tar.gz: da8018823d2efcc24764844befa4ad9b901504adc7a8ffa23ded174cc6bb9bc5c3fbfe7b6fe1eb18303c13dcbca67aa25501633c4da657050136683a1da600b6
6
+ metadata.gz: da117aac1d8a630f0b47710e7f3ce0e9b7e528db9752c9222182e859e2c6eb022cff3162184820b6752cebf5ec5cae8217a1ff5ec9e423b4a86b197c45982193
7
+ data.tar.gz: 1ae9ab5899be91161b79a6dda11ac0f085aa98b8f9318ffbf9b43f0c6ea020d132379f835d2403d57e6d9cc309ef103441e7b4b4a3a270d429ec4db952c7180f
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
@@ -28,7 +36,7 @@ Welcome to SOULs Serverless Application Framework!
28
36
  ![画像](https://souls.elsoul.nl/imgs/docs/SOULs-architecture.jpg)
29
37
 
30
38
 
31
- SOULs creates 2 types of framework.
39
+ SOULs creates 2 types of APP.
32
40
 
33
41
  1. API - GraphQL (Ruby) - Simple API - Cloud Run
34
42
  2. Worker - Google Pub/Sub Messaging Worker API (Ruby) - Cloud Run
@@ -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.3".freeze
2
+ VERSION = "0.68.7".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.47.3
1
+ 0.47.7
@@ -1 +1 @@
1
- 0.47.3
1
+ 0.47.7
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.68.3
4
+ version: 0.68.7
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-10-05 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,13 +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
- - Ruby GraphQL with RBS/Steep - Focus on business logic in serverless environment
116
-
117
- - Maximize development efficiency with CI / CD standard schema-driven Scaffold
118
-
119
- - Achieve global scale with lower management costs - Rails like Scaffold
113
+ description: "Build Serverless Apps faster like Rails.\n Powered by Ruby GraphQL,
114
+ RBS/Steep, Active Record, RSpec, RuboCop, and Google Cloud. "
120
115
  email:
121
116
  - f.kawasaki@elsoul.nl
122
117
  - s.kishi@elsoul.nl
@@ -186,7 +181,9 @@ files:
186
181
  - lib/souls/cli/sync/pubsub.rb
187
182
  - lib/souls/cli/update/index.rb
188
183
  - lib/souls/cli/update/mutation.rb
184
+ - lib/souls/cli/update/mutation_rbs.rb
189
185
  - lib/souls/cli/update/resolver.rb
186
+ - lib/souls/cli/update/resolver_rbs.rb
190
187
  - lib/souls/cli/update/rspec_factory.rb
191
188
  - lib/souls/cli/update/rspec_mutation.rb
192
189
  - lib/souls/cli/update/rspec_resolver.rb
@@ -224,8 +221,6 @@ requirements: []
224
221
  rubygems_version: 3.2.22
225
222
  signing_key:
226
223
  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
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: []