souls 0.30.2 → 0.30.6

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: 57344fa4d1e1a552326fa4572562bab54bfee433567f8a4542b7f121a9e75e1d
4
- data.tar.gz: 3d8b499794eaca93df04196d6b64b021f2e2d8f04c1609872e8fd893c84c6eb5
3
+ metadata.gz: 5ebfb8f46ba74e3981c76d2c31a0605338f899f0921214394cc1f130fe10d443
4
+ data.tar.gz: ce856e57c384e0b7f21d2e1b74995cef24796e5779269545d441ff51b829708e
5
5
  SHA512:
6
- metadata.gz: b1bf7c8623d14d159eaf63c1e5923fe4e62deba80ab729af1685d9e308e459e03d5592dbacf492ea5de0982b968b973a09e8adf79c58ae39fd1cc72961031467
7
- data.tar.gz: 8372df71883cbb82bd04ebb0a8b4c5cba93997a44447f65915ef1c19b4b2bf889349458a1a8dec1b7af160f9cf71e3387578ca02af481af9991a340aa05be3d4
6
+ metadata.gz: 3edd0d19021505e7795100eeaf9f64f480684445d1d8d8d7310c24781757443dfdf4f62e1ca433a5a030be79bf7dd2d340673369496f6593b215968ff953c575
7
+ data.tar.gz: b5d1f18fefacc8978e157b34d045d5b58d5c591b3cf963021be832b99903aba898ee95b81a201759a4be2cc4cbc8b9472742231e0953298e65285b606e1cef4a
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)",
@@ -19,9 +19,10 @@ module Souls
19
19
  type = Souls::Api::Generate.type_check(col[:type])
20
20
  type = "[#{type}]" if col[:array]
21
21
  args = check_mutation_argument(class_name: class_name)
22
- unless args.include?(col[:column_name])
23
- new_line.write(" argument :#{col[:column_name]}, #{type}, required: false\n")
24
- end
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")
25
26
  end
26
27
  argument = true
27
28
  end
@@ -49,9 +50,10 @@ module Souls
49
50
  type = Souls::Api::Generate.type_check(col[:type])
50
51
  type = "[#{type}]" if col[:array]
51
52
  args = check_mutation_argument(class_name: class_name, action: "update")
52
- unless args.include?(col[:column_name])
53
- new_line.write(" argument :#{col[:column_name]}, #{type}, required: false\n")
54
- end
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")
55
57
  end
56
58
  argument = true
57
59
  end
@@ -23,11 +23,12 @@ module Souls
23
23
  if line.include?('#{') && !argument
24
24
  new_cols.each do |col|
25
25
  type = Souls::Api::Generate.type_check(col[:type])
26
- if type == "String" && !col[:array]
27
- type_line = " #{col[:column_name].singularize.camelize(:lower)}: \"\#{#{class_name.singularize}[:#{col[:column_name].singularize.underscore}]}\"\n"
28
- else
29
- type_line = " #{col[:column_name].singularize.camelize(:lower)}: \#{#{class_name.singularize}[:#{col[:column_name].singularize.underscore}]}\n"
30
- end
26
+ type_line =
27
+ if type == "String" && !col[:array]
28
+ " #{col[:column_name].camelize(:lower)}: \"\#{#{class_name}[:#{col[:column_name].underscore}]}\"\n"
29
+ else
30
+ " #{col[:column_name].camelize(:lower)}: \#{#{class_name}[:#{col[:column_name].underscore}]}\n"
31
+ end
31
32
  args = check_rspec_mutation_argument(class_name: class_name)
32
33
  new_line.write(type_line) unless args.include?(col[:column_name].singularize.underscore)
33
34
  end
@@ -35,7 +36,9 @@ module Souls
35
36
  elsif node_res && !line.include?("{")
36
37
  node_args = check_rspec_mutation_argument(class_name: class_name, action: "node_args")
37
38
  new_cols.each do |col|
38
- new_line.write(" #{col[:column_name]}\n") unless node_args.include?(col[:column_name])
39
+ unless node_args.include?(col[:column_name])
40
+ new_line.write(" #{col[:column_name].camelize(:lower)}\n")
41
+ end
39
42
  end
40
43
  node_res = false
41
44
  elsif test_res && line.include?("=> be_")
@@ -54,7 +57,7 @@ module Souls
54
57
  col[:array] ? "be_all(String)" : "be_a(String)"
55
58
  end
56
59
  unless test_args.include?(col[:column_name])
57
- new_line.write(" \"#{col[:column_name]}\" => #{text},\n")
60
+ new_line.write(" \"#{col[:column_name].camelize(:lower)}\" => #{text},\n")
58
61
  end
59
62
  end
60
63
  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.type_check(col[:type])
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,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.30.2".freeze
2
+ VERSION = "0.30.6".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.9.2
1
+ 0.9.6
@@ -1 +1 @@
1
- 0.9.2
1
+ 0.9.6
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: 0.30.2
4
+ version: 0.30.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI