souls 0.29.5 → 0.29.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 +4 -4
- data/exe/souls +3 -0
- data/lib/souls.rb +31 -0
- data/lib/souls/api.rb +1 -0
- data/lib/souls/api/generate/application.rb +1 -0
- data/lib/souls/api/generate/migration.rb +5 -5
- data/lib/souls/api/generate/type.rb +1 -1
- data/lib/souls/api/update.rb +6 -0
- data/lib/souls/api/update/update_mutation.rb +11 -0
- 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 +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3de74c19c656eca1c5cd6f49357be3527150d091d49fb6586f682383f19df91c
|
4
|
+
data.tar.gz: cef99823964ef73e5c72e192e2c437cd761cdba4d3e1907cbc9c69f924a92482
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '093729ea37591c9c0aabe63490f5edfa70a2e36230915f7fc59efe40f430b30a40512c2317e56c017cf4eabc919ae9b5453c6dfaf6a415ea03919da3078af89d'
|
7
|
+
data.tar.gz: 192c737658ca8ee527b2428da0df1a83c3989907ca2b8f8e2312b6e4b95da6f0f327df1e8504e0c6e61303f98641954b8458c4d2536d8467966411b9b18054ea
|
data/exe/souls
CHANGED
@@ -20,6 +20,8 @@ begin
|
|
20
20
|
Souls::Api::Generate.public_send(method_name, class_name: class_name)
|
21
21
|
Whirly.status = "Done!"
|
22
22
|
end
|
23
|
+
when "schema:update"
|
24
|
+
Souls::Api::Update.update_create_mutation_head
|
23
25
|
else
|
24
26
|
puts(Paint["Comannd doesn't exist.Check you command again!...", :red])
|
25
27
|
end
|
@@ -160,5 +162,6 @@ begin
|
|
160
162
|
puts(Paint["Welcome to SOULs!", :green])
|
161
163
|
end
|
162
164
|
rescue StandardError => e
|
165
|
+
puts(e.backtrace)
|
163
166
|
puts(Paint[e, :red])
|
164
167
|
end
|
data/lib/souls.rb
CHANGED
@@ -343,6 +343,37 @@ module Souls
|
|
343
343
|
result.compact
|
344
344
|
end
|
345
345
|
|
346
|
+
def get_add_migration_type(class_name: "user")
|
347
|
+
pluralized_class_name = class_name.pluralize
|
348
|
+
file_paths = Dir["db/migrate/*_add_column_to_#{pluralized_class_name}.rb"]
|
349
|
+
new_columns =
|
350
|
+
file_paths.map do |file_path|
|
351
|
+
get_col_name_and_type(class_name: class_name, file_path: file_path)
|
352
|
+
end
|
353
|
+
new_columns.flatten
|
354
|
+
end
|
355
|
+
|
356
|
+
def get_col_name_and_type(class_name: "user", file_path: "db/migrate/20210816094410_add_column_to_users.rb")
|
357
|
+
pluralized_class_name = class_name.pluralize
|
358
|
+
response = []
|
359
|
+
File.open(file_path) do |line|
|
360
|
+
line.each_line do |file_line|
|
361
|
+
next unless file_line.include?("add_column")
|
362
|
+
|
363
|
+
array = file_line.include?("array: true")
|
364
|
+
types = file_line.split(",").map(&:strip)
|
365
|
+
types.map { |n| n.gsub!(":", "") }
|
366
|
+
types[0].gsub!("add_column ", "")
|
367
|
+
unless types[0].to_s == pluralized_class_name
|
368
|
+
raise(StandardError, "Wrong class_name!Please Check your migration file!")
|
369
|
+
end
|
370
|
+
|
371
|
+
response << { column_name: types[1], type: types[2], array: array }
|
372
|
+
end
|
373
|
+
end
|
374
|
+
response
|
375
|
+
end
|
376
|
+
|
346
377
|
def configure
|
347
378
|
self.configuration ||= Configuration.new
|
348
379
|
yield(configuration)
|
data/lib/souls/api.rb
CHANGED
@@ -9,27 +9,27 @@ module Souls
|
|
9
9
|
|
10
10
|
def add_column(class_name: "user")
|
11
11
|
pluralized_class_name = class_name.underscore.pluralize
|
12
|
-
system("rake db:create_migration NAME=
|
12
|
+
system("rake db:create_migration NAME=add_column_to#{pluralized_class_name}")
|
13
13
|
end
|
14
14
|
|
15
15
|
def rename_column(class_name: "user")
|
16
16
|
pluralized_class_name = class_name.underscore.pluralize
|
17
|
-
system("rake db:create_migration NAME=
|
17
|
+
system("rake db:create_migration NAME=rename_column_to_#{pluralized_class_name}")
|
18
18
|
end
|
19
19
|
|
20
20
|
def change_column(class_name: "user")
|
21
21
|
pluralized_class_name = class_name.underscore.pluralize
|
22
|
-
system("rake db:create_migration NAME=
|
22
|
+
system("rake db:create_migration NAME=change_column_to#{pluralized_class_name}")
|
23
23
|
end
|
24
24
|
|
25
25
|
def remove_column(class_name: "user")
|
26
26
|
pluralized_class_name = class_name.underscore.pluralize
|
27
|
-
system("rake db:create_migration NAME=
|
27
|
+
system("rake db:create_migration NAME=remove_column_to#{pluralized_class_name}")
|
28
28
|
end
|
29
29
|
|
30
30
|
def drop_table(class_name: "user")
|
31
31
|
pluralized_class_name = class_name.underscore.pluralize
|
32
|
-
system("rake db:create_migration NAME=
|
32
|
+
system("rake db:create_migration NAME=drop_table_to#{pluralized_class_name}")
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.6
|
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.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.29.
|
4
|
+
version: 0.29.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
@@ -120,6 +120,8 @@ files:
|
|
120
120
|
- lib/souls/api/generate/rspec_query.rb
|
121
121
|
- lib/souls/api/generate/rspec_resolver.rb
|
122
122
|
- lib/souls/api/generate/type.rb
|
123
|
+
- lib/souls/api/update.rb
|
124
|
+
- lib/souls/api/update/update_mutation.rb
|
123
125
|
- lib/souls/docker.rb
|
124
126
|
- lib/souls/docker/docker.rb
|
125
127
|
- lib/souls/gcloud.rb
|