souls 1.7.8 → 1.7.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c2d229e30e6416ce9fb8954ff90cb9f6f51f7d09f7316cb0f3a2158d3a548e43
4
- data.tar.gz: 87b2590e75d483cac9feb70c37c71d780daf396d33ef77aa9d2e0dd12931138d
3
+ metadata.gz: e561e4f0d34242b5c9038a1891be6e8afdfac703895e9f877e188f3de285d83c
4
+ data.tar.gz: 8efaf89f3c7c17f14e18e6d5d5e617d536a935a1642b60c630acfa1bea0caf75
5
5
  SHA512:
6
- metadata.gz: 26774d18e02bf56ffa9e2364f50a435b6ff9cc84c91dac61c34b5ba32a2b5f1d06e81ef7161f1896fbd669c59018a03504a7d197b19eb8dbb60a7471518ad672
7
- data.tar.gz: 0ab3516b13ce8e6184bc2e636ce9ba8a4acda15d5dbb438aa2ebb0c6ce0b4e93e642b975d4d1dc3825c4277cf8b8f23bc5e90dd6109ff0be1497edbd2b01c365
6
+ metadata.gz: cd18288e94e51ad2264cb67bda1fab5904d9e1fb45a9c60e763e243564dabe6378560d9ec7c0e0f0ae2d3a7b5844c66cf24cd68f34cf72f951a63a4e0174523d
7
+ data.tar.gz: 87c3514e482f00d977031778778ee61557be85142b2eae12b52ee3e6ecfd8a443f34bc8c7a0f0717a3760d52246767113d1d003d5597809348d7ecd10a46e6a2
@@ -10,7 +10,6 @@ module Souls
10
10
  create_job_type(class_name)
11
11
  create_job(class_name)
12
12
  end
13
- update_query_type(class_name)
14
13
  Souls::Generate.new.invoke(:job_rbs, [class_name], {})
15
14
  Souls::Generate.new.invoke(:rspec_job, [class_name], { mailer: options[:mailer] })
16
15
  rescue Thor::Error => e
@@ -31,7 +30,7 @@ module Souls
31
30
  class #{class_name.camelize} < BaseQuery
32
31
  description ""
33
32
  type Types::#{class_name.camelize}Type, null: false
34
-
33
+
35
34
  def resolve
36
35
  end
37
36
  end
@@ -41,7 +40,7 @@ module Souls
41
40
  puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
42
41
  file_path
43
42
  end
44
-
43
+
45
44
  def create_job_type(class_name)
46
45
  file_dir = "./app/graphql/types/"
47
46
  FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
@@ -52,6 +51,7 @@ module Souls
52
51
  f.write(<<~TEXT)
53
52
  module Types
54
53
  class #{class_name.camelize}Type < BaseObject
54
+ field :response, String, null: true
55
55
  end
56
56
  end
57
57
  TEXT
@@ -72,11 +72,11 @@ module Souls
72
72
  class #{class_name.camelize} < BaseQuery
73
73
  description ""
74
74
  type Types::#{class_name.camelize}Type, null: false
75
-
75
+
76
76
  def resolve
77
77
  # First, instantiate the Mailgun Client with your API key
78
78
  mg_client = ::Mailgun::Client.new("YOUR-API-KEY")
79
-
79
+
80
80
  # Define your message parameters
81
81
  message_params = {
82
82
  from: "postmaster@from.mail.com",
@@ -84,7 +84,7 @@ module Souls
84
84
  subject: "SOULs Mailer test!",
85
85
  text: "It is really easy to send a message!"
86
86
  }
87
-
87
+
88
88
  # Send your message through the client
89
89
  mg_client.send_message("YOUR-MAILGUN-DOMAIN", message_params)
90
90
  { response: "Job done!" }
@@ -117,25 +117,5 @@ module Souls
117
117
  puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
118
118
  file_path
119
119
  end
120
-
121
- def update_query_type(class_name)
122
- file_dir = "./app/graphql/types/base/"
123
- FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
124
- file_path = "#{file_dir}query_type.rb"
125
- raise(StandardError, "Query type doesn't exist, please re-create it") unless File.exist?(file_path)
126
-
127
- lines = File.readlines(file_path)
128
- unless lines[-1].strip == "end" and lines[-2].strip == "end"
129
- puts(Paint % ["Base query file has changed significantly and cannot be modified automatically, please update routes manually"], :yellow)
130
- return
131
- end
132
-
133
- insert_string = " field :#{class_name.singularize}, resolver: Queries::#{class_name.camelize}\n"
134
- lines.insert(-3, insert_string)
135
- File.open(file_path, "w") { |f| f.write(lines.join) }
136
-
137
- puts(Paint % ["Updated file : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
138
- file_path
139
- end
140
120
  end
141
121
  end
@@ -9,18 +9,30 @@ module Souls
9
9
  file_dir = "./sig/#{worker_name}/app/graphql/queries/"
10
10
  FileUtils.mkdir_p(file_dir) unless Dir.exist?(file_dir)
11
11
  file_path = "#{file_dir}#{singularized_class_name}.rbs"
12
+ type_file_path = "./sig/#{worker_name}/app/graphql/types/#{singularized_class_name}_type.rbs"
12
13
  File.open(file_path, "w") do |f|
13
14
  f.write(<<~TEXT)
14
- module Mutations
15
+ module Queries
15
16
  String: String
16
- class #{singularized_class_name.camelize} < BaseMutation
17
+ class #{singularized_class_name.camelize} < BaseQuery
17
18
  def self.description: (String) -> untyped
18
19
  def self.field: (:response, String, null: false) -> untyped
20
+ def self.type: (untyped, null: false) -> untyped
21
+ end
22
+ end
23
+ TEXT
24
+ end
25
+ File.open(type_file_path, "w") do |f|
26
+ f.write(<<~TEXT)
27
+ module Types
28
+ class #{singularized_class_name.camelize}Type < BaseObject
29
+ def self.field: (:response, String, null: true) -> untyped
19
30
  end
20
31
  end
21
32
  TEXT
22
33
  end
23
34
  puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [file_path.to_s, :white] }])
35
+ puts(Paint % ["Created file! : %{white_text}", :green, { white_text: [type_file_path.to_s, :white] }])
24
36
  end
25
37
  file_path
26
38
  rescue Thor::Error => e
@@ -1,5 +1,9 @@
1
1
  module Souls
2
2
  class Sync < Thor
3
+ # rubocop:disable Style/StringHashKeys
4
+ map "models" => :model
5
+ # rubocop:enable Style/StringHashKeys
6
+
3
7
  desc "model", "Sync Model, DB, Factory Files with API"
4
8
  def model
5
9
  cp_dir = %w[db app/models spec/factories]
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "1.7.8".freeze
2
+ VERSION = "1.7.9".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 1.7.8
1
+ 1.7.9
@@ -1 +1 @@
1
- 1.7.8
1
+ 1.7.9
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: souls
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.8
4
+ version: 1.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI
8
8
  - KishiTheMechanic
9
9
  - James Neve
10
- autorequire:
10
+ autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2021-11-12 00:00:00.000000000 Z
13
+ date: 2021-11-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -226,8 +226,8 @@ licenses:
226
226
  metadata:
227
227
  homepage_uri: https://souls.elsoul.nl
228
228
  source_code_uri: https://github.com/elsoul/souls
229
- changelog_uri: https://github.com/elsoul/souls/releases/tag/v1.7.8
230
- post_install_message:
229
+ changelog_uri: https://github.com/elsoul/souls/releases/tag/v1.7.9
230
+ post_install_message:
231
231
  rdoc_options: []
232
232
  require_paths:
233
233
  - lib
@@ -243,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
243
243
  version: '0'
244
244
  requirements: []
245
245
  rubygems_version: 3.2.22
246
- signing_key:
246
+ signing_key:
247
247
  specification_version: 4
248
248
  summary: Build Serverless Apps faster like Rails. Powered by Ruby GraphQL, RBS/Steep,
249
249
  Active Record, RSpec, RuboCop, and Google Cloud.