dashing-rails 2.4.1 → 2.4.2

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: 8ce6e2cd46ff8f40f2f30dbafafa37ca1f2edc78
4
- data.tar.gz: fe0b9bacd1d469d3b93c75d954276aed098ba9e7
3
+ metadata.gz: 2661d20ae32a6b777115b87bbc26728ee7a25706
4
+ data.tar.gz: 97882dbe34d2eeb3a528b625c278f5d28b7670a7
5
5
  SHA512:
6
- metadata.gz: fa6f88787044305580c92ba337e1b2ebae3d27227c36ea832468e2b8b55a69dec3c244f0c34cf90c871638a8ce3989bb67424e2efc2bfa57ca743dd3cb9c21b9
7
- data.tar.gz: 5533d93a76b01520d0b4a3744e55027be9c7310d003c69745ad0a92a58d0c889247bbc96e520ce9c93ae398748a9cd70ec594df41407e708946872906d8b3a0b
6
+ metadata.gz: e7e68029ad43f664e400b78ef263f3b3f00c52cae146baa306a9ca0d30cba5e75cea1939d09548ee424bc5134e65f51b3a8d7f6d6d128ec540cc8ec34240e76a
7
+ data.tar.gz: 2d5d061026e1d57ff21421ae46254c47e72dc682f62801a53d4c4d64fab1d7c78c8dbb6c5c7f5cd9d2c256eb1622bcd1bb80da89c4aa7fc365c742149017d2b1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 2.4.2
2
+
3
+ * Update dashing js src file from dashing sinatra version
4
+ * Update dashing css src file from dashing sinatra version
5
+ * Update gem dependencies
6
+ * Fix rails lock versioning to allow `>= 4.0`
7
+ * Remove `respond_to` reference in events controller
8
+
1
9
  ## 2.4.1
2
10
 
3
11
  * Update graph widget coffee code
data/Gemfile CHANGED
@@ -11,12 +11,3 @@ gemspec
11
11
  # your gem to rubygems.org.
12
12
 
13
13
  gem 'sqlite3'
14
- gem 'jquery-rails', '~> 3.0'
15
-
16
- group :test do
17
- gem 'coveralls', require: false
18
- gem 'simplecov', require: false
19
- gem 'rspec-rails', '~> 2.14'
20
- gem 'pry-rails', '~> 0.3'
21
- gem 'generator_spec'
22
- end
data/Gemfile.lock CHANGED
@@ -1,45 +1,54 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dashing-rails (2.4.1)
4
+ dashing-rails (2.4.2)
5
5
  batman-rails (~> 0.16.1)
6
6
  coffee-script (~> 2.2)
7
- connection_pool (~> 2.0)
7
+ connection_pool (~> 2.1)
8
8
  jquery-rails (~> 3.1)
9
- rails (~> 4.1)
10
- redis (~> 3.1)
9
+ rails (>= 4.0)
10
+ redis (~> 3.2)
11
11
  rufus-scheduler (~> 3.0)
12
12
 
13
13
  GEM
14
14
  remote: https://rubygems.org/
15
15
  specs:
16
- actionmailer (4.1.1)
17
- actionpack (= 4.1.1)
18
- actionview (= 4.1.1)
19
- mail (~> 2.5.4)
20
- actionpack (4.1.1)
21
- actionview (= 4.1.1)
22
- activesupport (= 4.1.1)
23
- rack (~> 1.5.2)
16
+ actionmailer (4.2.0)
17
+ actionpack (= 4.2.0)
18
+ actionview (= 4.2.0)
19
+ activejob (= 4.2.0)
20
+ mail (~> 2.5, >= 2.5.4)
21
+ rails-dom-testing (~> 1.0, >= 1.0.5)
22
+ actionpack (4.2.0)
23
+ actionview (= 4.2.0)
24
+ activesupport (= 4.2.0)
25
+ rack (~> 1.6.0)
24
26
  rack-test (~> 0.6.2)
25
- actionview (4.1.1)
26
- activesupport (= 4.1.1)
27
+ rails-dom-testing (~> 1.0, >= 1.0.5)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
29
+ actionview (4.2.0)
30
+ activesupport (= 4.2.0)
27
31
  builder (~> 3.1)
28
32
  erubis (~> 2.7.0)
29
- activemodel (4.1.1)
30
- activesupport (= 4.1.1)
33
+ rails-dom-testing (~> 1.0, >= 1.0.5)
34
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
35
+ activejob (4.2.0)
36
+ activesupport (= 4.2.0)
37
+ globalid (>= 0.3.0)
38
+ activemodel (4.2.0)
39
+ activesupport (= 4.2.0)
31
40
  builder (~> 3.1)
32
- activerecord (4.1.1)
33
- activemodel (= 4.1.1)
34
- activesupport (= 4.1.1)
35
- arel (~> 5.0.0)
36
- activesupport (4.1.1)
37
- i18n (~> 0.6, >= 0.6.9)
41
+ activerecord (4.2.0)
42
+ activemodel (= 4.2.0)
43
+ activesupport (= 4.2.0)
44
+ arel (~> 6.0)
45
+ activesupport (4.2.0)
46
+ i18n (~> 0.7)
38
47
  json (~> 1.7, >= 1.7.7)
39
48
  minitest (~> 5.1)
40
- thread_safe (~> 0.1)
49
+ thread_safe (~> 0.3, >= 0.3.4)
41
50
  tzinfo (~> 1.1)
42
- arel (5.0.1.20140414130214)
51
+ arel (6.0.0)
43
52
  batman-rails (0.16.1)
44
53
  railties (>= 3.2)
45
54
  better_errors (1.1.0)
@@ -65,45 +74,59 @@ GEM
65
74
  generator_spec (0.9.2)
66
75
  activesupport (>= 3.0.0)
67
76
  railties (>= 3.0.0)
77
+ globalid (0.3.3)
78
+ activesupport (>= 4.1.0)
68
79
  hike (1.2.3)
69
- i18n (0.6.9)
70
- jquery-rails (3.1.1)
80
+ i18n (0.7.0)
81
+ jquery-rails (3.1.2)
71
82
  railties (>= 3.0, < 5.0)
72
83
  thor (>= 0.14, < 2.0)
73
- json (1.8.1)
74
- mail (2.5.4)
75
- mime-types (~> 1.16)
76
- treetop (~> 1.4.8)
84
+ json (1.8.2)
85
+ loofah (2.0.1)
86
+ nokogiri (>= 1.5.9)
87
+ mail (2.6.3)
88
+ mime-types (>= 1.16, < 3)
77
89
  method_source (0.8.2)
78
- mime-types (1.25.1)
79
- minitest (5.3.5)
80
- multi_json (1.10.1)
81
- polyglot (0.3.5)
90
+ mime-types (2.4.3)
91
+ mini_portile (0.6.2)
92
+ minitest (5.5.1)
93
+ multi_json (1.11.0)
94
+ nokogiri (1.6.6.2)
95
+ mini_portile (~> 0.6.0)
82
96
  pry (0.9.12.6)
83
97
  coderay (~> 1.0)
84
98
  method_source (~> 0.8)
85
99
  slop (~> 3.4)
86
100
  pry-rails (0.3.2)
87
101
  pry (>= 0.9.10)
88
- rack (1.5.2)
89
- rack-test (0.6.2)
102
+ rack (1.6.0)
103
+ rack-test (0.6.3)
90
104
  rack (>= 1.0)
91
- rails (4.1.1)
92
- actionmailer (= 4.1.1)
93
- actionpack (= 4.1.1)
94
- actionview (= 4.1.1)
95
- activemodel (= 4.1.1)
96
- activerecord (= 4.1.1)
97
- activesupport (= 4.1.1)
105
+ rails (4.2.0)
106
+ actionmailer (= 4.2.0)
107
+ actionpack (= 4.2.0)
108
+ actionview (= 4.2.0)
109
+ activejob (= 4.2.0)
110
+ activemodel (= 4.2.0)
111
+ activerecord (= 4.2.0)
112
+ activesupport (= 4.2.0)
98
113
  bundler (>= 1.3.0, < 2.0)
99
- railties (= 4.1.1)
100
- sprockets-rails (~> 2.0)
101
- railties (4.1.1)
102
- actionpack (= 4.1.1)
103
- activesupport (= 4.1.1)
114
+ railties (= 4.2.0)
115
+ sprockets-rails
116
+ rails-deprecated_sanitizer (1.0.3)
117
+ activesupport (>= 4.2.0.alpha)
118
+ rails-dom-testing (1.0.5)
119
+ activesupport (>= 4.2.0.beta, < 5.0)
120
+ nokogiri (~> 1.6.0)
121
+ rails-deprecated_sanitizer (>= 1.0.1)
122
+ rails-html-sanitizer (1.0.2)
123
+ loofah (~> 2.0)
124
+ railties (4.2.0)
125
+ actionpack (= 4.2.0)
126
+ activesupport (= 4.2.0)
104
127
  rake (>= 0.8.7)
105
128
  thor (>= 0.18.1, < 2.0)
106
- rake (10.3.2)
129
+ rake (10.4.2)
107
130
  redis (3.2.1)
108
131
  rest-client (1.6.7)
109
132
  mime-types (>= 1.16)
@@ -140,25 +163,21 @@ GEM
140
163
  term-ansicolor (1.3.0)
141
164
  tins (~> 1.0)
142
165
  thor (0.19.1)
143
- thread_safe (0.3.4)
166
+ thread_safe (0.3.5)
144
167
  tilt (1.4.1)
145
168
  tins (1.3.0)
146
- treetop (1.4.15)
147
- polyglot
148
- polyglot (>= 0.3.1)
149
- tzinfo (1.2.1)
169
+ tzinfo (1.2.2)
150
170
  thread_safe (~> 0.1)
151
171
 
152
172
  PLATFORMS
153
173
  ruby
154
174
 
155
175
  DEPENDENCIES
156
- better_errors (~> 1.0)
176
+ better_errors
157
177
  coveralls
158
178
  dashing-rails!
159
179
  generator_spec
160
- jquery-rails (~> 3.0)
161
- pry-rails (~> 0.3)
180
+ pry-rails
162
181
  rspec-rails (~> 2.14)
163
182
  simplecov
164
183
  sqlite3
@@ -2,8 +2,6 @@ module Dashing
2
2
  class EventsController < ApplicationController
3
3
  include ActionController::Live
4
4
 
5
- respond_to :html
6
-
7
5
  def index
8
6
  response.headers['Content-Type'] = 'text/event-stream'
9
7
  response.headers['X-Accel-Buffering'] = 'no'
data/dashing.gemspec CHANGED
@@ -17,15 +17,18 @@ Gem::Specification.new do |spec|
17
17
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
18
  spec.require_paths = ["lib"]
19
19
 
20
- spec.add_dependency 'rails', '~> 4.1'
20
+ spec.add_dependency 'rails', '>= 4.0'
21
21
  spec.add_dependency 'jquery-rails', '~> 3.1'
22
22
  spec.add_dependency 'coffee-script', '~> 2.2'
23
23
  spec.add_dependency 'batman-rails', '~> 0.16.1'
24
24
  spec.add_dependency 'rufus-scheduler', '~> 3.0'
25
- spec.add_dependency 'redis', '~> 3.1'
26
- spec.add_dependency 'connection_pool', '~> 2.0'
25
+ spec.add_dependency 'redis', '~> 3.2'
26
+ spec.add_dependency 'connection_pool', '~> 2.1'
27
27
 
28
28
  spec.add_development_dependency 'rspec-rails', '~> 2.14'
29
- spec.add_development_dependency 'pry-rails', '~> 0.3'
30
- spec.add_development_dependency 'better_errors', '~> 1.0'
29
+ spec.add_development_dependency 'pry-rails'
30
+ spec.add_development_dependency 'better_errors'
31
+ spec.add_development_dependency 'coveralls'
32
+ spec.add_development_dependency 'simplecov'
33
+ spec.add_development_dependency 'generator_spec'
31
34
  end
@@ -1,3 +1,3 @@
1
1
  module Dashing
2
- VERSION = '2.4.1'
2
+ VERSION = '2.4.2'
3
3
  end
@@ -2,10 +2,14 @@ require 'spec_helper'
2
2
 
3
3
  describe Dashing::DashboardsController do
4
4
 
5
+ before do
6
+ @routes = Dashing::Engine.routes
7
+ end
8
+
5
9
  describe 'GET "index"' do
6
10
 
7
11
  def action
8
- get :index, use_route: :dashing
12
+ get :index
9
13
  end
10
14
 
11
15
  it 'responds success' do
@@ -18,7 +22,7 @@ describe Dashing::DashboardsController do
18
22
  describe 'GET "show"' do
19
23
 
20
24
  def action(params = {})
21
- get :show, params.merge(use_route: :dashing)
25
+ get :show, params
22
26
  end
23
27
 
24
28
  context 'when template exists' do
@@ -6,12 +6,13 @@ describe Dashing::WidgetsController do
6
6
 
7
7
  before do
8
8
  stub_redis(redis)
9
+ @routes = Dashing::Engine.routes
9
10
  end
10
11
 
11
12
  describe 'GET "show"' do
12
13
 
13
14
  def action(params = {})
14
- get :show, params.merge(use_route: :dashing)
15
+ get :show, params
15
16
  end
16
17
 
17
18
  context 'when default template exists' do
@@ -44,7 +45,7 @@ describe Dashing::WidgetsController do
44
45
  describe 'PUT "update"' do
45
46
 
46
47
  def action(params = {})
47
- put :update, params.merge(use_route: :dashing)
48
+ put :update, params
48
49
  end
49
50
 
50
51
  context 'when valid' do
@@ -20,7 +20,7 @@ Dummy::Application.configure do
20
20
  # config.action_dispatch.rack_cache = true
21
21
 
22
22
  # Disable Rails's static asset server (Apache or nginx will already do this).
23
- config.serve_static_assets = false
23
+ config.serve_static_files = false
24
24
 
25
25
  # Compress JavaScripts and CSS.
26
26
  config.assets.js_compressor = :uglifier
@@ -13,7 +13,7 @@ Dummy::Application.configure do
13
13
  config.eager_load = false
14
14
 
15
15
  # Configure static asset server for tests with Cache-Control for performance.
16
- config.serve_static_assets = true
16
+ config.serve_static_files = true
17
17
  config.static_cache_control = "public, max-age=3600"
18
18
 
19
19
  # Show full error reports and disable caching.
@@ -15,13 +15,13 @@ describe Dashing do
15
15
  let(:configuration) { Dashing::Configuration.new }
16
16
 
17
17
  before do
18
- Dashing.stub(:config).and_return(:configuration)
18
+ allow(Dashing).to receive(:config).and_return(:configuration)
19
19
  end
20
20
 
21
21
  context 'when block given' do
22
22
 
23
23
  it 'yields configuration' do
24
- Dashing.should_receive(:configure).and_yield(configuration)
24
+ expect(Dashing).to receive(:configure).and_yield(configuration)
25
25
  Dashing.configure {|config|}
26
26
  end
27
27
 
@@ -29,9 +29,7 @@ describe Dashing do
29
29
 
30
30
  context 'when no block given' do
31
31
 
32
- it 'does nothing' do
33
- Dashing.configure.should be_nil
34
- end
32
+ it { expect(Dashing.configure).to be_nil }
35
33
 
36
34
  end
37
35
 
@@ -43,7 +41,7 @@ describe Dashing do
43
41
  let(:dirs) { [dir] }
44
42
 
45
43
  before do
46
- Dir.stub(:[]).and_return(dirs)
44
+ allow(Dir).to receive(:[]).and_return(dirs)
47
45
  end
48
46
 
49
47
  it { expect(Dashing.first_dashboard).to eq(dir) }
@@ -22,30 +22,25 @@ Batman.Filters.shortenedNumber = (num) ->
22
22
  num
23
23
 
24
24
  class window.Dashing extends Batman.App
25
+ @on 'reload', (data) ->
26
+ window.location.reload(true)
27
+
25
28
  @root ->
26
29
  Dashing.params = Batman.URI.paramsFromQuery(window.location.search.slice(1));
27
30
 
28
31
  class Dashing.Widget extends Batman.View
29
- constructor: ->
32
+ constructor: ->
30
33
  # Set the view path
31
34
  @constructor::source = Batman.Filters.underscore(@constructor.name)
32
-
33
35
  super
34
36
 
35
- @observe 'node', (newValue, oldValue) ->
36
- if !oldValue && !@_registeredAtDashing
37
- @_registeredAtDashing = true
38
-
39
- @mixin($(@node).data())
40
- Dashing.widgets[@id] ||= []
41
- Dashing.widgets[@id].push(@)
37
+ @mixin($(@node).data())
38
+ Dashing.widgets[@id] ||= []
39
+ Dashing.widgets[@id].push(@)
40
+ @mixin(Dashing.lastEvents[@id]) # in case the events from the server came before the widget was rendered
42
41
 
43
- # in case the events from the server came
44
- # before the widget was rendered
45
- @mixin(Dashing.lastEvents[@id])
46
-
47
- type = Batman.Filters.dashize(@constructor.name)
48
- $(@node).addClass("widget widget-#{type} #{@id}")
42
+ type = Batman.Filters.dashize(@view)
43
+ $(@node).addClass("widget widget-#{type} #{@id}")
49
44
 
50
45
  @accessor 'updatedAtMessage', ->
51
46
  if updatedAt = @get('updatedAt')
@@ -104,18 +99,24 @@ source.addEventListener 'error', (e)->
104
99
  console.log("Connection closed")
105
100
  setTimeout (->
106
101
  window.location.reload()
107
- ), 5 * 60 * 1000
102
+ ), 5*60*1000
108
103
 
109
- source.addEventListener 'message', (e) =>
104
+ source.addEventListener 'message', (e) ->
110
105
  data = JSON.parse(e.data)
111
106
  if lastEvents[data.id]?.updatedAt != data.updatedAt
112
107
  if Dashing.debugMode
113
108
  console.log("Received data for #{data.id}", data)
114
- lastEvents[data.id] = data
115
109
  if widgets[data.id]?.length > 0
110
+ lastEvents[data.id] = data
116
111
  for widget in widgets[data.id]
117
112
  widget.receiveData(data)
118
113
 
114
+ source.addEventListener 'dashboards', (e) ->
115
+ data = JSON.parse(e.data)
116
+ if Dashing.debugMode
117
+ console.log("Received data for dashboards", data)
118
+ if data.dashboard is '*' or window.location.pathname is "/#{data.dashboard}"
119
+ Dashing.fire data.event, data
119
120
 
120
121
  $(document).ready ->
121
122
  Dashing.run()
@@ -113,6 +113,7 @@ h3 {
113
113
  }
114
114
 
115
115
  .icon-background {
116
+ pointer-events: none;
116
117
  width: 100%!important;
117
118
  height: 100%;
118
119
  position: absolute;
@@ -121,6 +122,7 @@ h3 {
121
122
  opacity: 0.1;
122
123
  font-size: 275px;
123
124
  text-align: center;
125
+ margin-top: 82px;
124
126
  }
125
127
 
126
128
  .list-nostyle {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dashing-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.1
4
+ version: 2.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre-Louis Gottfrois
@@ -14,16 +14,16 @@ dependencies:
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: '4.1'
19
+ version: '4.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: '4.1'
26
+ version: '4.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: jquery-rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -86,28 +86,28 @@ dependencies:
86
86
  requirements:
87
87
  - - ~>
88
88
  - !ruby/object:Gem::Version
89
- version: '3.1'
89
+ version: '3.2'
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ~>
95
95
  - !ruby/object:Gem::Version
96
- version: '3.1'
96
+ version: '3.2'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: connection_pool
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ~>
102
102
  - !ruby/object:Gem::Version
103
- version: '2.0'
103
+ version: '2.1'
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - ~>
109
109
  - !ruby/object:Gem::Version
110
- version: '2.0'
110
+ version: '2.1'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: rspec-rails
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -126,30 +126,72 @@ dependencies:
126
126
  name: pry-rails
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - '>='
130
130
  - !ruby/object:Gem::Version
131
- version: '0.3'
131
+ version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ~>
136
+ - - '>='
137
137
  - !ruby/object:Gem::Version
138
- version: '0.3'
138
+ version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: better_errors
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ~>
143
+ - - '>='
144
144
  - !ruby/object:Gem::Version
145
- version: '1.0'
145
+ version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ~>
150
+ - - '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: coveralls
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - '>='
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - '>='
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: simplecov
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - '>='
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - '>='
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
181
+ - !ruby/object:Gem::Dependency
182
+ name: generator_spec
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - '>='
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - '>='
151
193
  - !ruby/object:Gem::Version
152
- version: '1.0'
194
+ version: '0'
153
195
  description: The exceptionally handsome dashboard framework for Rails.
154
196
  email:
155
197
  - pierrelouis.gottfrois@gmail.com