cloudenvoy 0.3.1 → 0.4.0

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: b8bd773adfe87f0e49c1670e33ecca0654fbfad1fa2e7ce45ae2cb820c1c7012
4
- data.tar.gz: fc401a6aa31f68b9138bc52c77b66b9707d6d21d7e19cd6aaae11cbecb1a75e5
3
+ metadata.gz: b9322dedfad594507282b8a475531a48ed6c9cae16bb098e115a8a71c9c88485
4
+ data.tar.gz: b44299bb873d6a07028eca918826702c63d75460a7fa7986251792dc5fae81ac
5
5
  SHA512:
6
- metadata.gz: 07d4494017e73cf4cb14c3d822d22c0b595ed8a669c4fe967cf1d9a29411a078a9fdc70d9507e70ac52a4b4801e3bce31295db008bd8b613f71efc70198d7200
7
- data.tar.gz: dadea963a4ff4a566585d8f4462f6625de9064254c2781a0d62fbc6c3d3819c49fa67cce9917a59970b575ffc091b3b39478229859ced3b65a4a8e7f8d00b184
6
+ metadata.gz: 512419c58e7eaf81cb9e6de2496cfffd72469a1e4fa5c6b07939645f2ab3b2af5e419b155cae026f5e13910fad762cdc1cdec44b282ed93ef9ac79eb77b8475b
7
+ data.tar.gz: 9f9852d9afbba64c20a855c55e6e08f196bcc6f1a5f72f379e0839a118e638a7c96b98f7c2de227835c8b38c4cf9d4abbb19b29421cb58e85ad9637086d8db2a
@@ -1,12 +1,19 @@
1
1
  # Changelog
2
2
 
3
- ## [v0.3.1](https://github.com/keypup-io/cloudenvoy/tree/v0.3.1) (2020-10-05)
3
+ ## [v0.4.0](https://github.com/keypup-io/cloudenvoy/tree/v0.4.0) (2020-10-05)
4
4
 
5
- [Full Changelog](https://github.com/keypup-io/cloudenvoy/compare/v0.3.0...v0.3.1)
5
+ [Full Changelog](https://github.com/keypup-io/cloudenvoy/compare/v0.3.1...v0.4.0)
6
6
 
7
7
  **Bug fix:**
8
8
  - Logging: fix log processing with `semantic_logger` `v4.7.2`. Accept any args on block passed to the logger.
9
9
 
10
+ ## [v0.3.1](https://github.com/keypup-io/cloudenvoy/tree/v0.3.1) (2020-10-05)
11
+
12
+ [Full Changelog](https://github.com/keypup-io/cloudenvoy/compare/v0.3.0...v0.3.1)
13
+
14
+ **Improvements:**
15
+ - Development: auto-create topics in development mode when registering subscriptions.
16
+
10
17
  ## [v0.3.0](https://github.com/keypup-io/cloudenvoy/tree/v0.3.0) (2020-09-26)
11
18
 
12
19
  [Full Changelog](https://github.com/keypup-io/cloudenvoy/compare/v0.2.0...v0.3.0)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cloudenvoy (0.3.1)
4
+ cloudenvoy (0.4.0)
5
5
  activesupport
6
6
  google-cloud-pubsub (~> 2.0)
7
7
  jwt
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- cloudenvoy (0.3.1)
4
+ cloudenvoy (0.4.0)
5
5
  activesupport
6
6
  google-cloud-pubsub (~> 2.0)
7
7
  jwt
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- cloudenvoy (0.3.1)
4
+ cloudenvoy (0.4.0)
5
5
  activesupport
6
6
  google-cloud-pubsub (~> 2.0)
7
7
  jwt
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- cloudenvoy (0.3.1)
4
+ cloudenvoy (0.4.0)
5
5
  activesupport
6
6
  google-cloud-pubsub (~> 2.0)
7
7
  jwt
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- cloudenvoy (0.3.1)
4
+ cloudenvoy (0.4.0)
5
5
  activesupport
6
6
  google-cloud-pubsub (~> 2.0)
7
7
  jwt
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- cloudenvoy (0.3.1)
4
+ cloudenvoy (0.4.0)
5
5
  activesupport
6
6
  google-cloud-pubsub (~> 2.0)
7
7
  jwt
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- cloudenvoy (0.3.1)
4
+ cloudenvoy (0.4.0)
5
5
  activesupport
6
6
  google-cloud-pubsub (~> 2.0)
7
7
  jwt
@@ -17,6 +17,15 @@ module Cloudenvoy
17
17
  Cloudenvoy.config
18
18
  end
19
19
 
20
+ #
21
+ # Return true if the current config mode is development.
22
+ #
23
+ # @return [Boolean] True if Cloudenvoy is run in development mode.
24
+ #
25
+ def development?
26
+ config.mode == :development
27
+ end
28
+
20
29
  #
21
30
  # Return the backend to use for sending messages.
22
31
  #
@@ -25,7 +34,7 @@ module Cloudenvoy
25
34
  def backend
26
35
  @backend ||= Google::Cloud::PubSub.new({
27
36
  project_id: config.gcp_project_id,
28
- emulator_host: config.mode == :development ? Cloudenvoy::Config::EMULATOR_HOST : nil
37
+ emulator_host: development? ? Cloudenvoy::Config::EMULATOR_HOST : nil
29
38
  }.compact)
30
39
  end
31
40
 
@@ -88,6 +97,12 @@ module Cloudenvoy
88
97
  def upsert_subscription(topic, name, opts = {})
89
98
  sub_config = opts.to_h.merge(endpoint: webhook_url)
90
99
 
100
+ # Auto-create topic in development. In non-development environments
101
+ # the create subscription action raises an error if the topic does
102
+ # not exist
103
+ upsert_topic(topic) if development?
104
+
105
+ # Create subscription
91
106
  ps_sub =
92
107
  begin
93
108
  # Retrieve the topic
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Cloudenvoy
4
- VERSION = '0.3.1'
4
+ VERSION = '0.4.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudenvoy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arnaud Lachaume