souls 0.29.3 → 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/exe/souls +8 -3
- data/lib/souls.rb +47 -7
- data/lib/souls/api.rb +1 -0
- data/lib/souls/api/generate/application.rb +1 -0
- data/lib/souls/api/generate/migration.rb +31 -4
- 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/init.rb +1 -3
- data/lib/souls/release.rb +1 -1
- data/lib/souls/release/{methods.rb → release.rb} +1 -1
- 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
- data/lib/souls/worker/generate/mailer.rb +6 -3
- metadata +5 -3
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/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
|
@@ -29,10 +31,12 @@ begin
|
|
29
31
|
when "generate", "g"
|
30
32
|
method_name = ARGV[2]
|
31
33
|
class_name = ARGV[3]
|
34
|
+
args = { class_name: class_name }
|
35
|
+
args[:option] = ARGV[4] if ARGV.size > 4
|
32
36
|
status = Paint["Running SOULs Generate Commands...", :yellow]
|
33
37
|
Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
|
34
38
|
Whirly.status = status
|
35
|
-
Souls::Worker::Generate.public_send(method_name,
|
39
|
+
Souls::Worker::Generate.public_send(method_name, **args)
|
36
40
|
Whirly.status = "Done!"
|
37
41
|
end
|
38
42
|
else
|
@@ -40,7 +44,7 @@ begin
|
|
40
44
|
end
|
41
45
|
when "new"
|
42
46
|
args = ARGV
|
43
|
-
Souls::Init.
|
47
|
+
Souls::Init.start(args)
|
44
48
|
when "s", "server"
|
45
49
|
system("foreman start -f Procfile.dev")
|
46
50
|
when "c", "console"
|
@@ -78,7 +82,7 @@ begin
|
|
78
82
|
Whirly.status = "Done!"
|
79
83
|
end
|
80
84
|
when "release"
|
81
|
-
Souls::Release.
|
85
|
+
Souls::Release.gem_release
|
82
86
|
when "model:update"
|
83
87
|
status = Paint["Syncing Models...", :yellow]
|
84
88
|
Whirly.start(spinner: "clock", interval: 420, stop: "🎉") do
|
@@ -158,5 +162,6 @@ begin
|
|
158
162
|
puts(Paint["Welcome to SOULs!", :green])
|
159
163
|
end
|
160
164
|
rescue StandardError => e
|
165
|
+
puts(e.backtrace)
|
161
166
|
puts(Paint[e, :red])
|
162
167
|
end
|
data/lib/souls.rb
CHANGED
@@ -332,15 +332,55 @@ module Souls
|
|
332
332
|
}
|
333
333
|
end
|
334
334
|
|
335
|
-
def
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
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"
|
340
344
|
|
341
|
-
|
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
|
352
|
+
end
|
353
|
+
|
354
|
+
def get_add_migration_type(class_name: "user")
|
355
|
+
pluralized_class_name = class_name.pluralize
|
356
|
+
file_paths = Dir["db/migrate/*_add_column_to_#{pluralized_class_name}.rb"]
|
357
|
+
p(file_paths)
|
358
|
+
new_columns =
|
359
|
+
file_paths.map do |file_path|
|
360
|
+
get_col_name_and_type(class_name: class_name, file_path: file_path)
|
361
|
+
end
|
362
|
+
new_columns.flatten
|
363
|
+
end
|
364
|
+
|
365
|
+
def get_col_name_and_type(class_name: "user", file_path: "db/migrate/20210816094410_add_column_to_users.rb")
|
366
|
+
pluralized_class_name = class_name.pluralize
|
367
|
+
response = []
|
368
|
+
File.open(file_path) do |line|
|
369
|
+
line.each_line do |file_line|
|
370
|
+
next unless file_line.include?("add_column")
|
371
|
+
|
372
|
+
array = file_line.include?("array: true")
|
373
|
+
types = file_line.split(",").map(&:strip)
|
374
|
+
types.map { |n| n.gsub!(":", "") }
|
375
|
+
types[0].gsub!("add_column ", "")
|
376
|
+
unless types[0].to_s == pluralized_class_name
|
377
|
+
raise(StandardError, "Wrong class_name!Please Check your migration file!")
|
378
|
+
end
|
379
|
+
|
380
|
+
response << { column_name: types[1], type: types[2], array: array }
|
381
|
+
end
|
382
|
+
end
|
383
|
+
response
|
344
384
|
end
|
345
385
|
|
346
386
|
def configure
|
data/lib/souls/api.rb
CHANGED
@@ -1,9 +1,36 @@
|
|
1
1
|
module Souls
|
2
2
|
module Api
|
3
|
-
module
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
module Generate
|
4
|
+
class << self
|
5
|
+
def create_migration(class_name: "user")
|
6
|
+
pluralized_class_name = class_name.underscore.pluralize
|
7
|
+
system("rake db:create_migration NAME=create_#{pluralized_class_name}")
|
8
|
+
end
|
9
|
+
|
10
|
+
def add_column(class_name: "user")
|
11
|
+
pluralized_class_name = class_name.underscore.pluralize
|
12
|
+
system("rake db:create_migration NAME=add_column_to_#{pluralized_class_name}")
|
13
|
+
end
|
14
|
+
|
15
|
+
def rename_column(class_name: "user")
|
16
|
+
pluralized_class_name = class_name.underscore.pluralize
|
17
|
+
system("rake db:create_migration NAME=rename_column_to_#{pluralized_class_name}")
|
18
|
+
end
|
19
|
+
|
20
|
+
def change_column(class_name: "user")
|
21
|
+
pluralized_class_name = class_name.underscore.pluralize
|
22
|
+
system("rake db:create_migration NAME=change_column_to_#{pluralized_class_name}")
|
23
|
+
end
|
24
|
+
|
25
|
+
def remove_column(class_name: "user")
|
26
|
+
pluralized_class_name = class_name.underscore.pluralize
|
27
|
+
system("rake db:create_migration NAME=remove_column_to_#{pluralized_class_name}")
|
28
|
+
end
|
29
|
+
|
30
|
+
def drop_table(class_name: "user")
|
31
|
+
pluralized_class_name = class_name.underscore.pluralize
|
32
|
+
system("rake db:create_migration NAME=drop_table_to_#{pluralized_class_name}")
|
33
|
+
end
|
7
34
|
end
|
8
35
|
end
|
9
36
|
end
|
data/lib/souls/init.rb
CHANGED
@@ -21,7 +21,6 @@ module Souls
|
|
21
21
|
config.project_id = "souls-app"
|
22
22
|
config.strain = "#{app_name}"
|
23
23
|
config.github_repo = "elsoul/souls"
|
24
|
-
config.worker_endpoint = "https://worker.test.com"
|
25
24
|
config.fixed_gems = ["excluded_gem"]
|
26
25
|
end
|
27
26
|
TEXT
|
@@ -51,7 +50,6 @@ module Souls
|
|
51
50
|
config.project_id = "#{app_name}"
|
52
51
|
config.strain = "mother"
|
53
52
|
config.github_repo = "elsoul/souls"
|
54
|
-
config.worker_endpoint = "https://worker.test.com"
|
55
53
|
config.fixed_gems = ["excluded_gem"]
|
56
54
|
end
|
57
55
|
TEXT
|
@@ -60,7 +58,7 @@ module Souls
|
|
60
58
|
puts(e)
|
61
59
|
end
|
62
60
|
|
63
|
-
def self.
|
61
|
+
def self.start(args)
|
64
62
|
app_name = args[1]
|
65
63
|
if app_name.nil?
|
66
64
|
puts(Paint["you need to specify your app name", :red])
|
data/lib/souls/release.rb
CHANGED
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.7
|
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.7
|
@@ -2,8 +2,9 @@ module Souls
|
|
2
2
|
module Worker
|
3
3
|
module Generate
|
4
4
|
class << self
|
5
|
-
def mailer(class_name: "mailer", option:
|
6
|
-
|
5
|
+
def mailer(class_name: "mailer", option: "")
|
6
|
+
puts(option)
|
7
|
+
if option.to_sym == :sendgrid
|
7
8
|
sendgrid_mailer(class_name: class_name)
|
8
9
|
else
|
9
10
|
mailgun_mailer(class_name: class_name)
|
@@ -52,7 +53,9 @@ module Souls
|
|
52
53
|
file_path
|
53
54
|
end
|
54
55
|
|
55
|
-
def sendgrid_mailer
|
56
|
+
def sendgrid_mailer(class_name: "mailer")
|
57
|
+
p("Coming Soon..")
|
58
|
+
end
|
56
59
|
end
|
57
60
|
end
|
58
61
|
end
|
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
|
@@ -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
|
@@ -130,7 +132,7 @@ files:
|
|
130
132
|
- lib/souls/gcloud/run.rb
|
131
133
|
- lib/souls/init.rb
|
132
134
|
- lib/souls/release.rb
|
133
|
-
- lib/souls/release/
|
135
|
+
- lib/souls/release/release.rb
|
134
136
|
- lib/souls/version.rb
|
135
137
|
- lib/souls/versions/.souls_api_version
|
136
138
|
- lib/souls/versions/.souls_worker_version
|