souls 1.13.4 → 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/index.rb +15 -1
- 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_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
|
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
|
@@ -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
|
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: []
|