smashing 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of smashing might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/javascripts/dashing.coffee +6 -1
- data/lib/dashing/app.rb +3 -3
- data/lib/dashing/version.rb +1 -1
- metadata +1 -1
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA256:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 721d40877762d848822b6bc0de8dfa8597074035af92afc3bea7d4aca9fc4bdc
         | 
| 4 | 
            +
              data.tar.gz: 579de5e911ffeb05986481ed0e41b676856b43fa78e639e1d2b661082c983c9f
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: a338ddf3e7e4fc0c6b630d9e1b710cbfdac91deb711a8a738e5bda229e79310669a035407f0fb5ebe5395e7ee2eec7de9b1dbb41a7204bd91d321644ac1dd3ea
         | 
| 7 | 
            +
              data.tar.gz: f08c1b7bdd36c315e88acee22512c5c2066ed2c55a375726631f7053e35f7ab416b2723691a1e043afcc4a55f32d00684b46730f48814637cf0bbd553c1450a9
         | 
    
        data/javascripts/dashing.coffee
    CHANGED
    
    | @@ -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 | 
            -
                 | 
| 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]. | 
| 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
         | 
    
        data/lib/dashing/version.rb
    CHANGED