souls 0.71.1 → 0.71.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: ad9d5643107678ff3aab040a1bf6e6c2313bd8fb686f78ad2b39c84d983e7c83
4
- data.tar.gz: 9bcf98ab7ff78452c104c5d4d0330616fa11c46d2072abec0dba2d356f48bed3
3
+ metadata.gz: 8eef551448a25b03bac3ebe5d199b6b0b172fcba9e78d87858120b414c5ea0c0
4
+ data.tar.gz: b0c718d228c2465a8b79a11a8467dc2bb67aa6bd6d6b68e7a96de92f623edb68
5
5
  SHA512:
6
- metadata.gz: 22c656466cd3a7c86e547a368557c0a3c71ebeed67bdf0f7d6388a03d6a573dc8b0c352434b7b3805e8364b8602155c50f9c5b4bfef6ad74dce2c1c6125412ae
7
- data.tar.gz: 22c4f6010d42209507111495125a25f823eef45a0b33dc488bdbe74aef5cf0814b0c78d9a0d19a9dc6ba4afbfb1b9f645d28551dfaceb0973ae58f17508e278f
6
+ metadata.gz: e39c3d25b169546409de5751b3df719239cec5ddaeff0fa9cc1b66ba28f3be1b8eaa9d99b7b09ab0db12d40d78558fcfac76b8218c4fd60b7aa7fbd5b9151b61
7
+ data.tar.gz: 144bdb5fb9cb4ce27e76510514bfb5712fb8dc6b7414389463c8cb0a72c65735718c27cd13b59edce008bf7b69295f592e862ee657741fe5627ce8c24248d5aa
@@ -13,14 +13,16 @@ module Souls
13
13
  def scaffold(class_name)
14
14
  create_mutation(class_name)
15
15
  update_mutation(class_name)
16
- create_mutation_rbs(class_name)
17
- update_mutation_rbs(class_name)
18
16
  resolver(class_name)
19
17
  type(class_name)
20
- type_rbs(class_name)
21
18
  rspec_factory(class_name)
22
19
  rspec_mutation(class_name)
23
20
  rspec_resolver(class_name)
21
+ Dir.chdir(Souls.get_mother_path.to_s) do
22
+ create_mutation_rbs(class_name)
23
+ update_mutation_rbs(class_name)
24
+ type_rbs(class_name)
25
+ end
24
26
  end
25
27
  end
26
28
  end
@@ -3,9 +3,12 @@ module Souls
3
3
  desc "create_mutation_rbs [CLASS_NAME]", "Update GraphQL Type from schema.rb"
4
4
  def create_mutation_rbs(class_name)
5
5
  singularized_class_name = class_name.singularize.underscore
6
- new_cols = Souls.get_columns_num(class_name: singularized_class_name)
6
+ new_cols = ""
7
+ Dir.chdir(Souls.get_api_path.to_s) do
8
+ new_cols = Souls.get_columns_num(class_name: singularized_class_name)
9
+ end
7
10
  dir_name = "./sig/api/app/graphql/mutations/base/#{singularized_class_name}"
8
- new_file_path = "tmp/create_mutation.rbs"
11
+ new_file_path = "config/create_mutation.rbs"
9
12
  file_path = "#{dir_name}/create_#{singularized_class_name}.rbs"
10
13
  argument = false
11
14
  resolve = false
@@ -23,8 +26,6 @@ module Souls
23
26
  new_cols.each_with_index do |col, i|
24
27
  type = Souls.type_check(col[:type])
25
28
  type = "[#{type}]" if col[:array]
26
- args = check_mutation_argument(class_name: class_name)
27
- next if args.include?(col[:column_name])
28
29
  next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
29
30
 
30
31
  if i.zero?
@@ -38,8 +39,6 @@ module Souls
38
39
  new_cols.each_with_index do |col, i|
39
40
  type = Souls.type_check(col[:type])
40
41
  type = "[#{type}]" if col[:array]
41
- args = check_mutation_argument(class_name: class_name)
42
- next if args.include?(col[:column_name])
43
42
  next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
44
43
 
45
44
  if i.zero?
@@ -71,7 +70,7 @@ module Souls
71
70
  singularized_class_name = class_name.singularize.underscore
72
71
  new_cols = Souls.get_columns_num(class_name: singularized_class_name)
73
72
  dir_name = "./sig/api/app/graphql/mutations/base/#{singularized_class_name}"
74
- new_file_path = "tmp/update_mutation.rbs"
73
+ new_file_path = "config/update_mutation.rbs"
75
74
  file_path = "#{dir_name}/update_#{singularized_class_name}.rbs"
76
75
  argument = false
77
76
  resolve = false
@@ -89,8 +88,6 @@ module Souls
89
88
  new_cols.each_with_index do |col, i|
90
89
  type = Souls.type_check(col[:type])
91
90
  type = "[#{type}]" if col[:array]
92
- args = check_mutation_argument(class_name: class_name)
93
- next if args.include?(col[:column_name])
94
91
  next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
95
92
 
96
93
  if i.zero?
@@ -105,8 +102,6 @@ module Souls
105
102
  new_cols.each_with_index do |col, i|
106
103
  type = Souls.type_check(col[:type])
107
104
  type = "[#{type}]" if col[:array]
108
- args = check_mutation_argument(class_name: class_name)
109
- next if args.include?(col[:column_name])
110
105
  next if col[:column_name] == "created_at" || col[:column_name] == "updated_at"
111
106
 
112
107
  if i.zero?
@@ -132,20 +127,5 @@ module Souls
132
127
  rescue Thor::Error => e
133
128
  raise(Thor::Error, e)
134
129
  end
135
-
136
- private
137
-
138
- def check_mutation_argument(class_name: "user", action: "create")
139
- singularized_class_name = class_name.singularize.underscore
140
- dir_name = "./sig/api/app/graphql/mutations/base/#{singularized_class_name}"
141
- file_path = "#{dir_name}/#{action}_#{singularized_class_name}.rbs"
142
- args = []
143
- File.open(file_path) do |f|
144
- f.each_line do |line|
145
- args << line.split(",")[0].gsub("argument :", "").strip.underscore if line.include?("argument")
146
- end
147
- end
148
- args
149
- end
150
130
  end
151
131
  end
@@ -5,7 +5,7 @@ module Souls
5
5
  singularized_class_name = class_name.singularize.underscore
6
6
  new_cols = Souls.get_columns_num(class_name: singularized_class_name)
7
7
  dir_name = "./sig/api/app/graphql/types"
8
- new_file_path = "tmp/create_type.rbs"
8
+ new_file_path = "config/create_type.rbs"
9
9
  file_path = "#{dir_name}/#{singularized_class_name}_type.rbs"
10
10
  argument = false
11
11
  File.open(file_path) do |f|
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.71.1".freeze
2
+ VERSION = "0.71.5".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.50.1
1
+ 0.50.5
@@ -1 +1 @@
1
- 0.50.1
1
+ 0.50.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.71.1
4
+ version: 0.71.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI