rasti-web 0.2.0 → 0.2.1

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: 39d44ecda3273b692c0f8ffd3e10cc863a9de55b
4
- data.tar.gz: b0abe6f3e033b6490cd97410a2310e05e85ac683
3
+ metadata.gz: ec9566c3c8cf96790406973506e6d9322ec10bc2
4
+ data.tar.gz: 25e1535210a4212bb3733281376cfc7b2f3384ea
5
5
  SHA512:
6
- metadata.gz: b7784e46d19cea8a8962fcc4c4b261e098eca09a51b0e96aa52e1d027a547658dd5224fd64022987b5bc7f4ae9f801f3f2300442de38e47307a8c5abe07568f7
7
- data.tar.gz: 53b8cc43486cfea71985d15869d5a5eb62617fd9579e5134cc6793ffae88e0aab296999f3cd60fbcea0c9b9f9c688d1f89423fcb1646be5bc4cf91ba1181383b
6
+ metadata.gz: d0f0f7cdbc4ddc35f0a8638c9537507b13622e41fc792104d4e4275ac8a366b9460cddb8b50d892626bce440546411b3663e89af1b064a2e2143bd9821d7d383
7
+ data.tar.gz: 069d05769cb012f2b3f987f1317570a429951c9713eae3c1c37ad1b2928f00b357cf08c5df48680fc30f620190273470af33bfbde2f2fa918019c5f53637b72a
@@ -24,7 +24,7 @@ module Rasti
24
24
  end
25
25
 
26
26
  def self.[](id)
27
- @channels ||= Hash.new { |h,k| h[k] = self.new id }
27
+ @channels ||= Hash.new { |h,k| h[k] = self.new k }
28
28
  @channels[id]
29
29
  end
30
30
 
@@ -1,5 +1,5 @@
1
1
  module Rasti
2
2
  module Web
3
- VERSION = '0.2.0'
3
+ VERSION = '0.2.1'
4
4
  end
5
5
  end
@@ -7,7 +7,7 @@ describe 'Straming' do
7
7
  let(:render) { Rasti::Web::Render.new request, response }
8
8
 
9
9
  it 'Server sent events' do
10
- render.server_sent_events :test_channel
10
+ render.server_sent_events :channel_1
11
11
 
12
12
  response.status.must_equal 200
13
13
  response['Content-Type'].must_equal 'text/event-stream'
@@ -20,13 +20,15 @@ describe 'Straming' do
20
20
  response.body.each { |e| events << e }
21
21
  end
22
22
 
23
- channel = Rasti::Web::Channel[:test_channel]
23
+ channel_1 = Rasti::Web::Channel[:channel_1]
24
+ channel_2 = Rasti::Web::Channel[:channel_2]
24
25
  sleep 0.05 # Wait for establish connection
25
26
 
26
27
  3.times do |i|
27
28
  data = {text: "Tick #{i}"}
28
29
  event = Rasti::Web::ServerSentEvent.new data, id: i, event: 'tick'
29
- channel.publish event
30
+ channel_1.publish event
31
+ channel_2.publish event
30
32
  end
31
33
 
32
34
  Timeout.timeout(3) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rasti-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gabriel Naiman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-05 00:00:00.000000000 Z
11
+ date: 2016-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack