souls 0.30.1 → 0.30.5
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/exe/souls +2 -0
- data/lib/souls/api/generate/application.rb +13 -0
- data/lib/souls/api/update/mutation.rb +10 -7
- data/lib/souls/api/update/rspec_mutation.rb +5 -3
- data/lib/souls/api/update/rspec_resolver.rb +2 -2
- data/lib/souls/api/update/type.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 +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f9463dfc4512be27d5c5c918b7760d65427a6955024cbdcf3bef88b03b4564c0
|
4
|
+
data.tar.gz: be8880ba109cb6d1154679fbd4d1e6074efdb62c1800d5d40a66df402e29f84f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad7e7a3f7186578d88cceb4af241f9cce3ccccacc0213212be65cc74738c3966fe1809ffec55bdcb74005aefad958b0a385f48e7d4e24a8ba4b7631698575e6d
|
7
|
+
data.tar.gz: d4bf988c55ee0d469b222bb0f1e94864df40bbe5803200b7951ed02cb1491b6703629df211b08337e00ae80d651750d6abe75bd73a903ce90fa639656666ee42
|
data/exe/souls
CHANGED
@@ -27,6 +27,8 @@ begin
|
|
27
27
|
Whirly.status = status
|
28
28
|
Souls::Api::Update.create_mutation(class_name: class_name)
|
29
29
|
Souls::Api::Update.update_mutation(class_name: class_name)
|
30
|
+
Souls::Api::Update.resolver(class_name: class_name)
|
31
|
+
Souls::Api::Update.type(class_name: class_name)
|
30
32
|
Souls::Api::Update.rspec_factory(class_name: class_name)
|
31
33
|
Souls::Api::Update.rspec_mutation(class_name: class_name)
|
32
34
|
Souls::Api::Update.rspec_resolver(class_name: class_name)
|
@@ -74,6 +74,19 @@ module Souls
|
|
74
74
|
}[type.to_sym]
|
75
75
|
end
|
76
76
|
|
77
|
+
def self.get_type(type)
|
78
|
+
{
|
79
|
+
bigint: "Integer",
|
80
|
+
string: "String",
|
81
|
+
float: "Float",
|
82
|
+
text: "String",
|
83
|
+
datetime: "GraphQL::Types::ISO8601DateTime",
|
84
|
+
date: "GraphQL::Types::ISO8601DateTime",
|
85
|
+
boolean: "Boolean",
|
86
|
+
integer: "Integer"
|
87
|
+
}[type.to_sym]
|
88
|
+
end
|
89
|
+
|
77
90
|
def self.get_test_type(type)
|
78
91
|
{
|
79
92
|
bigint: "rand(1..10)",
|
@@ -16,11 +16,13 @@ module Souls
|
|
16
16
|
next unless line.include?("argument") && !argument
|
17
17
|
|
18
18
|
new_cols.each do |col|
|
19
|
-
type =
|
19
|
+
type = Souls::Api::Generate.type_check(col[:type])
|
20
|
+
type = "[#{type}]" if col[:array]
|
20
21
|
args = check_mutation_argument(class_name: class_name)
|
21
|
-
|
22
|
-
|
23
|
-
|
22
|
+
next if args.include?(col[:column_name])
|
23
|
+
next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
|
24
|
+
|
25
|
+
new_line.write(" argument :#{col[:column_name]}, #{type}, required: false\n")
|
24
26
|
end
|
25
27
|
argument = true
|
26
28
|
end
|
@@ -48,9 +50,10 @@ module Souls
|
|
48
50
|
type = Souls::Api::Generate.type_check(col[:type])
|
49
51
|
type = "[#{type}]" if col[:array]
|
50
52
|
args = check_mutation_argument(class_name: class_name, action: "update")
|
51
|
-
|
52
|
-
|
53
|
-
|
53
|
+
next if args.include?(col[:column_name])
|
54
|
+
next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
|
55
|
+
|
56
|
+
new_line.write(" argument :#{col[:column_name]}, #{type}, required: false\n")
|
54
57
|
end
|
55
58
|
argument = true
|
56
59
|
end
|
@@ -24,7 +24,7 @@ module Souls
|
|
24
24
|
new_cols.each do |col|
|
25
25
|
type = Souls::Api::Generate.type_check(col[:type])
|
26
26
|
if type == "String" && !col[:array]
|
27
|
-
type_line = " #{col[:column_name].
|
27
|
+
type_line = " #{col[:column_name].camelize(:lower)}: \"\#{#{class_name.singularize}[:#{col[:column_name].singularize.underscore}]}\"\n"
|
28
28
|
else
|
29
29
|
type_line = " #{col[:column_name].singularize.camelize(:lower)}: \#{#{class_name.singularize}[:#{col[:column_name].singularize.underscore}]}\n"
|
30
30
|
end
|
@@ -35,7 +35,9 @@ module Souls
|
|
35
35
|
elsif node_res && !line.include?("{")
|
36
36
|
node_args = check_rspec_mutation_argument(class_name: class_name, action: "node_args")
|
37
37
|
new_cols.each do |col|
|
38
|
-
|
38
|
+
unless node_args.include?(col[:column_name])
|
39
|
+
new_line.write(" #{col[:column_name].camelize(:lower)}\n")
|
40
|
+
end
|
39
41
|
end
|
40
42
|
node_res = false
|
41
43
|
elsif test_res && line.include?("=> be_")
|
@@ -54,7 +56,7 @@ module Souls
|
|
54
56
|
col[:array] ? "be_all(String)" : "be_a(String)"
|
55
57
|
end
|
56
58
|
unless test_args.include?(col[:column_name])
|
57
|
-
new_line.write("
|
59
|
+
new_line.write(" \"#{col[:column_name].camelize(:lower)}\" => #{text},\n")
|
58
60
|
end
|
59
61
|
end
|
60
62
|
test_res = false
|
@@ -23,7 +23,7 @@ module Souls
|
|
23
23
|
node_args = check_rspec_resolver_argument(class_name: class_name, action: "node_args")
|
24
24
|
new_cols.each do |col|
|
25
25
|
unless node_args.include?(col[:column_name])
|
26
|
-
new_line.write(" #{col[:column_name].camelize}\n")
|
26
|
+
new_line.write(" #{col[:column_name].camelize(:lower)}\n")
|
27
27
|
end
|
28
28
|
end
|
29
29
|
node_res = false
|
@@ -43,7 +43,7 @@ module Souls
|
|
43
43
|
col[:array] ? "be_all(String)" : "be_a(String)"
|
44
44
|
end
|
45
45
|
unless test_args.include?(col[:column_name])
|
46
|
-
new_line.write(" \"#{col[:column_name]}\" => #{text},\n")
|
46
|
+
new_line.write(" \"#{col[:column_name].camelize(:lower)}\" => #{text},\n")
|
47
47
|
end
|
48
48
|
end
|
49
49
|
test_res = false
|
@@ -16,7 +16,7 @@ module Souls
|
|
16
16
|
next unless line.include?("field") && !argument
|
17
17
|
|
18
18
|
new_cols.each do |col|
|
19
|
-
type = Souls::Api::Generate.
|
19
|
+
type = Souls::Api::Generate.get_type(col[:type])
|
20
20
|
type = "[#{type}]" if col[:array]
|
21
21
|
args = check_type_argument(class_name: class_name)
|
22
22
|
unless args.include?(col[:column_name])
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.5
|
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.5
|