souls 0.29.2 → 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 +8 -3
- data/lib/souls.rb +31 -0
- data/lib/souls/api.rb +1 -0
- data/lib/souls/api/generate.rb +1 -0
- data/lib/souls/api/generate/application.rb +1 -0
- data/lib/souls/api/generate/manager.rb +26 -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 +9 -6
- metadata +6 -3
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
|
@@ -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
@@ -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
data/lib/souls/api/generate.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
module Souls
|
2
|
+
module Api::Generate
|
3
|
+
def self.manager(class_name: "souls")
|
4
|
+
singularized_class_name = class_name.underscore.singularize
|
5
|
+
file_dir = "./app/graphql/mutations/managers/#{singularized_class_name}_manager"
|
6
|
+
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
7
|
+
file_path = "#{file_dir}/#{singularized_class_name}.rb"
|
8
|
+
File.open(file_path, "w") do |f|
|
9
|
+
f.write(<<~TEXT)
|
10
|
+
class Types::#{singularized_class_name.camelize}Edge < module Mutations
|
11
|
+
module Mailers
|
12
|
+
class #{singularized_class_name.camelize}Mailer < BaseMutation
|
13
|
+
description "Mail を送信します。"
|
14
|
+
field :response, String, null: false
|
15
|
+
|
16
|
+
node_type(Types::#{singularized_class_name.camelize}Type)
|
17
|
+
end
|
18
|
+
TEXT
|
19
|
+
end
|
20
|
+
puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
|
21
|
+
file_path
|
22
|
+
rescue StandardError => e
|
23
|
+
raise(StandardError, e)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -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.6
|
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.6
|
@@ -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)
|
@@ -15,7 +16,7 @@ module Souls
|
|
15
16
|
def mailgun_mailer(class_name: "mailer")
|
16
17
|
file_dir = "./app/graphql/mutations/mailers/"
|
17
18
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
18
|
-
file_path = "#{file_dir}#{class_name.singularize}.rb"
|
19
|
+
file_path = "#{file_dir}#{class_name.singularize}_mailer.rb"
|
19
20
|
raise(StandardError, "Mailer already exist! #{file_path}") if File.exist?(file_path)
|
20
21
|
|
21
22
|
File.open(file_path, "w") do |f|
|
@@ -28,7 +29,7 @@ module Souls
|
|
28
29
|
|
29
30
|
def resolve
|
30
31
|
# First, instantiate the Mailgun Client with your API key
|
31
|
-
mg_client = Mailgun::Client.new("YOUR-API-KEY")
|
32
|
+
mg_client = ::Mailgun::Client.new("YOUR-API-KEY")
|
32
33
|
|
33
34
|
# Define your message parameters
|
34
35
|
message_params = {
|
@@ -39,7 +40,7 @@ module Souls
|
|
39
40
|
}
|
40
41
|
|
41
42
|
# Send your message through the client
|
42
|
-
mg_client.send_message("YOUR-
|
43
|
+
mg_client.send_message("YOUR-MAILGUN-DOMAIN", message_params)
|
43
44
|
{ response: "Job done!" }
|
44
45
|
rescue StandardError => e
|
45
46
|
GraphQL::ExecutionError.new(e.to_s)
|
@@ -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.6
|
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-16 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -106,6 +106,7 @@ files:
|
|
106
106
|
- lib/souls/api/generate/application.rb
|
107
107
|
- lib/souls/api/generate/connection.rb
|
108
108
|
- lib/souls/api/generate/edge.rb
|
109
|
+
- lib/souls/api/generate/manager.rb
|
109
110
|
- lib/souls/api/generate/migration.rb
|
110
111
|
- lib/souls/api/generate/model.rb
|
111
112
|
- lib/souls/api/generate/mutation.rb
|
@@ -119,6 +120,8 @@ files:
|
|
119
120
|
- lib/souls/api/generate/rspec_query.rb
|
120
121
|
- lib/souls/api/generate/rspec_resolver.rb
|
121
122
|
- lib/souls/api/generate/type.rb
|
123
|
+
- lib/souls/api/update.rb
|
124
|
+
- lib/souls/api/update/update_mutation.rb
|
122
125
|
- lib/souls/docker.rb
|
123
126
|
- lib/souls/docker/docker.rb
|
124
127
|
- lib/souls/gcloud.rb
|
@@ -129,7 +132,7 @@ files:
|
|
129
132
|
- lib/souls/gcloud/run.rb
|
130
133
|
- lib/souls/init.rb
|
131
134
|
- lib/souls/release.rb
|
132
|
-
- lib/souls/release/
|
135
|
+
- lib/souls/release/release.rb
|
133
136
|
- lib/souls/version.rb
|
134
137
|
- lib/souls/versions/.souls_api_version
|
135
138
|
- lib/souls/versions/.souls_worker_version
|