smashing 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of smashing might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d232211b439dd32a8ca38bb023b03b2d48c207216232087d6bc7ebcb5ae2e383
4
- data.tar.gz: a11191dc9666d2254036fbc60dadd6af326e0b274923d1a6bb6b1da7f4f6141d
3
+ metadata.gz: 721d40877762d848822b6bc0de8dfa8597074035af92afc3bea7d4aca9fc4bdc
4
+ data.tar.gz: 579de5e911ffeb05986481ed0e41b676856b43fa78e639e1d2b661082c983c9f
5
5
  SHA512:
6
- metadata.gz: 20b3336aae2a0cfc667c97baf45505841c84902df96ff573b3b9998de13a6802d4e7cc53af8c3d33ca75370a00782e154b5788ae0ca95d4cbf4776a1b67accaa
7
- data.tar.gz: 9d71a1d1de096f4d49e7e8d990d883181858a9390519ca20845e20b194d1405fd639201685bc23580033420e0dc98949291ee861a22e13d197bc0555a4cdac47
6
+ metadata.gz: a338ddf3e7e4fc0c6b630d9e1b710cbfdac91deb711a8a738e5bda229e79310669a035407f0fb5ebe5395e7ee2eec7de9b1dbb41a7204bd91d321644ac1dd3ea
7
+ data.tar.gz: f08c1b7bdd36c315e88acee22512c5c2066ed2c55a375726631f7053e35f7ab416b2723691a1e043afcc4a55f32d00684b46730f48814637cf0bbd553c1450a9
@@ -121,11 +121,16 @@ Dashing.AnimatedValue =
121
121
  Dashing.widgets = widgets = {}
122
122
  Dashing.lastEvents = lastEvents = {}
123
123
  Dashing.debugMode = false
124
+ Dashing.filterEvents = true
124
125
 
125
126
  Dashing.on 'run', ->
126
127
  @layout.on 'ready', -> # run only when all widgets are created
127
128
  ids = Object.keys(Dashing.widgets)
128
- source = new EventSource('events?ids=' + encodeURIComponent(ids.join(',')))
129
+ url = if Dashing.filterEvents
130
+ 'events?ids=' + encodeURIComponent(ids.join(','))
131
+ else
132
+ 'events'
133
+ source = new EventSource(url)
129
134
  source.addEventListener 'open', (e) ->
130
135
  console.log("Connection opened", e)
131
136
 
data/lib/dashing/app.rb CHANGED
@@ -77,11 +77,11 @@ end
77
77
  get '/events', :provides => 'text/event-stream' do
78
78
  protected!
79
79
  response.headers['X-Accel-Buffering'] = 'no' # Disable buffering for nginx
80
- ids = params[:ids].to_s.split(',').to_set
80
+ ids = params[:ids] ? params[:ids].split(',').to_set : nil
81
81
  stream :keep_open do |out|
82
82
  settings.connections[out] = ids
83
83
  settings.history.each do |id, event|
84
- out << event if ids.include?(id)
84
+ out << event if ids.nil? || ids.include?(id)
85
85
  end
86
86
  out.callback { settings.connections.delete(out) }
87
87
  end
@@ -149,7 +149,7 @@ def send_event(id, body, target=nil)
149
149
  Sinatra::Application.settings.history[id] = event unless target == 'dashboards'
150
150
  Sinatra::Application.settings.connections.each { |out, ids|
151
151
  begin
152
- out << event if target == 'dashboards' || ids.include?(id)
152
+ out << event if target == 'dashboards' || ids.nil? || ids.include?(id)
153
153
  rescue IOError => e # if the socket is closed an IOError is thrown
154
154
  Sinatra::Application.settings.connections.delete(out)
155
155
  end
@@ -1,3 +1,3 @@
1
1
  module Dashing
2
- VERSION = "1.3.3".freeze
2
+ VERSION = "1.3.4".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smashing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Beauchamp