souls 0.65.4 → 0.66.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fea2c7809dbc16cba399be01133563e1770c6920edd33f366fc28628fbdde57d
|
4
|
+
data.tar.gz: 292b21da9bc2a3314410ddc29c72f22447b6a3f172c94e81ee48ab7a07531c05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a5d3d8cdbe12fb9009d5cd8cbb5ba4f7627d6fb478de244aabd69ca1ac1bc72646fd47c217ac310452da561fce9d365c8778414de9bf17a7e26e1123b62461c
|
7
|
+
data.tar.gz: 8f24438d97d11a5e8cd70f5fa78c010bab2c4c07aa2feea268356f15d61d565df4278f29965e5381f643de8c6cdcf1965adb172a5187dbc9bc9c9622d1db8d42
|
@@ -45,7 +45,7 @@ module Souls
|
|
45
45
|
type = Souls.type_check(param[:type])
|
46
46
|
type = "[#{type}]" if param[:array]
|
47
47
|
type = "String" if param[:column_name].match?(/$*_id\z/)
|
48
|
-
next if
|
48
|
+
next if param[:column_name] == "user_id"
|
49
49
|
|
50
50
|
if i == params[:params].size - 1
|
51
51
|
f.write(" argument :#{param[:column_name]}, #{type}, required: false\n\n")
|
@@ -121,6 +121,7 @@ module Souls
|
|
121
121
|
if i == params[:params].size - 1
|
122
122
|
f.write(" argument :#{param[:column_name]}, #{type}, required: false\n\n")
|
123
123
|
f.write(" def resolve(args)\n")
|
124
|
+
f.write(" _, data_id = SoulsApiSchema.from_global_id(args[:id])\n")
|
124
125
|
else
|
125
126
|
f.write(" argument :#{param[:column_name]}, #{type}, required: false\n")
|
126
127
|
end
|
@@ -140,12 +141,11 @@ module Souls
|
|
140
141
|
", #{n[:column_name]}: #{n[:column_name]}"
|
141
142
|
end
|
142
143
|
f.write(" new_record = { **args #{relation_params.compact.join} }\n")
|
143
|
-
f.write(" data = ::#{singularized_class_name.camelize}.find(article_id)\n")
|
144
|
-
f.write(" data.update(new_record)\n")
|
145
144
|
else
|
146
|
-
f.write("
|
147
|
-
f.write(" data.update(args)\n")
|
145
|
+
f.write(" new_record = args.except(:id)\n")
|
148
146
|
end
|
147
|
+
f.write(" data = ::#{singularized_class_name.camelize}.find(data_id)\n")
|
148
|
+
f.write(" data.update(new_record)\n")
|
149
149
|
end
|
150
150
|
File.open(file_path, "a") do |new_line|
|
151
151
|
new_line.write(<<~TEXT)
|
@@ -61,7 +61,11 @@ module Souls
|
|
61
61
|
rbs_type = Souls.rbs_type_check(param[:type])
|
62
62
|
type = "[#{type}]" if param[:array]
|
63
63
|
if i.zero?
|
64
|
-
|
64
|
+
if param[:column_name].match?(/$*_id\z/)
|
65
|
+
f.write(" def self.argument: (:#{param[:column_name]}, String, required: false ) -> #{rbs_type}\n")
|
66
|
+
else
|
67
|
+
f.write(" def self.argument: (:#{param[:column_name]}, #{type}, required: false ) -> #{rbs_type}\n")
|
68
|
+
end
|
65
69
|
elsif param[:column_name].match?(/$*_id\z/)
|
66
70
|
f.write(" | (:#{param[:column_name]}, String, required: false ) -> String\n")
|
67
71
|
else
|
@@ -114,9 +118,12 @@ module Souls
|
|
114
118
|
TEXT
|
115
119
|
end
|
116
120
|
File.open(file_path, "a") do |f|
|
117
|
-
params[:params].
|
121
|
+
cols = params[:params].reject { |n| n[:column_name] == "user_id" }
|
122
|
+
cols.each_with_index do |param, i|
|
118
123
|
type = Souls.rbs_type_check(param[:type])
|
119
124
|
type = "[#{type}]" if param[:array]
|
125
|
+
type = "String" if param[:column_name].match?(/$*_id\z/)
|
126
|
+
|
120
127
|
if i == params[:params].size - 1
|
121
128
|
f.write(" #{param[:column_name]}: #{type}?\n")
|
122
129
|
else
|
@@ -131,10 +138,14 @@ module Souls
|
|
131
138
|
# rubocop:enable Layout/LineLength
|
132
139
|
|
133
140
|
File.open(file_path, "a") do |f|
|
134
|
-
params[:params].
|
141
|
+
cols = params[:params].reject { |n| n[:column_name] == "user_id" }
|
142
|
+
cols.each_with_index do |param, i|
|
135
143
|
type = Souls.type_check(param[:type])
|
136
144
|
rbs_type = Souls.rbs_type_check(param[:type])
|
137
145
|
type = "[#{type}]" if param[:array]
|
146
|
+
type = "String" if param[:column_name].match?(/$*_id\z/)
|
147
|
+
rbs_type = "String" if param[:column_name].match?(/$*_id\z/)
|
148
|
+
|
138
149
|
required = param[:column_name] == "id" ? "required: true" : "required: false"
|
139
150
|
if i.zero?
|
140
151
|
f.write(" def self.argument: (:#{param[:column_name]}, #{type}, #{required} ) -> #{rbs_type}\n")
|
data/lib/souls/cli.rb
CHANGED
@@ -39,23 +39,27 @@ module Souls
|
|
39
39
|
end
|
40
40
|
|
41
41
|
desc "test", "Run Rspec & Rubocop"
|
42
|
+
method_option :all, type: :boolean, aliases: "--all", default: false, desc: "Run (Rspec & steep check & Rubocop)"
|
42
43
|
def test
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
44
|
+
if options[:all]
|
45
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
46
|
+
system("steep check")
|
47
|
+
end
|
48
|
+
Dir.chdir(Souls.get_api_path.to_s) do
|
49
|
+
system("rubocop -A")
|
50
|
+
system("bundle exec rspec")
|
51
|
+
end
|
52
|
+
else
|
53
|
+
system("rubocop -A")
|
54
|
+
system("bundle exec rspec")
|
51
55
|
end
|
52
|
-
system("rubocop -A")
|
53
|
-
system("bundle exec rspec")
|
54
56
|
end
|
55
57
|
|
56
58
|
desc "check", "Run steep check"
|
57
59
|
def check
|
58
|
-
|
60
|
+
Dir.chdir(Souls.get_mother_path.to_s) do
|
61
|
+
system("steep check")
|
62
|
+
end
|
59
63
|
end
|
60
64
|
|
61
65
|
def self.exit_on_failure?
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.45.2
|
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.45.2
|