souls 0.67.2 → 0.68.2

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: 1956a56e9601478d0f86f691eccc63a237b277fc76d45ef56dfff8ab653c4ae0
4
- data.tar.gz: 959596982f1747584447e1a3b7edc352a176eaece0f36732c85808606f1d3931
3
+ metadata.gz: 420bd82f0189ae76a1ff615426954b652d4459d913ba302d96e4be139df4cac0
4
+ data.tar.gz: 94d6355a219f279444b7de60585b9e95cfae580dcc378d9091f91248c75b2b5f
5
5
  SHA512:
6
- metadata.gz: 7c1e2b2cf82a1c1375c68285cd96a9f405d36a0db4716adea0ce501cdd4c04afe6e1e5742276ba2199c94f292b7b72a418a5920344bea20fc027aaee7c4ade1f
7
- data.tar.gz: bbb3eb9c5d6e1a8f41e168d39249ba60ef14aba6b326941527a59fa0b5164cea8023495ddac87fd3fefb5e49c0499327fe15e435d5e5be7b4107248aedabca14
6
+ metadata.gz: 516c7692c53c20a8a11d2aa1acc3524482b72a54022073cedb1ccc15e4a052be488fd0a6e42ebf60edc6b4002438067f193fdcc57579e11c8d418fdd9e46dc28
7
+ data.tar.gz: e9db926ca043aa388f5202a426e412a0c0cbf6d573f0eb9344a04f356cf47540fe21a577a572108eb417eae59f486e4ee9a808a76b672c07f6f06bb52741e2b6
@@ -11,13 +11,11 @@ module Souls
11
11
  file_path = "#{file_dir}#{singularized_class_name}.rbs"
12
12
  File.open(file_path, "w") do |f|
13
13
  f.write(<<~TEXT)
14
- module Types
15
- module Mutations
16
- String: String
17
- class #{singularized_class_name.camelize} < BaseMutation
18
- def self.description: (String) -> untyped
19
- def self.field: (:response, String, null: false) -> untyped
20
- end
14
+ module Mutations
15
+ String: String
16
+ class #{singularized_class_name.camelize} < BaseMutation
17
+ def self.description: (String) -> untyped
18
+ def self.field: (:response, String, null: false) -> untyped
21
19
  end
22
20
  end
23
21
  TEXT
@@ -28,7 +28,7 @@ module Souls
28
28
 
29
29
  it "return StockSheet Data" do
30
30
  begin
31
- a1 = result.dig("data", "#{singularized_class_name.camelize(:lower)}", "response")
31
+ a1 = result.dig("data", "#{singularized_class_name.camelize(:lower)}")
32
32
  raise unless a1.present?
33
33
  rescue StandardError
34
34
  raise(StandardError, result)
@@ -12,9 +12,8 @@ module Souls
12
12
  private
13
13
 
14
14
  def get_topics(workers: {})
15
- app_name = Souls.configuration.app
16
15
  project_id = Souls.configuration.project_id
17
- pubsub = Google::Cloud::Pubsub.new
16
+ pubsub = Google::Cloud::Pubsub.new(project_id: project_id)
18
17
  topics = pubsub.topics
19
18
 
20
19
  topic_names =
@@ -22,7 +21,7 @@ module Souls
22
21
  topic.name.gsub("projects/#{project_id}/topics/", "")
23
22
  end
24
23
 
25
- souls_topics = topic_names.select { |n| n.include?("souls_#{app_name}_") }
24
+ souls_topics = topic_names.select { |n| n.include?("souls_") }
26
25
 
27
26
  souls_topics.each do |name|
28
27
  value = workers[name.to_sym] || 0
@@ -40,17 +39,16 @@ module Souls
40
39
  end
41
40
 
42
41
  def create_topic(topic_id: "mailer")
43
- app_name = Souls.configuration.app
44
- pubsub = Google::Cloud::Pubsub.new
45
- topic_name = "souls_#{app_name}_#{topic_id}"
46
- topic = pubsub.create_topic(topic_name.to_s)
42
+ project_id = Souls.configuration.project_id
43
+ pubsub = Google::Cloud::Pubsub.new(project_id: project_id)
44
+ topic = pubsub.create_topic(topic_id.to_s)
47
45
  puts("Topic #{topic.name} created.")
48
46
  end
49
47
 
50
48
  def delete_topic(topic_id: "mailer")
51
- app_name = Souls.configuration.app
52
- pubsub = Google::Cloud::Pubsub.new
53
- topic_name = "souls_#{app_name}_#{topic_id}"
49
+ project_id = Souls.configuration.project_id
50
+ pubsub = Google::Cloud::Pubsub.new(project_id: project_id)
51
+ topic_name = "#{topic_id}_sub"
54
52
  topic = pubsub.topic(topic_name.to_s)
55
53
  topic.delete
56
54
  puts("Topic #{topic_name} deleted.")
@@ -58,20 +56,19 @@ module Souls
58
56
 
59
57
  def create_push_subscription(topic_id: "mailer")
60
58
  require("#{Souls.get_mother_path}/config/souls")
61
- app_name = Souls.configuration.app
62
- topic_name = "souls_#{app_name}_#{topic_id}"
63
- worker_name = topic_id.split("_")[0]
59
+ worker_name = topic_id.split("_")[1]
64
60
 
65
- subscription_id = "#{topic_name}_sub"
61
+ subscription_id = "#{topic_id}_sub"
66
62
  endpoint = ""
67
63
  worker_paths = Souls.configuration.workers
68
64
  worker_paths.each do |worker|
69
65
  endpoint = worker[:endpoint] if worker[:name] == worker_name
70
66
  end
71
67
 
72
- pubsub = Google::Cloud::Pubsub.new
68
+ project_id = Souls.configuration.project_id
69
+ pubsub = Google::Cloud::Pubsub.new(project_id: project_id)
73
70
 
74
- topic = pubsub.topic(topic_name)
71
+ topic = pubsub.topic(topic_id)
75
72
  sub = topic.subscribe(subscription_id, endpoint: endpoint, deadline: 20)
76
73
  sub.expires_in = nil
77
74
  puts("Push subscription #{subscription_id} created.")
@@ -83,19 +80,13 @@ module Souls
83
80
  response = {}
84
81
  Dir.chdir(Souls.get_mother_path.to_s) do
85
82
  worker_paths.each do |worker|
86
- mailers =
87
- Dir["apps/#{worker}/app/graphql/mutations/mailers/*.rb"].map do |file|
88
- file.gsub("apps/#{worker}/app/graphql/mutations/mailers/", "").gsub(".rb", "")
89
- end
90
-
91
83
  workers =
92
84
  Dir["apps/#{worker}/app/graphql/mutations/*.rb"].map do |file|
93
85
  file.gsub("apps/#{worker}/app/graphql/mutations/", "").gsub(".rb", "")
94
86
  end
95
87
  workers.delete("base_mutation")
96
- local_files = mailers + workers
97
- local_files.each do |file|
98
- response[:"#{worker}_#{file}"] = 1
88
+ workers.each do |file|
89
+ response[:"souls_#{worker}_#{file}"] = 1
99
90
  end
100
91
  end
101
92
  end
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.67.2".freeze
2
+ VERSION = "0.68.2".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.46.2
1
+ 0.47.2
@@ -1 +1 @@
1
- 0.46.2
1
+ 0.47.2
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: 0.67.2
4
+ version: 0.68.2
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-10-01 00:00:00.000000000 Z
13
+ date: 2021-10-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
@@ -207,7 +207,7 @@ metadata:
207
207
  homepage_uri: https://souls.elsoul.nl
208
208
  source_code_uri: https://github.com/elsoul/souls
209
209
  changelog_uri: https://github.com/elsoul/souls
210
- post_install_message:
210
+ post_install_message:
211
211
  rdoc_options: []
212
212
  require_paths:
213
213
  - lib
@@ -223,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
223
223
  version: '0'
224
224
  requirements: []
225
225
  rubygems_version: 3.2.22
226
- signing_key:
226
+ signing_key:
227
227
  specification_version: 4
228
228
  summary: Welcome to SOULs Serverless Application Framework! - Focus on business logic
229
229
  in serverless environment - Maximize development efficiency with CI / CD standard