pubsubstub 0.0.14 → 0.0.15

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: e4106e5ee0478ce5a148b49fc03d444f77ccb539
4
- data.tar.gz: 2683f674608bcf93cb6838afb8b877a811db663f
3
+ metadata.gz: e14d40f41e5f06347d7f552009f53d29bb3d4942
4
+ data.tar.gz: e1fca82791cb2f1769aa8bf3a6076736b70f8e4c
5
5
  SHA512:
6
- metadata.gz: 30f6b41e4fb7d60ab31668ef88ff62d136d94d21a9c12be1d918b9bd8765153e2b51603c870764d3cbf030136c961772a643addc3ae0fadf60db927a837bfa89
7
- data.tar.gz: ab0a8ced2ccb64356c70a56503c10d12b44a8a29d87db44429694432c5301a120d83b8eca8555b3604d8e6d2a2b9e0e8fad17c3edce70e1e33e9304aec81f175
6
+ metadata.gz: dad828aea534513d6acef76af10e057e8ad21f8804c1fccc9102ce1c1db8149dedd5e74f9730d4a4d64a67b1815fdc05b70149e2f9f561b90582cd9ac1c3fc7d
7
+ data.tar.gz: a9afa981566c4320fd578e99dbb843e537e2e1f10d668ab735929ec96dcc34a9a99eb0bad3c013594a378f544c130cb8ffbfce6700b42270005e5a03218d79e6
@@ -1,11 +1,5 @@
1
1
  module Pubsubstub
2
- class << self
3
- attr_accessor :heartbeat_frequency
4
- end
5
- self.heartbeat_frequency = 15
6
-
7
2
  class Application < Sinatra::Base
8
-
9
3
  use PublishAction
10
4
  use StreamAction
11
5
  end
@@ -66,7 +66,7 @@ module Pubsubstub
66
66
  end
67
67
 
68
68
  def redis_url
69
- ENV['REDIS_URL'] || "redis://localhost:6379"
69
+ Pubsubstub.redis_url || ENV['REDIS_URL'] || "redis://localhost:6379/0"
70
70
  end
71
71
  end
72
72
  end
@@ -1,3 +1,3 @@
1
1
  module Pubsubstub
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
data/lib/pubsubstub.rb CHANGED
@@ -11,3 +11,10 @@ require "pubsubstub/stream_action"
11
11
  require "pubsubstub/publish_action"
12
12
  require "pubsubstub/application"
13
13
 
14
+ module Pubsubstub
15
+ class << self
16
+ attr_accessor :heartbeat_frequency, :redis_url
17
+ end
18
+ self.heartbeat_frequency = 15
19
+ end
20
+
@@ -34,6 +34,21 @@ describe Pubsubstub::RedisPubSub do
34
34
  expect(subject.blocking_redis.zcard("test.scrollback")).to eq(count - 1)
35
35
  end
36
36
  end
37
+
38
+ describe "#redis_url" do
39
+ it "uses the fallback url fallback chain" do
40
+ Pubsubstub.redis_url = "redis://localhost:6379/1"
41
+ expect(Pubsubstub::RedisPubSub.redis_url).to eq("redis://localhost:6379/1")
42
+
43
+ Pubsubstub.redis_url = nil
44
+ ENV['REDIS_URL'] = "redis://localhost:6379/2"
45
+ expect(Pubsubstub::RedisPubSub.redis_url).to eq("redis://localhost:6379/2")
46
+
47
+ Pubsubstub::RedisPubSub.instance_variable_set(:@blocking_redis, nil)
48
+ ENV['REDIS_URL'] = nil
49
+ expect(Pubsubstub::RedisPubSub.redis_url).to eq("redis://localhost:6379/0")
50
+ end
51
+ end
37
52
  end
38
53
 
39
54
  context "pubsub" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pubsubstub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guillaume Malette
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-05 00:00:00.000000000 Z
11
+ date: 2015-09-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
230
230
  version: '0'
231
231
  requirements: []
232
232
  rubyforge_project:
233
- rubygems_version: 2.2.3
233
+ rubygems_version: 2.4.8
234
234
  signing_key:
235
235
  specification_version: 4
236
236
  summary: Pubsubstub is a rack middleware to add Pub/Sub