souls 0.29.6 → 0.29.7
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/lib/souls.rb +17 -8
- data/lib/souls/api/generate/migration.rb +4 -4
- 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 +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc98a9c24cdabf1ec57a40a86568022f359ea9f06dca660e43026be99f15cd35
|
4
|
+
data.tar.gz: 1a98e52c5c2c99db4f862eb3df16cbb203103582cb6eff0bbfb82ba3c124fb07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a69a2c609172b3d5a0d3c0bbe9578a1b67aa9a0613c217b1f6d3cfcc2b62b34ff21d455cb933728383eecff5fe61ae3a30ea7ddba7d833cc54c44dde8026818e
|
7
|
+
data.tar.gz: 46b1abe8dd28421a07480afadf78ee88b21a58593d61869b3cc5deaca895f006a34ca9c4efd9a8de4c1dc70c59b14241f17b78396be8106e78e6ef58a5a92b9d
|
data/lib/souls.rb
CHANGED
@@ -332,20 +332,29 @@ module Souls
|
|
332
332
|
}
|
333
333
|
end
|
334
334
|
|
335
|
-
def
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
335
|
+
def get_columns_num(class_name: "user")
|
336
|
+
file_path = "./db/schema.rb"
|
337
|
+
class_check_flag = false
|
338
|
+
cols = []
|
339
|
+
File.open(file_path, "r") do |f|
|
340
|
+
f.each_line.with_index do |line, _i|
|
341
|
+
class_check_flag = true if line.include?("create_table") && line.include?(class_name)
|
342
|
+
if class_check_flag == true && !line.include?("create_table")
|
343
|
+
return cols if line.include?("t.index") || line.strip == "end"
|
344
|
+
|
345
|
+
types = Souls::Api::Generate.get_type_and_name(line)
|
346
|
+
array = line.include?("array: true")
|
347
|
+
cols << { column_name: types[1], type: types[0], array: array }
|
348
|
+
end
|
342
349
|
end
|
343
|
-
|
350
|
+
end
|
351
|
+
cols
|
344
352
|
end
|
345
353
|
|
346
354
|
def get_add_migration_type(class_name: "user")
|
347
355
|
pluralized_class_name = class_name.pluralize
|
348
356
|
file_paths = Dir["db/migrate/*_add_column_to_#{pluralized_class_name}.rb"]
|
357
|
+
p(file_paths)
|
349
358
|
new_columns =
|
350
359
|
file_paths.map do |file_path|
|
351
360
|
get_col_name_and_type(class_name: class_name, file_path: file_path)
|
@@ -9,7 +9,7 @@ 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")
|
@@ -19,17 +19,17 @@ module Souls
|
|
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.7
|
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.7
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-08-
|
13
|
+
date: 2021-08-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|