souls 0.53.4 → 0.53.5

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: 564e0bedd2c3f6d26daad5f9bc4307051b042ce2867e16fe0667372e70b3b432
4
- data.tar.gz: 5a4fef479822068f0e49405c7b5b974adfe9c68845681454e6ec0a2d1aa35904
3
+ metadata.gz: e35280f32390cf55c390b73dbb3e344ab8de636460e5464e1b0ebe5a7830f562
4
+ data.tar.gz: 3a429067cc9388575fd606ba7d056d6072d1c9c0d63a8231c628c25855c80310
5
5
  SHA512:
6
- metadata.gz: 467f58902722373ee1ee48af87a1b59383d4f71117c64a9242118b487aca907384fc5d8c9c5128f358852c6d29090de7274eb8719e7780e0e5d150e91d976920
7
- data.tar.gz: 23b9061872e797e8e6803848e21dc30a29919519f4b929776aee8d87ae95e7b41cde8aa5a0fade7f8723a571cbb7d09ea934f172ced208f830c3d3af943f9a65
6
+ metadata.gz: 11eb6b2e3683f6dcdcf45312bbb8ead4ab569e5a999a51c54ca74d94f07c6e5fe1b5527eac12c8286b71b34533e01b5bf307b68b49c7821ebed53a7aa545a8ab
7
+ data.tar.gz: 58bbefc266178a10f8ee51bcc4f2b6ab203ad2dc6cd4fd84c169b9dd19e75178e64be2f1e0c6b00a5843184b08811685033d8c7e1a492bd4dfb8027e97418940
@@ -8,6 +8,6 @@ module Souls
8
8
  desc "update [COMMAND]", "souls api update Commands"
9
9
  subcommand "update", Update
10
10
 
11
- map "g" => :generate
11
+ map g: :generate
12
12
  end
13
13
  end
@@ -12,6 +12,7 @@ module Souls
12
12
  private
13
13
 
14
14
  def get_topics(workers: {})
15
+ app_name = Souls.configuration.app
15
16
  project_id = Souls.configuration.project_id
16
17
  pubsub = Google::Cloud::Pubsub.new
17
18
  topics = pubsub.topics
@@ -21,6 +22,8 @@ module Souls
21
22
  topic.name.gsub("projects/#{project_id}/topics/", "")
22
23
  end
23
24
 
25
+ topic_names.select { |n| n.include?("#{app_name}_souls_") }
26
+
24
27
  topic_names.each do |name|
25
28
  value = workers[name.to_sym] || 0
26
29
  workers[name.to_sym] = value - 1
@@ -37,23 +40,29 @@ module Souls
37
40
  end
38
41
 
39
42
  def create_topic(topic_id: "mailer")
43
+ app_name = Souls.configuration.app
40
44
  pubsub = Google::Cloud::Pubsub.new
41
- topic = pubsub.create_topic(topic_id)
45
+ topic_name = "#{app_name}_souls_#{topic_id}"
46
+ topic = pubsub.create_topic(topic_name.to_s)
42
47
  puts("Topic #{topic.name} created.")
43
48
  end
44
49
 
45
50
  def delete_topic(topic_id: "mailer")
51
+ app_name = Souls.configuration.app
46
52
  pubsub = Google::Cloud::Pubsub.new
47
- topic = pubsub.topic(topic_id)
53
+ topic_name = "#{app_name}_souls_#{topic_id}"
54
+ topic = pubsub.topic(topic_name.to_s)
48
55
  topic.delete
49
- puts("Topic #{topic_id} deleted.")
56
+ puts("Topic #{topic_name} deleted.")
50
57
  end
51
58
 
52
59
  def create_push_subscription(topic_id: "mailer")
53
60
  require("#{Souls.get_mother_path}/config/souls")
54
61
  worker_name = topic_id.split("_")[0]
62
+ app_name = Souls.configuration.app
63
+ topic_name = "#{app_name}_souls_#{topic_id}"
55
64
 
56
- subscription_id = "#{topic_id}_sub"
65
+ subscription_id = "#{topic_name}_sub"
57
66
  endpoint = ""
58
67
  worker_paths = Souls.configuration.workers
59
68
  worker_paths.each do |worker|
data/lib/souls/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Souls
2
- VERSION = "0.53.4".freeze
2
+ VERSION = "0.53.5".freeze
3
3
  public_constant :VERSION
4
4
  end
@@ -1 +1 @@
1
- 0.32.4
1
+ 0.32.5
@@ -1 +1 @@
1
- 0.32.4
1
+ 0.32.5
@@ -5,6 +5,6 @@ module Souls
5
5
  desc "generate [COMMAND]", "souls worker generate Commands"
6
6
  subcommand "generate", Generate
7
7
 
8
- map "g" => :generate
8
+ map g: :generate
9
9
  end
10
10
  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.53.4
4
+ version: 0.53.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - POPPIN-FUMI