souls 1.7.6 → 1.7.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 +4 -4
- data/lib/souls/cli/generate/query.rb +4 -4
- data/lib/souls/cli/sync/pubsub.rb +3 -3
- data/lib/souls/cli/update/mutation_rbs.rb +35 -40
- 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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 75e1e708375c27972c9ca860ae344a8fe5c30bb441f65ddec1ac34c790b1c0c2
|
4
|
+
data.tar.gz: a3a39f40c711fcd0ad2d32122a72cf40b53da5d4661ca127a3b4b631512a09ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67ca8f18243ad49b60787b6b9166a0cb270bb71176000e081dde5fdbce9972050a31b513124d83c1f83fa819ed51e05eccd478a2aea72d647455f0211481e8a2
|
7
|
+
data.tar.gz: faedae1fe18e80fa45e78dd72c4f35c83413354502fae2285da2bc037ddb7c5f7302c983ff5e3ce099d9bb713a978bf61a6f33cb9def71ba6d74d07cdcd19e43
|
@@ -5,15 +5,15 @@ module Souls
|
|
5
5
|
file_dir = "./app/graphql/queries/"
|
6
6
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
7
7
|
singularized_class_name = class_name.singularize
|
8
|
-
|
9
|
-
|
8
|
+
create_individual_query(class_name: singularized_class_name)
|
9
|
+
create_index_query(class_name: singularized_class_name)
|
10
10
|
rescue Thor::Error => e
|
11
11
|
raise(Thor::Error, e)
|
12
12
|
end
|
13
13
|
|
14
14
|
private
|
15
15
|
|
16
|
-
def
|
16
|
+
def create_index_query(class_name: "user")
|
17
17
|
file_path = "./app/graphql/queries/#{class_name.pluralize}.rb"
|
18
18
|
return "Query already exist! #{file_path}" if File.exist?(file_path)
|
19
19
|
|
@@ -38,7 +38,7 @@ module Souls
|
|
38
38
|
raise(StandardError, e)
|
39
39
|
end
|
40
40
|
|
41
|
-
def
|
41
|
+
def create_individual_query(class_name: "user")
|
42
42
|
file_path = "./app/graphql/queries/#{class_name}.rb"
|
43
43
|
return "Query already exist! #{file_path}" if File.exist?(file_path)
|
44
44
|
|
@@ -90,10 +90,10 @@ module Souls
|
|
90
90
|
Dir.chdir(Souls.get_mother_path.to_s) do
|
91
91
|
worker_paths.each do |worker|
|
92
92
|
workers =
|
93
|
-
Dir["apps/#{worker}/app/graphql/
|
94
|
-
file.gsub("apps/#{worker}/app/graphql/
|
93
|
+
Dir["apps/#{worker}/app/graphql/queries/*.rb"].map do |file|
|
94
|
+
file.gsub("apps/#{worker}/app/graphql/queries/", "").gsub(".rb", "")
|
95
95
|
end
|
96
|
-
workers.delete("
|
96
|
+
workers.delete("base_query")
|
97
97
|
workers.each do |file|
|
98
98
|
response[:"souls_#{worker}_#{file}"] = 1
|
99
99
|
end
|
@@ -8,58 +8,53 @@ module Souls
|
|
8
8
|
new_cols = Souls.get_columns_num(class_name: singularized_class_name)
|
9
9
|
end
|
10
10
|
dir_name = "./sig/api/app/graphql/mutations/base/#{singularized_class_name}"
|
11
|
-
new_file_path = "config/create_mutation.rbs"
|
12
11
|
file_path = "#{dir_name}/create_#{singularized_class_name}.rbs"
|
13
12
|
argument = false
|
14
13
|
resolve = false
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
write_txt = ""
|
15
|
+
File.open(file_path, "r") do |f|
|
16
|
+
f.each_line do |line|
|
17
|
+
next if line.include?("| (:") && argument
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
19
|
+
if line.include?("{ :node => String } } | ::GraphQL::ExecutionError )")
|
20
|
+
write_txt += line
|
21
|
+
resolve = false
|
22
|
+
elsif resolve
|
23
|
+
next
|
24
|
+
elsif line.include?("def resolve:") && !resolve
|
25
|
+
new_cols.each_with_index do |col, i|
|
26
|
+
type = Souls.type_check(col[:type])
|
27
|
+
type = "[#{type}]" if col[:array]
|
28
|
+
next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
|
30
29
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end
|
30
|
+
if i.zero?
|
31
|
+
write_txt += line
|
32
|
+
else
|
33
|
+
write_txt += " #{col[:column_name]}: #{type}?,\n"
|
36
34
|
end
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
35
|
+
end
|
36
|
+
resolve = true
|
37
|
+
elsif line.include?("def self.argument:") && !argument
|
38
|
+
new_cols.each_with_index do |col, i|
|
39
|
+
type = Souls.type_check(col[:type])
|
40
|
+
type = "[#{type}]" if col[:array]
|
41
|
+
next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
" | (:#{col[:column_name]}, #{type}, required: false ) -> #{type}\n"
|
51
|
-
)
|
52
|
-
end
|
43
|
+
if i.zero?
|
44
|
+
write_txt +=
|
45
|
+
" def self.argument: (:#{col[:column_name]}, #{type}, required: false ) -> #{type}\n"
|
46
|
+
else
|
47
|
+
write_txt +=
|
48
|
+
" | (:#{col[:column_name]}, #{type}, required: false ) -> #{type}\n"
|
53
49
|
end
|
54
|
-
argument = true
|
55
|
-
else
|
56
|
-
new_line.write(line)
|
57
50
|
end
|
51
|
+
argument = true
|
52
|
+
else
|
53
|
+
write_txt += line
|
58
54
|
end
|
59
55
|
end
|
60
56
|
end
|
61
|
-
|
62
|
-
FileUtils.mv(new_file_path, file_path)
|
57
|
+
File.open(file_path, "w") { |f| f.write(write_txt) }
|
63
58
|
puts(Paint % ["Updated file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
|
64
59
|
rescue Thor::Error => e
|
65
60
|
raise(Thor::Error, e)
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.7.
|
1
|
+
1.7.7
|
@@ -1 +1 @@
|
|
1
|
-
1.7.
|
1
|
+
1.7.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: 1.7.
|
4
|
+
version: 1.7.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
@@ -226,7 +226,7 @@ licenses:
|
|
226
226
|
metadata:
|
227
227
|
homepage_uri: https://souls.elsoul.nl
|
228
228
|
source_code_uri: https://github.com/elsoul/souls
|
229
|
-
changelog_uri: https://github.com/elsoul/souls/releases/tag/v1.7.
|
229
|
+
changelog_uri: https://github.com/elsoul/souls/releases/tag/v1.7.7
|
230
230
|
post_install_message:
|
231
231
|
rdoc_options: []
|
232
232
|
require_paths:
|