souls 1.13.1 → 1.13.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/souls/cli/db/create_migration.rb +1 -1
- data/lib/souls/cli/db/index.rb +15 -1
- data/lib/souls/cli/delete/rspec_job.rb +1 -1
- data/lib/souls/cli/generate/job.rb +1 -1
- data/lib/souls/cli/generate/job_rbs.rb +1 -2
- data/lib/souls/cli/generate/manager.rb +1 -0
- data/lib/souls/cli/generate/query.rb +0 -24
- data/lib/souls/cli/generate/query_rbs.rb +0 -25
- data/lib/souls/cli/generate/rspec_job.rb +1 -3
- data/lib/souls/cli/generate/rspec_manager.rb +1 -1
- data/lib/souls/version.rb +1 -1
- data/lib/souls/versions/.souls_api_version +1 -1
- data/lib/souls/versions/.souls_worker_version +1 -1
- metadata +7 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c7b81e3860df4c06035c6e246f5b94e9f2c6c6ca1b10e21c294a54d2f5544076
|
4
|
+
data.tar.gz: ddc504a3d6f34e89ca69fe8f9ac0907c9b032040800f81662e0a71ebfd95b5eb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: db0fd8035b3d9e5dca0140a28ddf9fb17eda5e61f3be211a2826519344d5be22da13d11e52c1a48204b0ed56164ce8fc5de1e65217825b147f8c16b076af0334
|
7
|
+
data.tar.gz: 2536554178c57ae2f313a0cb28040788e2494f8418bfcd219b09639e0ac7c7771964d4fd34a5b67c395d73497d4494958511a5072a58d94d04e67fd4f4261f0f
|
@@ -7,7 +7,7 @@ module Souls
|
|
7
7
|
Souls::DB.new.invoke(:model, [singularized_class_name], {})
|
8
8
|
Souls::DB.new.invoke(:rspec_model, [singularized_class_name], {})
|
9
9
|
Souls::DB.new.invoke(:model_rbs, [singularized_class_name], {})
|
10
|
-
|
10
|
+
Souls::Painter.create_file("")
|
11
11
|
system("rake db:create_migration NAME=create_#{pluralized_class_name}")
|
12
12
|
file_path = Dir["db/migrate/*create_#{pluralized_class_name}.rb"].first
|
13
13
|
File.open(file_path, "w") do |f|
|
data/lib/souls/cli/db/index.rb
CHANGED
@@ -55,6 +55,20 @@ module Souls
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
+
desc "reset", "Reset Database and Seed"
|
59
|
+
method_option :env, aliases: "--e", default: "development", desc: "Difine APP Enviroment - development | production"
|
60
|
+
def reset
|
61
|
+
case options[:env]
|
62
|
+
when "production"
|
63
|
+
db_system("rake db:migrate:reset RACK_ENV=production DISABLE_DATABASE_ENVIRONMENT_CHECK=1")
|
64
|
+
db_system("rake db seed RACK_ENV=production")
|
65
|
+
else
|
66
|
+
db_system("rake db:migrate:reset")
|
67
|
+
db_system("rake db:migrate RACK_ENV=test")
|
68
|
+
db_system("rake db seed")
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
58
72
|
desc "add_column [CLASS_NAME]", "Create ActiveRecord Migration File"
|
59
73
|
def add_column(class_name)
|
60
74
|
pluralized_class_name = class_name.underscore.pluralize
|
@@ -88,7 +102,7 @@ module Souls
|
|
88
102
|
private
|
89
103
|
|
90
104
|
def db_system(cmd)
|
91
|
-
system(cmd) or
|
105
|
+
system(cmd) or Souls::Painter.error("DB is not running. Please run `souls docker psql`")
|
92
106
|
end
|
93
107
|
end
|
94
108
|
end
|
@@ -2,7 +2,7 @@ module Souls
|
|
2
2
|
class Delete < Thor
|
3
3
|
desc "rspec_job [CLASS_NAME]", "Delete Rspec Job Test Template"
|
4
4
|
def rspec_job(class_name)
|
5
|
-
file_dir = "./spec/jobs"
|
5
|
+
file_dir = "./spec/queries/jobs"
|
6
6
|
singularized_class_name = class_name.underscore.singularize
|
7
7
|
file_path = "#{file_dir}/#{singularized_class_name}_spec.rb"
|
8
8
|
FileUtils.rm_f(file_path)
|
@@ -108,7 +108,7 @@ module Souls
|
|
108
108
|
File.open(file_path, "w") do |f|
|
109
109
|
f.write(<<~TEXT)
|
110
110
|
module Types
|
111
|
-
class #{class_name.camelize}Type < BaseObject
|
111
|
+
class #{class_name.camelize}Type < Souls::Types::BaseObject
|
112
112
|
field :response, String, null: true
|
113
113
|
end
|
114
114
|
end
|
@@ -26,14 +26,13 @@ module Souls
|
|
26
26
|
File.open(type_file_path, "w") do |f|
|
27
27
|
f.write(<<~TEXT)
|
28
28
|
module Types
|
29
|
-
class #{singularized_class_name.camelize}Type < BaseObject
|
29
|
+
class #{singularized_class_name.camelize}Type < Souls::Types::BaseObject
|
30
30
|
def self.field: (:response, String, null: true) -> untyped
|
31
31
|
end
|
32
32
|
end
|
33
33
|
TEXT
|
34
34
|
end
|
35
35
|
Souls::Painter.create_file(file_path.to_s)
|
36
|
-
puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [type_file_path.to_s, :white] }])
|
37
36
|
end
|
38
37
|
file_path
|
39
38
|
end
|
@@ -6,34 +6,10 @@ module Souls
|
|
6
6
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
7
7
|
singularized_class_name = class_name.singularize
|
8
8
|
create_individual_query(class_name: singularized_class_name)
|
9
|
-
create_index_query(class_name: singularized_class_name)
|
10
9
|
end
|
11
10
|
|
12
11
|
private
|
13
12
|
|
14
|
-
def create_index_query(class_name: "user")
|
15
|
-
file_path = "./app/graphql/queries/#{class_name.pluralize}.rb"
|
16
|
-
return "Query already exist! #{file_path}" if File.exist?(file_path)
|
17
|
-
|
18
|
-
File.open(file_path, "w") do |f|
|
19
|
-
f.write(<<~TEXT)
|
20
|
-
module Queries
|
21
|
-
class #{class_name.camelize.pluralize} < Queries::BaseQuery
|
22
|
-
type [Types::#{class_name.camelize}Type], null: false
|
23
|
-
|
24
|
-
def resolve
|
25
|
-
::#{class_name.camelize}.all
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
TEXT
|
30
|
-
end
|
31
|
-
Souls::Painter.create_file(file_path.to_s)
|
32
|
-
file_path
|
33
|
-
rescue StandardError => e
|
34
|
-
raise(StandardError, e)
|
35
|
-
end
|
36
|
-
|
37
13
|
def create_individual_query(class_name: "user")
|
38
14
|
file_path = "./app/graphql/queries/#{class_name}.rb"
|
39
15
|
return "Query already exist! #{file_path}" if File.exist?(file_path)
|
@@ -3,7 +3,6 @@ module Souls
|
|
3
3
|
desc "query_rbs [CLASS_NAME]", "Generate GraphQL Query RBS"
|
4
4
|
def query_rbs(class_name)
|
5
5
|
single_query_rbs(class_name)
|
6
|
-
queries_rbs(class_name)
|
7
6
|
end
|
8
7
|
|
9
8
|
private
|
@@ -35,29 +34,5 @@ module Souls
|
|
35
34
|
end
|
36
35
|
file_path
|
37
36
|
end
|
38
|
-
|
39
|
-
def queries_rbs(class_name)
|
40
|
-
file_path = ""
|
41
|
-
Dir.chdir(Souls.get_mother_path.to_s) do
|
42
|
-
file_dir = "./sig/api/app/graphql/queries/"
|
43
|
-
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
44
|
-
pluralized_class_name = class_name.underscore.pluralize
|
45
|
-
file_path = "#{file_dir}#{pluralized_class_name}.rbs"
|
46
|
-
File.open(file_path, "w") do |f|
|
47
|
-
f.write(<<~TEXT)
|
48
|
-
module Queries
|
49
|
-
class BaseQuery
|
50
|
-
end
|
51
|
-
class #{pluralized_class_name.camelize} < Queries::BaseQuery
|
52
|
-
def resolve: () -> ( Hash[Symbol, ( String | Integer | bool )] | ::GraphQL::ExecutionError)
|
53
|
-
def self.type: (*untyped) -> String
|
54
|
-
end
|
55
|
-
end
|
56
|
-
TEXT
|
57
|
-
end
|
58
|
-
Souls::Painter.create_file(file_path.to_s)
|
59
|
-
end
|
60
|
-
file_path
|
61
|
-
end
|
62
37
|
end
|
63
38
|
end
|
@@ -29,9 +29,7 @@ module Souls
|
|
29
29
|
end
|
30
30
|
|
31
31
|
it "return #{singularized_class_name.camelize} response" do
|
32
|
-
|
33
|
-
.to_return(status: 200, body: "", headers: {})
|
34
|
-
#{' '}
|
32
|
+
allow_any_instance_of(::Mailgun::Client).to(receive(:send_message).and_return(true))
|
35
33
|
a1 = result.dig("data", "#{singularized_class_name.camelize(:lower)}")
|
36
34
|
expect(a1).not_to be_empty
|
37
35
|
expect(a1).to(include("response" => be_a(String)))
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.13.
|
1
|
+
1.13.5
|
@@ -1 +1 @@
|
|
1
|
-
1.13.
|
1
|
+
1.13.5
|
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: 1.13.
|
4
|
+
version: 1.13.5
|
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-12-
|
13
|
+
date: 2021-12-21 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -138,10 +138,9 @@ dependencies:
|
|
138
138
|
- - ">="
|
139
139
|
- !ruby/object:Gem::Version
|
140
140
|
version: 1.1.0
|
141
|
-
description:
|
142
|
-
|
143
|
-
|
144
|
-
Record, RSpec, RuboCop, and Google Cloud. "
|
141
|
+
description: |-
|
142
|
+
Ruby Serverless Framework 'SOULs' | Ruby サーバーレスフレームワーク SOULs.
|
143
|
+
Powered by Ruby GraphQL, RBS/Steep, Active Record, RSpec, RuboCop, and Google Cloud.
|
145
144
|
email:
|
146
145
|
- f.kawasaki@elsoul.nl
|
147
146
|
- s.kishi@elsoul.nl
|
@@ -292,8 +291,6 @@ requirements: []
|
|
292
291
|
rubygems_version: 3.2.32
|
293
292
|
signing_key:
|
294
293
|
specification_version: 4
|
295
|
-
summary: Ruby Serverless Framework 'SOULs'
|
296
|
-
|
297
|
-
Apps faster like Rails. Powered by Ruby GraphQL, RBS/Steep, Active Record, RSpec,
|
298
|
-
RuboCop, and Google Cloud.
|
294
|
+
summary: Ruby Serverless Framework 'SOULs' | Ruby サーバーレスフレームワーク SOULs. Powered by
|
295
|
+
Ruby GraphQL, RBS/Steep, Active Record, RSpec, RuboCop, and Google Cloud.
|
299
296
|
test_files: []
|