souls 0.29.2 → 0.29.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 676dd947f68cd5f0fc4d8971a560308151010d39fcb71bd07d2f7c5bb5d9410f
|
4
|
+
data.tar.gz: c1216a0b9cbf4a35722728164caa4cdf4a11b7ea4749a5de290cea66cb0ecb65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 271aaf367d445863910ed8973cfb7cbcb8fcad5fa05d64ce985b67d2042dcf333c4aa2c600a7de0ce299fdc660bc37c5036444e8512c19fdfd8e61ced4a1903e
|
7
|
+
data.tar.gz: c47be0a5c8489bc71155bb46b15ded04aa5ef761298edd1c72ed6b401dbd0c7336df2939debdf37f61d7c91c016e505fae5ffc611f210912f952c3e681c95273
|
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
|
data/lib/souls/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.3
|
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.3
|
@@ -15,7 +15,7 @@ module Souls
|
|
15
15
|
def mailgun_mailer(class_name: "mailer")
|
16
16
|
file_dir = "./app/graphql/mutations/mailers/"
|
17
17
|
FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
|
18
|
-
file_path = "#{file_dir}#{class_name.singularize}.rb"
|
18
|
+
file_path = "#{file_dir}#{class_name.singularize}_mailer.rb"
|
19
19
|
raise(StandardError, "Mailer already exist! #{file_path}") if File.exist?(file_path)
|
20
20
|
|
21
21
|
File.open(file_path, "w") do |f|
|
@@ -28,7 +28,7 @@ module Souls
|
|
28
28
|
|
29
29
|
def resolve
|
30
30
|
# First, instantiate the Mailgun Client with your API key
|
31
|
-
mg_client = Mailgun::Client.new("YOUR-API-KEY")
|
31
|
+
mg_client = ::Mailgun::Client.new("YOUR-API-KEY")
|
32
32
|
|
33
33
|
# Define your message parameters
|
34
34
|
message_params = {
|
@@ -39,7 +39,7 @@ module Souls
|
|
39
39
|
}
|
40
40
|
|
41
41
|
# Send your message through the client
|
42
|
-
mg_client.send_message("YOUR-
|
42
|
+
mg_client.send_message("YOUR-MAILGUN-DOMAIN", message_params)
|
43
43
|
{ response: "Job done!" }
|
44
44
|
rescue StandardError => e
|
45
45
|
GraphQL::ExecutionError.new(e.to_s)
|
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.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- POPPIN-FUMI
|
@@ -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
|