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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: eeb1d10d6473bd7f8ca2cadc783485f74d42bd0e9b90ce2206b08041dcdbf546
4
- data.tar.gz: eff44e2e5adcb4a545a336fb4c7600be28a8f85ddea03e475e58bf72a8dac0e9
3
+ metadata.gz: f9463dfc4512be27d5c5c918b7760d65427a6955024cbdcf3bef88b03b4564c0
4
+ data.tar.gz: be8880ba109cb6d1154679fbd4d1e6074efdb62c1800d5d40a66df402e29f84f
5
5
  SHA512:
6
- metadata.gz: b5eab8bc9b90e26757ed3369305cc92de003edf4335a19cf36aae5e5f245bbc45a23b41a41e8525df4ef8d051413213f1a0db166092fab3e2b57fc9063683e3c
7
- data.tar.gz: 1fb92dc68e9bd8674f9b749c1a8d043fdaaea54cb4cffd9bfa1bc8833fa6499a47e0013888d30e229f4f7ed362dfe89ef7e87b4f162566af5e896bff6b4b5b22
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 = col[:array] ? "[#{col[:type].camelize}]" : col[:type].camelize
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
- unless args.include?(col[:column_name])
22
- new_line.write(" argument :#{col[:column_name]}, #{type}, required: false\n")
23
- 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")
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
- unless args.include?(col[:column_name])
52
- new_line.write(" argument :#{col[:column_name]}, #{type}, required: false\n")
53
- 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")
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].singularize.camelize(:lower)}: \"\#{#{class_name.singularize}[:#{col[:column_name].singularize.underscore}]}\"\n"
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
- new_line.write(" #{col[:column_name]}\n") unless node_args.include?(col[:column_name])
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(" \"#{col[:column_name]}\" => #{text},\n")
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.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.1".freeze
2
+ VERSION = "0.30.5".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.9.1
1
+ 0.9.5
@@ -1 +1 @@
1
- 0.9.1
1
+ 0.9.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: 0.30.1
4
+ version: 0.30.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI