souls 0.30.8 → 0.31.0

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: 5c23991005498338d7ed2aec05baef37f0b1504adc9ef017b42dbe53adbace43
4
- data.tar.gz: 84aa755bbfad14d78d57c46be3d15a197e8b3dc700d182e9d3583a3caf32f77c
3
+ metadata.gz: 378a3ef40cd5cbc43e093f65d122236ea79c69a26fb823a7666296f87b36221e
4
+ data.tar.gz: 4396ee4d17f3c1dfeeaf68ba394cfa8252da1269cb8423438242387f4399dd93
5
5
  SHA512:
6
- metadata.gz: 3d6f92cf53bfd1fd67bb1e4074ef443d94ffbe32ac44128777dd7a9516cb51e9fd824f5a85fb1bfc14d80f6de33f4fe315cb6b30c7c62ed522e2abf494ea6fef
7
- data.tar.gz: 2b9024aca07b686ed2e647f9de79da7083a088340add99b45364f4ef3c4e2588f1789b710b96217c2de8d036d1c62148ec161b95164652c1c596ae5682eaeb7f
6
+ metadata.gz: 2686058accaf16fd46e5e54acd294f33296340812417af70c8c2a5730f05082e1bfa6837b60521b4f322b8352f7121094585007b360006ec997a5189958c3046
7
+ data.tar.gz: e9730f1a4824de288bdb98385cfbb43e05ecd0353a9a49fd6079f5130bb958a238960ee73518e2dc0eaf424e9457ea111e945fa80567314fc93292fc20f8cfda
data/README.md CHANGED
@@ -21,12 +21,18 @@
21
21
 
22
22
  Welcome to SOULs Serverless Application Framework!
23
23
 
24
- SOULs is a Serverless Application Framework with Ruby GraphQL.
25
- SOULs has 3 strains, API, Worker, and Frontend. It can be used in combination according to the purpose. SOULs Backend GraphQL Ruby & Frontend Relay are Scalable and Easy to deploy to Google Cloud. No more routing for Backends!
26
- You can focus on your business logic.
24
+ SOULs はサーバーレスフルスタックフレームワークです。柔軟な Ruby GraphQL API Worker はルーティングの必要がありません。
25
+ クラウド環境への自動デプロイ、CI/CD ワークフローを標準装備。開発者がビジネスロジックに集中し、楽しくコードが書けるような環境を目指しています。
26
+
27
+ SOULs バックエンドには `API` と `Worker` の 2 つのタイプがあります。
28
+ `API` は主にデータをフロントエンドへ提供します。`Worker` は主に `タスク` の処理を行います
27
29
 
28
30
  ![画像](https://storage.googleapis.com/souls-bucket/imgs/souls-structure.jpg)
29
31
 
32
+ 現在のバージョンでは SOULs `API` と `Worker` を Github Actions を使って Google Cloud Run へそれぞれデプロイします。
33
+
34
+ SOULs フレームワークでは [Monorepo](https://en.wikipedia.org/wiki/Monorepo) によって一つのパッケージでアプリケーションを管理します。
35
+
30
36
  SOULs creates 3 types of framework.
31
37
 
32
38
  1. API - GraphQL (Ruby) - Simple API - Cloud Run
@@ -72,13 +78,11 @@ Or install it yourself as:
72
78
  And Create Your APP
73
79
 
74
80
  $ souls new app_name
81
+ $ cd apps/api/app_name
82
+ $ bundle
83
+ $ souls s
75
84
 
76
- ## Choose SOULs Type:
77
85
 
78
- Select Strain:
79
- 1. SOULs GraphQL API
80
- 2. SOULs Worker
81
- 3. SOULs Frontend Web
82
86
 
83
87
 
84
88
  ## Gemfile 自動更新アップデート
@@ -99,7 +103,7 @@ Souls.configure do |config|
99
103
  config.app = "souls-api"
100
104
  config.project_id = "souls-api"
101
105
  config.strain = "api"
102
- config.worker_endpoint = "https://worker.com"
106
+ config.github_repo = "elsoul/souls"
103
107
  config.fixed_gems = ["selenium-webdriver", "pg"]
104
108
  end
105
109
  ```
data/exe/souls CHANGED
@@ -20,7 +20,7 @@ begin
20
20
  Souls::Api::Generate.public_send(method_name, class_name: class_name)
21
21
  Whirly.status = "Done!"
22
22
  end
23
- when "schema:update"
23
+ when "update"
24
24
  class_name = ARGV[2]
25
25
  status = Paint["Running SOULs Update Commands...", :yellow]
26
26
  Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
@@ -34,6 +34,9 @@ begin
34
34
  Souls::Api::Update.rspec_resolver(class_name: class_name)
35
35
  Whirly.status = "Done!"
36
36
  end
37
+ when "d", "delete"
38
+ class_name = ARGV[2]
39
+ Souls::Api::Generate.delete_all(class_name: class_name)
37
40
  else
38
41
  puts(Paint["Comannd doesn't exist.Check you command again!...", :red])
39
42
  end
@@ -73,7 +76,7 @@ begin
73
76
  system("bundle exec irb")
74
77
  end
75
78
  end
76
- when "i", "infra", "docker"
79
+ when "docker"
77
80
  send_method = ARGV[1]
78
81
  Souls::Docker.public_send(send_method)
79
82
  when "gcloud"
@@ -86,49 +89,42 @@ begin
86
89
  end
87
90
  when "-v", "--version", "v", "version", "-version", "--v"
88
91
  puts(Paint[Souls::VERSION, :white])
89
- when "gem:update", "gemfile:update"
90
- status = Paint["Checking for updates...", :yellow]
91
- Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
92
- Whirly.status = status
93
- Souls.update_gemfile
94
- Whirly.status = "Done!"
92
+ when "upgrade"
93
+ method_command = ARGV[1]
94
+ case method_command
95
+ when "gemfile", "gem"
96
+ status = Paint["Checking for updates...", :yellow]
97
+ Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
98
+ Whirly.status = status
99
+ Souls.update_gemfile
100
+ Whirly.status = "Done!"
101
+ end
102
+ else
103
+ puts(Paint["Comannd doesn't exist.Check you command again!...", :red])
95
104
  end
96
105
  when "release"
97
106
  Souls::Release.gem_release
98
- when "model:update"
99
- status = Paint["Syncing Models...", :yellow]
100
- Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
101
- Whirly.status = status
102
- Souls.update_models
103
- Whirly.status = "API and Worker Both Models Synced!"
104
- end
105
- when "add"
106
- graphql_class = ARGV[1]
107
- case graphql_class
108
- when "mutation"
109
- Souls::Init.add_mutation(class_name: "user", file_name: "hoi")
110
- when "type"
111
- Souls::Init.add_type(class_name: "user", file_name: "hoi")
112
- when "connection"
113
- Souls::Init.add_connection(class_name: "user", file_name: "hoi")
114
- when "edge"
115
- Souls::Init.add_edge(class_name: "user", file_name: "hoi")
116
- when "rspec_mutation"
117
- Souls::Init.add_rspec_mutation(class_name: "user", file_name: "hoi")
107
+ when "sync"
108
+ target = ARGV[1]
109
+ case target
110
+ when "model", "m"
111
+ status = Paint["Syncing Models...", :yellow]
112
+ Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
113
+ Whirly.status = status
114
+ Souls::Sync.model
115
+ Whirly.status = "API and Worker Both Models Synced!"
116
+ end
118
117
  else
119
- puts(Paint["Wrong Argument!", :red])
118
+ puts(Paint["Comannd doesn't exist.Check you command again!...", :red])
120
119
  end
121
- when "g", "generate"
122
- g_command = ARGV[1]
123
- case g_command
120
+ when "create"
121
+ service_name = ARGV[1]
122
+ case service_name
124
123
  when "worker"
125
124
  Souls::Init.download_worker
126
125
  else
127
126
  puts(Paint["Coming Soon...", :green])
128
127
  end
129
- when "d", "delete"
130
- class_name = ARGV[1]
131
- Souls::Api::Generate.delete_all(class_name: class_name)
132
128
  when "db:create"
133
129
  rack_env = ARGV[1]
134
130
  case rack_env
@@ -164,9 +160,6 @@ begin
164
160
  when "t", "test"
165
161
  system("rubocop -A")
166
162
  system("bundle exec rspec")
167
- when "run"
168
- system("docker build . -t souls -f Dockerfile.dev")
169
- system("docker run --rm --env-file .env -p 3000:3000 souls:latest")
170
163
  when "deploy"
171
164
  project_id = Souls.configuration.project_id
172
165
  system("gcloud builds submit --config=cloudbuild.yml --project #{project_id}")
data/lib/souls.rb CHANGED
@@ -3,11 +3,8 @@ require "active_support/core_ext/string/inflections"
3
3
  require_relative "souls/init"
4
4
  require_relative "souls/api"
5
5
  require_relative "souls/worker"
6
- require_relative "souls/gcloud"
7
- require_relative "souls/release"
8
- require_relative "souls/docker"
6
+ require_relative "souls/cli"
9
7
  require "date"
10
- require "dotenv/load"
11
8
  require "json"
12
9
  require "fileutils"
13
10
  require "net/http"
@@ -252,68 +249,6 @@ module Souls
252
249
  puts(Paint["\nSuccessfully Updated #{service_name} Gemfile!", :green])
253
250
  end
254
251
 
255
- def update_models
256
- current_dir_name = FileUtils.pwd.to_s.match(%r{/([^/]+)/?$})[1]
257
- permitted_dirs = %w[worker api]
258
- unless permitted_dirs.include?(current_dir_name)
259
- raise(StandardError, "You are at wrong directory!Go to API or Worker Directory!")
260
- end
261
-
262
- cp_dir = get_models_path(service_name: current_dir_name)
263
- cp_dir.each do |path|
264
- cp_and_dl_files(api_dir: path[:api], worker_dir: path[:worker])
265
- end
266
- end
267
-
268
- def cp_and_dl_files(api_dir: "", worker_dir: "")
269
- if Dir["#{worker_dir}/*.rb"].blank?
270
-
271
- api_latest_date = 1
272
- worker_latest_date = 0
273
- else
274
- api_file_data = file_diff(Dir["#{api_dir}/*.rb"])
275
- worker_file_data = file_diff(Dir["#{worker_dir}/*.rb"])
276
-
277
- api_latest_date = Date.parse(api_file_data.max)
278
- worker_latest_date = Date.parse(worker_file_data.max)
279
- end
280
-
281
- if api_latest_date < worker_latest_date
282
- FileUtils.rm_rf(api_dir) if Dir.exist?(api_dir)
283
- FileUtils.mkdir(api_dir) unless Dir.exist?(api_dir)
284
- system("cp -r #{worker_dir}/* #{api_dir}")
285
- else
286
- FileUtils.rm_rf(worker_dir) if Dir.exist?(worker_dir)
287
- FileUtils.mkdir(worker_dir) unless Dir.exist?(worker_dir)
288
- system("cp -r #{api_dir}/* #{worker_dir}")
289
- end
290
- end
291
-
292
- def get_models_path(service_name: "api")
293
- case service_name
294
- when "api"
295
- api_path = "."
296
- worker_path = "../worker"
297
- when "worker"
298
- api_path = "../api"
299
- worker_path = "."
300
- end
301
- [
302
- {
303
- api: "#{api_path}/db",
304
- worker: "#{worker_path}/db"
305
- },
306
- {
307
- api: "#{api_path}/app/models",
308
- worker: "#{worker_path}/app/models"
309
- },
310
- {
311
- api: "#{api_path}/spec/factories",
312
- worker: "#{worker_path}/spec/factories"
313
- }
314
- ]
315
- end
316
-
317
252
  def file_diff(paths = [])
318
253
  paths.map do |path|
319
254
  stat(path)[:last_update]
@@ -109,7 +109,7 @@ module Souls
109
109
  false
110
110
  end
111
111
 
112
- def self.migrate(class_name: "souls")
112
+ def self.scaffold(class_name: "souls")
113
113
  singularized_class_name = class_name.singularize
114
114
  model(class_name: singularized_class_name)
115
115
  type(class_name: singularized_class_name)
@@ -130,10 +130,10 @@ module Souls
130
130
  raise(StandardError, e)
131
131
  end
132
132
 
133
- def self.migrate_all
133
+ def self.scaffold_all
134
134
  puts(Paint["Let's Go SOULs AUTO CRUD Assist!\n", :cyan])
135
135
  Souls::Api::Generate.get_tables.each do |table|
136
- Souls::Api::Generate.migrate(class_name: table.singularize)
136
+ Souls::Api::Generate.scaffold(class_name: table.singularize)
137
137
  puts(Paint["Generated #{table.camelize} CRUD Files\n", :yellow])
138
138
  end
139
139
  end
@@ -160,23 +160,5 @@ module Souls
160
160
  rescue StandardError => e
161
161
  raise(StandardError, e)
162
162
  end
163
-
164
- def self.update_delete(class_name: "souls")
165
- singularized_class_name = class_name.singularize.underscore
166
- pluralized_class_name = class_name.pluralize.underscore
167
- FileUtils.rm_rf("./app/graphql/mutations/#{singularized_class_name}")
168
- FileUtils.rm("./app/graphql/queries/#{singularized_class_name}.rb")
169
- FileUtils.rm("./app/graphql/queries/#{pluralized_class_name}.rb")
170
- FileUtils.rm("./app/graphql/resolvers/#{singularized_class_name}_search.rb")
171
- FileUtils.rm("./app/graphql/types/#{singularized_class_name}_type.rb")
172
- FileUtils.rm("./app/graphql/types/edges/#{singularized_class_name}_edge.rb")
173
- FileUtils.rm("./app/graphql/types/connections/#{singularized_class_name}_connection.rb")
174
- FileUtils.rm("./spec/mutations/#{singularized_class_name}_spec.rb")
175
- FileUtils.rm("./spec/queries/#{singularized_class_name}_spec.rb")
176
- FileUtils.rm("./spec/resolvers/#{singularized_class_name}_search_spec.rb")
177
- puts("deleted #{class_name.camelize} CRUD!")
178
- rescue StandardError => e
179
- raise(StandardError, e)
180
- end
181
163
  end
182
164
  end
@@ -230,9 +230,17 @@ module Souls
230
230
  new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_a(String),\n")
231
231
  end
232
232
  when "boolean"
233
- new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_in([true, false]),\n")
233
+ if array_true
234
+ new_line.write(" \"#{name.pluralize.camelize(:lower)}\" => be_all([true, false]),\n")
235
+ else
236
+ new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_in([true, false]),\n")
237
+ end
234
238
  when "string", "bigint", "integer", "float"
235
- new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_a(#{field}),\n")
239
+ if array_true
240
+ new_line.write(" \"#{name.pluralize.camelize(:lower)}\" => be_all(#{field}),\n")
241
+ else
242
+ new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_a(#{field}),\n")
243
+ end
236
244
  end
237
245
  end
238
246
  end
@@ -157,9 +157,17 @@ module Souls
157
157
  new_line.write(" \"#{name.camelize(:lower)}\" => be_a(String),\n")
158
158
  end
159
159
  when "boolean"
160
- new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_in([true, false]),\n")
160
+ if array_true
161
+ new_line.write(" \"#{name.camelize(:lower)}\" => be_all([true, false]),\n")
162
+ else
163
+ new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_in([true, false]),\n")
164
+ end
161
165
  when "string", "bigint", "integer", "float"
162
- new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_a(#{field}),\n")
166
+ if array_true
167
+ new_line.write(" \"#{name.camelize(:lower)}\" => be_all(#{field}),\n")
168
+ else
169
+ new_line.write(" \"#{name.singularize.camelize(:lower)}\" => be_a(#{field}),\n")
170
+ end
163
171
  end
164
172
  end
165
173
  end
@@ -44,6 +44,8 @@ module Souls
44
44
  FileUtils.rm(file_path)
45
45
  FileUtils.mv(new_file_path, file_path)
46
46
  puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
47
+ rescue StandardError => e
48
+ p(e)
47
49
  end
48
50
 
49
51
  def check_resolver_argument(class_name: "user", action: "argument")
@@ -49,8 +49,6 @@ module Souls
49
49
  type = Souls::Api::Generate.type_check(col[:type])
50
50
  text =
51
51
  case type
52
- when "String"
53
- col[:array] ? "be_all(String)" : "be_a(String)"
54
52
  when "Integer", "Float"
55
53
  col[:array] ? "be_all(Integer)" : "be_a(Integer)"
56
54
  when "Boolean"
@@ -59,7 +57,7 @@ module Souls
59
57
  col[:array] ? "be_all(String)" : "be_a(String)"
60
58
  end
61
59
  unless test_args.include?(col[:column_name])
62
- new_line.write(" \"#{col[:column_name].camelize(:lower)}\" => #{text},\n")
60
+ new_line.write(" \"#{col[:column_name].camelize(:lower)}\" => #{text},\n")
63
61
  end
64
62
  end
65
63
  test_res = false
@@ -33,8 +33,6 @@ module Souls
33
33
  type = Souls::Api::Generate.type_check(col[:type])
34
34
  text =
35
35
  case type
36
- when "String"
37
- col[:array] ? "be_all(String)" : "be_a(String)"
38
36
  when "Integer", "Float"
39
37
  col[:array] ? "be_all(Integer)" : "be_a(Integer)"
40
38
  when "Boolean"
data/lib/souls/cli.rb ADDED
@@ -0,0 +1,7 @@
1
+ require_relative "./cli/docker"
2
+ require_relative "./cli/gcloud"
3
+ require_relative "./cli/release"
4
+ require_relative "./cli/sync"
5
+
6
+ module Souls
7
+ end
File without changes
@@ -26,6 +26,18 @@ module Souls
26
26
  )
27
27
  system("docker ps")
28
28
  end
29
+
30
+ def run
31
+ current_dir_name = FileUtils.pwd.to_s.match(%r{/([^/]+)/?$})[1]
32
+ port =
33
+ if current_dir_name == "api"
34
+ "4000:4000"
35
+ else
36
+ "3000:3000"
37
+ end
38
+ system("docker build . -t souls-app -f Dockerfile.dev")
39
+ system("docker run --name souls-app --rm --env-file .env -p #{port} souls-app:latest")
40
+ end
29
41
  end
30
42
  end
31
43
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,6 @@
1
+ require_relative "./sync/model"
2
+
3
+ module Souls
4
+ module Sync
5
+ end
6
+ end
@@ -0,0 +1,69 @@
1
+ module Souls
2
+ module Sync
3
+ class << self
4
+ def model
5
+ current_dir_name = FileUtils.pwd.to_s.match(%r{/([^/]+)/?$})[1]
6
+ permitted_dirs = %w[worker api]
7
+ unless permitted_dirs.include?(current_dir_name)
8
+ raise(StandardError, "You are at wrong directory!Go to API or Worker Directory!")
9
+ end
10
+
11
+ cp_dir = get_models_path(service_name: current_dir_name)
12
+ cp_dir.each do |path|
13
+ cp_and_dl_files(api_dir: path[:api], worker_dir: path[:worker])
14
+ end
15
+ end
16
+
17
+ private
18
+
19
+ def cp_and_dl_files(api_dir: "", worker_dir: "")
20
+ if Dir["#{worker_dir}/*.rb"].blank?
21
+
22
+ api_latest_date = 1
23
+ worker_latest_date = 0
24
+ else
25
+ api_file_data = file_diff(Dir["#{api_dir}/*.rb"])
26
+ worker_file_data = file_diff(Dir["#{worker_dir}/*.rb"])
27
+
28
+ api_latest_date = Date.parse(api_file_data.max)
29
+ worker_latest_date = Date.parse(worker_file_data.max)
30
+ end
31
+
32
+ if api_latest_date < worker_latest_date
33
+ FileUtils.rm_rf(api_dir) if Dir.exist?(api_dir)
34
+ FileUtils.mkdir(api_dir) unless Dir.exist?(api_dir)
35
+ system("cp -r #{worker_dir}/* #{api_dir}")
36
+ else
37
+ FileUtils.rm_rf(worker_dir) if Dir.exist?(worker_dir)
38
+ FileUtils.mkdir(worker_dir) unless Dir.exist?(worker_dir)
39
+ system("cp -r #{api_dir}/* #{worker_dir}")
40
+ end
41
+ end
42
+
43
+ def get_models_path(service_name: "api")
44
+ case service_name
45
+ when "api"
46
+ api_path = "."
47
+ worker_path = "../worker"
48
+ when "worker"
49
+ api_path = "../api"
50
+ worker_path = "."
51
+ end
52
+ [
53
+ {
54
+ api: "#{api_path}/db",
55
+ worker: "#{worker_path}/db"
56
+ },
57
+ {
58
+ api: "#{api_path}/app/models",
59
+ worker: "#{worker_path}/app/models"
60
+ },
61
+ {
62
+ api: "#{api_path}/spec/factories",
63
+ worker: "#{worker_path}/spec/factories"
64
+ }
65
+ ]
66
+ end
67
+ end
68
+ end
69
+ end
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.30.8".freeze
2
+ VERSION = "0.31.0".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.9.8
1
+ 0.10.0
@@ -1 +1 @@
1
- 0.9.8
1
+ 0.10.0
@@ -1,4 +1,3 @@
1
- require_relative "./generate/application"
2
1
  require_relative "./generate/mailer"
3
2
 
4
3
  module Souls
@@ -3,7 +3,6 @@ module Souls
3
3
  module Generate
4
4
  class << self
5
5
  def mailer(class_name: "mailer", option: "")
6
- puts(option)
7
6
  if option.to_sym == :sendgrid
8
7
  sendgrid_mailer(class_name: class_name)
9
8
  else
@@ -52,10 +51,6 @@ module Souls
52
51
  puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
53
52
  file_path
54
53
  end
55
-
56
- def sendgrid_mailer(class_name: "mailer")
57
- p("Coming Soon..")
58
- end
59
54
  end
60
55
  end
61
56
  end
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.30.8
4
+ version: 0.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
@@ -27,19 +27,19 @@ dependencies:
27
27
  - !ruby/object:Gem::Version
28
28
  version: 6.1.4
29
29
  - !ruby/object:Gem::Dependency
30
- name: dotenv
30
+ name: foreman
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
33
  - - '='
34
34
  - !ruby/object:Gem::Version
35
- version: 2.7.6
35
+ version: 0.87.2
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
40
  - - '='
41
41
  - !ruby/object:Gem::Version
42
- version: 2.7.6
42
+ version: 0.87.2
43
43
  - !ruby/object:Gem::Dependency
44
44
  name: paint
45
45
  requirement: !ruby/object:Gem::Requirement
@@ -83,10 +83,8 @@ dependencies:
83
83
  - !ruby/object:Gem::Version
84
84
  version: 0.3.0
85
85
  description: |-
86
- SOULs is a Serverless Application Framework with Ruby GraphQL.
87
- SOULs has 3 strains, API, Worker, and Frontend. It can be used in combination according to the purpose.
88
- SOULs Ruby GraphQL API / Worker and Easy to deploy to Google Cloud. No more routing for Backends!
89
- You can focus on your business logic.
86
+ SOULs はサーバーレスフルスタックフレームワークです。柔軟な Ruby GraphQL API Worker はルーティングの必要がありません。
87
+ クラウド環境への自動デプロイ、CI/CD ワークフローを標準装備。開発者がビジネスロジックに集中し、楽しくコードが書けるような環境を目指しています。
90
88
  email:
91
89
  - f.kawasaki@elsoul.nl
92
90
  - s.kishi@elsoul.nl
@@ -127,23 +125,25 @@ files:
127
125
  - lib/souls/api/update/rspec_mutation.rb
128
126
  - lib/souls/api/update/rspec_resolver.rb
129
127
  - lib/souls/api/update/type.rb
130
- - lib/souls/docker.rb
131
- - lib/souls/docker/docker.rb
132
- - lib/souls/gcloud.rb
133
- - lib/souls/gcloud/compute.rb
134
- - lib/souls/gcloud/iam.rb
135
- - lib/souls/gcloud/methods.rb
136
- - lib/souls/gcloud/pubsub.rb
137
- - lib/souls/gcloud/run.rb
128
+ - lib/souls/cli.rb
129
+ - lib/souls/cli/docker.rb
130
+ - lib/souls/cli/docker/docker.rb
131
+ - lib/souls/cli/gcloud.rb
132
+ - lib/souls/cli/gcloud/compute.rb
133
+ - lib/souls/cli/gcloud/iam.rb
134
+ - lib/souls/cli/gcloud/methods.rb
135
+ - lib/souls/cli/gcloud/pubsub.rb
136
+ - lib/souls/cli/gcloud/run.rb
137
+ - lib/souls/cli/release.rb
138
+ - lib/souls/cli/release/release.rb
139
+ - lib/souls/cli/sync.rb
140
+ - lib/souls/cli/sync/model.rb
138
141
  - lib/souls/init.rb
139
- - lib/souls/release.rb
140
- - lib/souls/release/release.rb
141
142
  - lib/souls/version.rb
142
143
  - lib/souls/versions/.souls_api_version
143
144
  - lib/souls/versions/.souls_worker_version
144
145
  - lib/souls/worker.rb
145
146
  - lib/souls/worker/generate.rb
146
- - lib/souls/worker/generate/application.rb
147
147
  - lib/souls/worker/generate/mailer.rb
148
148
  homepage: https://souls.elsoul.nl
149
149
  licenses:
@@ -170,8 +170,6 @@ requirements: []
170
170
  rubygems_version: 3.2.22
171
171
  signing_key:
172
172
  specification_version: 4
173
- summary: SOULs is a Serverless Application Framework with Ruby GraphQL. SOULs has
174
- 3 strains, API, Worker, and Frontend. It can be used in combination according to
175
- the purpose. SOULs Ruby GraphQL API / Worker and Easy to deploy to Google Cloud.
176
- No more routing for Backends! You can focus on your business logic.
173
+ summary: SOULs はサーバーレスフルスタックフレームワークです。柔軟な Ruby GraphQL API Worker はルーティングの必要がありません。
174
+ クラウド環境への自動デプロイ、CI/CD ワークフローを標準装備。開発者がビジネスロジックに集中し、楽しくコードが書けるような環境を目指しています。
177
175
  test_files: []
@@ -1,150 +0,0 @@
1
- module Souls
2
- module Worker
3
- module Generate
4
- ## Common Methods
5
- def self.generated_paths(class_name: "user")
6
- singularized_class_name = class_name.singularize.underscore
7
- pluralized_class_name = class_name.pluralize.underscore
8
- [
9
- "./app/models/#{singularized_class_name}.rb",
10
- "./app/policies/#{singularized_class_name}_policy.rb",
11
- "./app/graphql/mutations/create_#{singularized_class_name}.rb",
12
- "./app/graphql/mutations/delete_#{singularized_class_name}.rb",
13
- "./app/graphql/mutations/destroy_delete_#{singularized_class_name}.rb",
14
- "./app/graphql/mutations/update_#{singularized_class_name}.rb",
15
- "./app/graphql/queries/#{singularized_class_name}.rb",
16
- "./app/graphql/queries/#{pluralized_class_name}.rb",
17
- "./app/graphql/resolvers/#{singularized_class_name}_search.rb",
18
- "./app/graphql/types/#{singularized_class_name}_type.rb",
19
- "./app/graphql/types/edges/#{singularized_class_name}_edge.rb",
20
- "./app/graphql/types/connections/#{singularized_class_name}_connection.rb",
21
- "./spec/factories/#{pluralized_class_name}.rb",
22
- "./spec/mutations/#{singularized_class_name}_spec.rb",
23
- "./spec/models/#{singularized_class_name}_spec.rb",
24
- "./spec/queries/#{singularized_class_name}_spec.rb",
25
- "./spec/policies/#{singularized_class_name}_policy_spec.rb",
26
- "./spec/resolvers/#{singularized_class_name}_search_spec.rb"
27
- ]
28
- end
29
-
30
- def self.get_type_and_name(line)
31
- line.split(",")[0].gsub("\"", "").scan(/((?<=t\.).+(?=\s)) (.+)/)[0]
32
- end
33
-
34
- def self.get_tables
35
- path = "./db/schema.rb"
36
- tables = []
37
- File.open(path, "r") do |f|
38
- f.each_line.with_index do |line, _i|
39
- tables << line.split("\"")[1] if line.include?("create_table")
40
- end
41
- end
42
- tables
43
- end
44
-
45
- def self.type_check(type)
46
- {
47
- bigint: "Integer",
48
- string: "String",
49
- float: "Float",
50
- text: "String",
51
- datetime: "String",
52
- date: "String",
53
- boolean: "Boolean",
54
- integer: "Integer"
55
- }[type.to_sym]
56
- end
57
-
58
- def self.get_test_type(type)
59
- {
60
- bigint: 1,
61
- float: 4.2,
62
- string: '"MyString"',
63
- text: '"MyString"',
64
- datetime: "Time.now",
65
- date: "Time.now",
66
- boolean: false,
67
- integer: 1
68
- }[type.to_sym]
69
- end
70
-
71
- def self.table_check(line: "", class_name: "")
72
- if line.include?("create_table") && (line.split[1].gsub("\"", "").gsub(",", "") == class_name.pluralize.to_s)
73
-
74
- return true
75
- end
76
-
77
- false
78
- end
79
-
80
- def self.migrate(class_name: "souls")
81
- singularized_class_name = class_name.singularize
82
- model(class_name: singularized_class_name)
83
- type(class_name: singularized_class_name)
84
- edge(class_name: singularized_class_name)
85
- connection(class_name: singularized_class_name)
86
- resolver(class_name: singularized_class_name)
87
- rspec_factory(class_name: singularized_class_name)
88
- rspec_model(class_name: singularized_class_name)
89
- rspec_mutation(class_name: singularized_class_name)
90
- rspec_query(class_name: singularized_class_name)
91
- rspec_resolver(class_name: singularized_class_name)
92
- query(class_name: singularized_class_name)
93
- mutation(class_name: singularized_class_name)
94
- policy(class_name: singularized_class_name)
95
- rspec_policy(class_name: singularized_class_name)
96
- rescue StandardError => e
97
- raise(StandardError, e)
98
- end
99
-
100
- def self.migrate_all
101
- puts(Paint["Let's Go SOULs AUTO CRUD Assist!\n", :cyan])
102
- Souls::Api::Generate.get_tables.each do |table|
103
- Souls::Api::Generate.migrate(class_name: table.singularize)
104
- puts(Paint["Generated #{table.camelize} CRUD Files\n", :yellow])
105
- end
106
- end
107
-
108
- def self.delete_all(class_name: "souls")
109
- singularized_class_name = class_name.singularize.underscore
110
- pluralized_class_name = class_name.pluralize.underscore
111
- FileUtils.rm("./app/models/#{singularized_class_name}.rb")
112
- FileUtils.rm("./app/policies/#{singularized_class_name}_policy.rb")
113
- FileUtils.rm_rf("./app/graphql/mutations/base/#{singularized_class_name}")
114
- FileUtils.rm("./app/graphql/queries/#{singularized_class_name}.rb")
115
- FileUtils.rm("./app/graphql/queries/#{pluralized_class_name}.rb")
116
- FileUtils.rm("./app/graphql/resolvers/#{singularized_class_name}_search.rb")
117
- FileUtils.rm("./app/graphql/types/#{singularized_class_name}_type.rb")
118
- FileUtils.rm("./app/graphql/types/edges/#{singularized_class_name}_edge.rb")
119
- FileUtils.rm("./app/graphql/types/connections/#{singularized_class_name}_connection.rb")
120
- FileUtils.rm("./spec/factories/#{pluralized_class_name}.rb")
121
- FileUtils.rm("./spec/mutations/base/#{singularized_class_name}_spec.rb")
122
- FileUtils.rm("./spec/models/#{singularized_class_name}_spec.rb")
123
- FileUtils.rm("./spec/queries/#{singularized_class_name}_spec.rb")
124
- FileUtils.rm("./spec/policies/#{singularized_class_name}_policy_spec.rb")
125
- FileUtils.rm("./spec/resolvers/#{singularized_class_name}_search_spec.rb")
126
- puts(Paint["deleted #{class_name.camelize} CRUD!", :yellow])
127
- rescue StandardError => e
128
- raise(StandardError, e)
129
- end
130
-
131
- def self.update_delete(class_name: "souls")
132
- singularized_class_name = class_name.singularize.underscore
133
- pluralized_class_name = class_name.pluralize.underscore
134
- FileUtils.rm_rf("./app/graphql/mutations/#{singularized_class_name}")
135
- FileUtils.rm("./app/graphql/queries/#{singularized_class_name}.rb")
136
- FileUtils.rm("./app/graphql/queries/#{pluralized_class_name}.rb")
137
- FileUtils.rm("./app/graphql/resolvers/#{singularized_class_name}_search.rb")
138
- FileUtils.rm("./app/graphql/types/#{singularized_class_name}_type.rb")
139
- FileUtils.rm("./app/graphql/types/edges/#{singularized_class_name}_edge.rb")
140
- FileUtils.rm("./app/graphql/types/connections/#{singularized_class_name}_connection.rb")
141
- FileUtils.rm("./spec/mutations/#{singularized_class_name}_spec.rb")
142
- FileUtils.rm("./spec/queries/#{singularized_class_name}_spec.rb")
143
- FileUtils.rm("./spec/resolvers/#{singularized_class_name}_search_spec.rb")
144
- puts("deleted #{class_name.camelize} CRUD!")
145
- rescue StandardError => e
146
- raise(StandardError, e)
147
- end
148
- end
149
- end
150
- end