subserver 0.2.2 → 0.3.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
  SHA1:
3
- metadata.gz: 4295d899353208c83176c64e8357e6d6d1618a55
4
- data.tar.gz: 95e1bb5f162351711be555a2ab70ee5c7a7b7bb2
3
+ metadata.gz: f5671f24e7a384c645c69871b72a24027ec5503e
4
+ data.tar.gz: 84e9374f0036d7f63a6724e489333c834e02f51f
5
5
  SHA512:
6
- metadata.gz: 3ca18b4e225c79fd7b2f0d490697af02678bbe2ca0ae4efe081655d2f6144c442b9fbd760ff2b0756e738d52076b6af97ee0a7d50a9eeafeffe6080533449a30
7
- data.tar.gz: bfd2a798802e7810e1e82c188493224398e7109524a8d8decac574c7e12811b5fa6cf45378d4c0cfe48a6c83fa9046e625f35644f8f8edcf0c785cd3f62befcb
6
+ metadata.gz: 59dac2b3c668911f97a69e9ca722b6a9c38238d520d1d83e3679b41ba4f82f76ad98eb232fd8a831152a71b34d142dce06ec90e03741d1feb1481dfd45518878
7
+ data.tar.gz: 8fccb6d65bd86d58d10eaab277e7afe8cc3ae852c3d276bbc5883f2f9d63e570b0e903880c909270cce524ac93dd9f173bd485b90c9da6aa5c211c5536edcb8f
@@ -6,6 +6,10 @@ module Subserver
6
6
  defined?(@client) ? @client : initialize_client
7
7
  end
8
8
 
9
+ def self.client=(client)
10
+ @client = client
11
+ end
12
+
9
13
  def self.initialize_client
10
14
  @client = Google::Cloud::Pubsub.new(
11
15
  project_id: options[:project_id] || ENV['PUBSUB_PROJECT_ID'],
@@ -17,4 +21,5 @@ module Subserver
17
21
  Subserver.options
18
22
  end
19
23
  end
20
- end
24
+ end
25
+
@@ -0,0 +1,11 @@
1
+ require 'subserver/testing/pubsub'
2
+
3
+ module Subserver
4
+ module Testing
5
+
6
+ def self.fake!
7
+ Subserver::Pubsub.client = Subserver::Testing::Pubsub.new
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,17 @@
1
+ module Subserver
2
+ module Testing
3
+ class Pubsub
4
+
5
+ class Topic
6
+ def publish(data)
7
+ true
8
+ end
9
+ end
10
+
11
+ def topic(name)
12
+ Topic.new
13
+ end
14
+
15
+ end
16
+ end
17
+ end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Subserver
3
- VERSION = "0.2.2"
3
+ VERSION = "0.3.0"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: subserver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Hill
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-19 00:00:00.000000000 Z
11
+ date: 2018-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: google-cloud-pubsub
@@ -57,6 +57,8 @@ files:
57
57
  - lib/subserver/pubsub.rb
58
58
  - lib/subserver/rails.rb
59
59
  - lib/subserver/subscriber.rb
60
+ - lib/subserver/testing.rb
61
+ - lib/subserver/testing/pubsub.rb
60
62
  - lib/subserver/util.rb
61
63
  - lib/subserver/version.rb
62
64
  homepage: https://github.com/lifechurch/subserver/