souls 0.54.4 → 0.55.1

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: eef7cd565e70dfb4a040f2ff59c1c52b1419ea2edd0a3e47ff72bd31a27df54f
4
- data.tar.gz: d6c85ac5fb93ecdaa41bdf81f66f90949c1a04e1027cc2bf7af200f71b7d7afb
3
+ metadata.gz: 73360700bdc37dfbecd749b27fc7130b74ab5e6b09964de3ef3a69b871ca3757
4
+ data.tar.gz: 7f541d2b5b3f2585e400870d8f10d9668c690823f06febfc82ecf993cf1b8e94
5
5
  SHA512:
6
- metadata.gz: 03a9e2e99b87528271665deabc8abff05b139863a4da93a7fc03a92b9ea78a34f8dc91cecf89c0e5fb1f45f188fdf807cea0b9dbe590c7df647f50201a506ed3
7
- data.tar.gz: 9b84af82597b9bff3d155da20cabf70d2acb1e9b6117a5f3362dc7d5f19b5f300fb96c3b2732e4da592b205c6a15acac01282bb29f518600b881e94b168b9095
6
+ metadata.gz: f3fb45003722268317046bf1d2888f92f402e27a9320d61ec0466131f281364ce4ffc6408b17b9abffc1d1fb46e923193dfd6f3753137e8b30bb51dea632e809
7
+ data.tar.gz: 2dbe0bb5b0be9f0430f932d3b83b9cc8708c12bdcfed6d31095c88afa67f18f9f1c0bcfb4c812056f5182de6dbad3546dc48e456f3e7ce52818a080137d5581b
data/exe/souls CHANGED
@@ -11,7 +11,6 @@ begin
11
11
  "help",
12
12
  "api",
13
13
  "create",
14
- "gcloud",
15
14
  "worker",
16
15
  "",
17
16
  nil
@@ -0,0 +1,22 @@
1
+ module Souls
2
+ class Generate < Thor
3
+ desc "connection [CLASS_NAME]", "Generate GraphQL Connection from schema.rb"
4
+ def connection(class_name)
5
+ file_dir = "./app/graphql/types/connections/"
6
+ FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
7
+ singularized_class_name = class_name.underscore.singularize
8
+ file_path = "./app/graphql/types/connections/#{singularized_class_name}_connection.rb"
9
+ File.open(file_path, "w") do |f|
10
+ f.write(<<~TEXT)
11
+ class Types::#{singularized_class_name.camelize}Connection < Types::BaseConnection
12
+ edge_type(Types::#{singularized_class_name.camelize}Edge)
13
+ end
14
+ TEXT
15
+ end
16
+ puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
17
+ file_path
18
+ rescue Thor::Error => e
19
+ raise(Thor::Error, e)
20
+ end
21
+ end
22
+ end
@@ -20,7 +20,7 @@ module Souls
20
20
 
21
21
  field :response, String, null: false
22
22
 
23
- def resolve(**args)
23
+ def resolve(args)
24
24
  # Define Here
25
25
  rescue StandardError => e
26
26
  GraphQL::ExecutionError.new(e.to_s)
@@ -55,13 +55,13 @@ module Souls
55
55
  if @user_exist
56
56
  new_line.write(<<-TEXT)
57
57
 
58
- def resolve **args
58
+ def resolve args
59
59
  args[:user_id] = context[:user].id
60
60
  TEXT
61
61
  else
62
62
  new_line.write(<<-TEXT)
63
63
 
64
- def resolve **args
64
+ def resolve args
65
65
  TEXT
66
66
  end
67
67
  break
@@ -109,7 +109,7 @@ module Souls
109
109
 
110
110
  { #{class_name}_edge: { node: data } }
111
111
  rescue StandardError => error
112
- GraphQL::ExecutionError.new error
112
+ GraphQL::ExecutionError.new(error.message)
113
113
  end
114
114
  end
115
115
  end
@@ -149,14 +149,14 @@ module Souls
149
149
  if @user_exist
150
150
  new_line.write(<<-TEXT)
151
151
 
152
- def resolve **args
152
+ def resolve args
153
153
  args[:user_id] = context[:user].id
154
154
  _, args[:id] = SoulsApiSchema.from_global_id(args[:id])
155
155
  TEXT
156
156
  else
157
157
  new_line.write(<<-TEXT)
158
158
 
159
- def resolve **args
159
+ def resolve args
160
160
  _, args[:id] = SoulsApiSchema.from_global_id(args[:id])
161
161
  TEXT
162
162
  end
@@ -204,7 +204,7 @@ module Souls
204
204
  #{class_name}.update args
205
205
  { #{class_name}_edge: { node: ::#{class_name.camelize}.find(args[:id]) } }
206
206
  rescue StandardError => error
207
- GraphQL::ExecutionError.new error
207
+ GraphQL::ExecutionError.new(error.message)
208
208
  end
209
209
  end
210
210
  end
@@ -237,13 +237,13 @@ module Souls
237
237
  field :#{class_name}, Types::#{class_name.camelize}Type, null: false
238
238
  argument :id, String, required: true
239
239
 
240
- def resolve **args
240
+ def resolve args
241
241
  _, data_id = SoulsApiSchema.from_global_id args[:id]
242
242
  #{class_name} = ::#{class_name.camelize}.find data_id
243
243
  #{class_name}.update(is_deleted: true)
244
244
  { #{class_name}: ::#{class_name.camelize}.find(data_id) }
245
245
  rescue StandardError => error
246
- GraphQL::ExecutionError.new error
246
+ GraphQL::ExecutionError.new(error.message)
247
247
  end
248
248
  end
249
249
  end
@@ -266,13 +266,13 @@ module Souls
266
266
  field :#{class_name}, Types::#{class_name.camelize}Type, null: false
267
267
  argument :id, String, required: true
268
268
 
269
- def resolve **args
269
+ def resolve args
270
270
  _, data_id = SoulsApiSchema.from_global_id args[:id]
271
271
  #{class_name} = ::#{class_name.camelize}.find data_id
272
272
  #{class_name}.destroy
273
273
  { #{class_name}: #{class_name} }
274
274
  rescue StandardError => error
275
- GraphQL::ExecutionError.new error
275
+ GraphQL::ExecutionError.new(error.message)
276
276
  end
277
277
  end
278
278
  end
@@ -26,7 +26,7 @@ module Souls
26
26
  def resolve
27
27
  ::#{class_name.camelize}.all
28
28
  rescue StandardError => error
29
- GraphQL::ExecutionError.new error
29
+ GraphQL::ExecutionError.new(error.message)
30
30
  end
31
31
  end
32
32
  end
@@ -49,11 +49,11 @@ module Souls
49
49
  type Types::#{class_name.camelize}Type, null: false
50
50
  argument :id, String, required: true
51
51
 
52
- def resolve **args
52
+ def resolve args
53
53
  _, data_id = SoulsApiSchema.from_global_id args[:id]
54
54
  ::#{class_name.camelize}.find(data_id)
55
55
  rescue StandardError => error
56
- GraphQL::ExecutionError.new error
56
+ GraphQL::ExecutionError.new(error.message)
57
57
  end
58
58
  end
59
59
  end
@@ -7,7 +7,8 @@ module Souls
7
7
 
8
8
  desc "update [COMMAND]", "souls api update Commands"
9
9
  subcommand "update", Update
10
-
11
- map g: :generate
10
+ # rubocop:disable Style/StringHashKeys
11
+ map "g" => :generate
12
+ # rubocop:enable Style/StringHashKeys
12
13
  end
13
14
  end
@@ -9,10 +9,12 @@ module Souls
9
9
  raise(StandardError, "Same Worker Already Exist!") if Dir.exist?(file_dir)
10
10
 
11
11
  workers = Souls.configuration.workers
12
+ app = Souls.configuration.app
12
13
  port = 3000 + workers.size
14
+ souls_worker_name = "souls-#{app}-#{options[:name]}"
13
15
  download_worker(worker_name: options[:name])
14
- souls_conf_update(worker_name: options[:name])
15
- souls_conf_update(worker_name: options[:name], strain: "api")
16
+ souls_conf_update(worker_name: souls_worker_name)
17
+ souls_conf_update(worker_name: souls_worker_name, strain: "api")
16
18
  workflow(worker_name: options[:name])
17
19
  procfile(worker_name: options[:name], port: port)
18
20
  mother_procfile(worker_name: options[:name])
@@ -220,5 +222,43 @@ end
220
222
  system("cp ./apps/api/config/database.yml ./apps/#{worker_name}/config/")
221
223
  FileUtils.rm(file_name)
222
224
  end
225
+
226
+ def souls_worker_credit(worker_name: "mailer")
227
+ line = Paint["====================================", :yellow]
228
+ puts("\n")
229
+ puts(line)
230
+ txt2 = <<~TEXT
231
+ _____ ____ __ ____#{' '}
232
+ / ___// __ \\/ / / / / %{red1}
233
+ \\__ \\/ / / / / / / / %{red2}
234
+ ___/ / /_/ / /_/ / /___%{red3}#{' '}
235
+ /____/\\____/\\____/_____%{red4}#{' '}
236
+ TEXT
237
+ red1 = ["_____", :red]
238
+ red2 = ["/ ___/", :red]
239
+ red3 = ["(__ )", :red]
240
+ red4 = ["/____/", :red]
241
+ ms = Paint % [txt2, :cyan, { red1: red1, red2: red2, red3: red3, red4: red4 }]
242
+ puts(ms)
243
+ puts(line)
244
+ welcome = Paint["SOULs Worker is Ready!", :white]
245
+ puts(welcome)
246
+ souls_ver = Paint["SOULs Version: #{Souls::VERSION}", :white]
247
+ puts(souls_ver)
248
+ puts(line)
249
+ endroll = <<~TEXT
250
+ Easy to Run
251
+ $ cd apps/#{worker_name}
252
+ $ bundle
253
+ $ souls sync model
254
+ $ souls s
255
+ Go To : http://localhost:3000
256
+
257
+ Doc: https://souls.elsoul.nl
258
+ TEXT
259
+ cd = Paint[endroll, :white]
260
+ puts(cd)
261
+ puts(line)
262
+ end
223
263
  end
224
264
  end
@@ -34,6 +34,7 @@ module Souls
34
34
 
35
35
  desc "config_set", "gcloud config set"
36
36
  def config_set
37
+ require("#{Souls.get_api_path}/config/souls")
37
38
  project_id = Souls.configuration.project_id
38
39
  system("gcloud config set project #{project_id}")
39
40
  end
@@ -16,6 +16,16 @@ module Souls
16
16
  souls_api_credit(app_name: app_name, service_name: service_name)
17
17
  end
18
18
 
19
+ desc "init", "Run git submodule add RBS collection"
20
+ def add_submodule
21
+ system("git submodule add https://github.com/ruby/gem_rbs_collection.git vendor/rbs/gem_rbs_collection")
22
+ end
23
+
24
+ desc "update_submodule", "Run git submodule update --init RBS collection"
25
+ def update_submodule
26
+ system("git submodule update --init https://github.com/ruby/gem_rbs_collection.git vendor/rbs/gem_rbs_collection")
27
+ end
28
+
19
29
  private
20
30
 
21
31
  def get_version(repository_name: "souls_api")
@@ -74,7 +84,7 @@ module Souls
74
84
 
75
85
  def download_github_actions(app_name: "souls-app")
76
86
  file_name = "github.tgz"
77
- url = "https://storage.googleapis.com/souls-bucket/github_actions/github.tgz"
87
+ url = "https://storage.googleapis.com/souls-bucket/boilerplates/github_actions/github.tgz"
78
88
  system("curl -OL #{url}")
79
89
  FileUtils.mkdir_p("#{app_name}/github")
80
90
  system("tar -zxvf ./#{file_name} -C #{app_name}/")
@@ -110,11 +120,19 @@ module Souls
110
120
  system("curl -OL #{url}")
111
121
  system("mkdir -p #{app_name}/apps/#{service_name}")
112
122
  system("tar -zxvf ./#{file_name} -C #{app_name}/apps/")
123
+ FileUtils.rm(file_name)
124
+
125
+ sig_name = "sig.tgz"
126
+ url = "https://storage.googleapis.com/souls-bucket/boilerplates/sig/#{sig_name}"
127
+ system("curl -OL #{url}")
128
+ system("tar -zxvf ./#{sig_name} -C #{app_name}")
129
+
113
130
  system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/.rubocop.yml")
114
131
  system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Gemfile")
115
132
  system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Procfile.dev")
116
133
  system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Procfile")
117
- FileUtils.rm(file_name)
134
+ system("cd #{app_name} && curl -OL https://storage.googleapis.com/souls-bucket/boilerplates/Steepfile")
135
+ FileUtils.rm(sig_name)
118
136
  end
119
137
 
120
138
  def souls_api_credit(app_name: "souls", service_name: "api")
data/lib/souls/cli.rb CHANGED
@@ -44,12 +44,24 @@ module Souls
44
44
  puts(Souls::VERSION)
45
45
  end
46
46
 
47
- desc "test", "Run Rspec & Rubocop"
47
+ desc "test", "Run (Rspec & steep check & Rubocop)"
48
48
  def test
49
49
  system("rubocop -A")
50
+ system("steep check")
50
51
  system("bundle exec rspec")
51
52
  end
52
53
 
54
+ desc "test_all", "Run Rspec & Rubocop"
55
+ def test_all
56
+ system("rubocop -A")
57
+ system("bundle exec rspec")
58
+ end
59
+
60
+ desc "check", "Run steep check"
61
+ def check
62
+ system("steep check")
63
+ end
64
+
53
65
  def self.exit_on_failure?
54
66
  false
55
67
  end
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.54.4".freeze
2
+ VERSION = "0.55.1".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.33.4
1
+ 0.34.1
@@ -1 +1 @@
1
- 0.33.4
1
+ 0.34.1
@@ -5,6 +5,8 @@ module Souls
5
5
  desc "generate [COMMAND]", "souls worker generate Commands"
6
6
  subcommand "generate", Generate
7
7
 
8
- map g: :generate
8
+ # rubocop:disable Style/StringHashKeys
9
+ map "g" => :generate
10
+ # rubocop:enable Style/StringHashKeys
9
11
  end
10
12
  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.54.4
4
+ version: 0.55.1
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-09-22 00:00:00.000000000 Z
13
+ date: 2021-09-24 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -129,6 +129,7 @@ files:
129
129
  - lib/souls.rb
130
130
  - lib/souls/api/generate/application.rb
131
131
  - lib/souls/api/generate/connection.rb
132
+ - lib/souls/api/generate/connection_rbs.rb
132
133
  - lib/souls/api/generate/edge.rb
133
134
  - lib/souls/api/generate/index.rb
134
135
  - lib/souls/api/generate/manager.rb