dashing-rails 2.5.0 → 2.6.0

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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +2 -0
  3. data/CHANGELOG.md +5 -0
  4. data/Gemfile +1 -3
  5. data/Gemfile.lock +105 -109
  6. data/app/controllers/dashing/application_controller.rb +2 -2
  7. data/app/controllers/dashing/dashboards_controller.rb +1 -1
  8. data/app/controllers/dashing/widgets_controller.rb +3 -3
  9. data/lib/assets/javascripts/dashing.gridster.coffee +4 -22
  10. data/lib/dashing/configuration.rb +1 -5
  11. data/lib/dashing/version.rb +1 -1
  12. data/spec/controllers/dashing/application_controller_spec.rb +11 -6
  13. data/spec/controllers/dashing/dashboards_controller_spec.rb +1 -3
  14. data/spec/controllers/dashing/events_controller_spec.rb +1 -3
  15. data/spec/controllers/dashing/widgets_controller_spec.rb +1 -3
  16. data/spec/dummy/config/environments/test.rb +2 -2
  17. data/spec/lib/dashing/configuration_spec.rb +1 -30
  18. data/spec/lib/dashing_spec.rb +1 -3
  19. data/spec/lib/generators/widget_generator_spec.rb +1 -2
  20. data/spec/rails_helper.rb +61 -0
  21. data/spec/spec_helper.rb +82 -37
  22. data/spec/support/controller_spec_helpers.rb +2 -2
  23. data/vendor/assets/fonts/dashing/FontAwesome.otf +0 -0
  24. data/vendor/assets/fonts/dashing/fontawesome-webfont.eot +0 -0
  25. data/vendor/assets/fonts/dashing/fontawesome-webfont.svg +210 -41
  26. data/vendor/assets/fonts/dashing/fontawesome-webfont.ttf +0 -0
  27. data/vendor/assets/fonts/dashing/fontawesome-webfont.woff +0 -0
  28. data/vendor/assets/fonts/dashing/fontawesome-webfont.woff2 +0 -0
  29. data/vendor/assets/javascripts/dashing/default_widgets/number.coffee +0 -1
  30. data/vendor/assets/javascripts/dashing/jquery.gridster.js +4451 -3185
  31. data/vendor/assets/stylesheets/dashing/font-awesome.scss +808 -60
  32. data/vendor/assets/stylesheets/dashing/jquery.gridster.css +73 -85
  33. metadata +7 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 04f337d7ba9d83c8e94f400f9eb0143b94146586
4
- data.tar.gz: 02c7e52a179c50554814b5a6f41ddc8d570bae19
3
+ metadata.gz: 0c4f2ac2b83de93b59cde2a8a721ff3c1da134ff
4
+ data.tar.gz: f5fcc3a0285c077218d15c4142e4389649b65ddf
5
5
  SHA512:
6
- metadata.gz: 32e4edd027476b3563bdcaef09f4ef23f5e8b077e0ef397e9e7f441b04c338a9116d241e0b6d308dc4bc71ec1309ff0756f4188420edead6be7890aefb5c5cd5
7
- data.tar.gz: ce57e8508175d92aa27e0d342b855ace973bb46a048a1a6dc3177971d1b1c2b61358221cfbe3fd32a4ad24c0b6fcaaafe2b764325c59b4f37613b286249d521d
6
+ metadata.gz: 88dc2c0fd8d2763013d8055edc89801283a0bbfb9ab8a694f026d253a49f077db7afb46cfe7bbfbb2ad1e95029928c6a728005f3369d199da5289dfe7930ae5b
7
+ data.tar.gz: 393ec5fc545d3a31a3feb0b84444847abe82ee9605af6cac7f0482b93e53882d2d5c10b049e9b794121e1cbc458946c2e8adcd08fb26c284ae65d6e6052f2792
data/.rspec CHANGED
@@ -1 +1,3 @@
1
1
  --color
2
+ --require spec_helper
3
+ --require rails_helper
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 2.6.0
2
+
3
+ * Upgrade assets based on [Dashing](https://github.com/Shopify/dashing) repo
4
+ * Upgrade gems
5
+
1
6
  ## 2.5.0
2
7
 
3
8
  * Saves last event on redis to be sent on first connection (@scambra)
data/Gemfile CHANGED
@@ -12,8 +12,6 @@ gemspec
12
12
 
13
13
  group :test, :development do
14
14
  gem 'sqlite3'
15
- gem 'rspec-rails', '~> 2.14'
16
- gem 'simplecov', require: false
17
- gem 'coveralls', require: false
15
+ gem 'rspec-rails', '~> 3.5'
18
16
  gem 'generator_spec', require: false
19
17
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dashing-rails (2.5.0)
4
+ dashing-rails (2.6.0)
5
5
  coffee-script (>= 2.0)
6
6
  connection_pool (~> 2.2)
7
7
  jquery-rails (>= 3.0)
@@ -12,156 +12,151 @@ PATH
12
12
  GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
- actionmailer (4.2.3)
16
- actionpack (= 4.2.3)
17
- actionview (= 4.2.3)
18
- activejob (= 4.2.3)
15
+ actioncable (5.0.1)
16
+ actionpack (= 5.0.1)
17
+ nio4r (~> 1.2)
18
+ websocket-driver (~> 0.6.1)
19
+ actionmailer (5.0.1)
20
+ actionpack (= 5.0.1)
21
+ actionview (= 5.0.1)
22
+ activejob (= 5.0.1)
19
23
  mail (~> 2.5, >= 2.5.4)
20
- rails-dom-testing (~> 1.0, >= 1.0.5)
21
- actionpack (4.2.3)
22
- actionview (= 4.2.3)
23
- activesupport (= 4.2.3)
24
- rack (~> 1.6)
25
- rack-test (~> 0.6.2)
26
- rails-dom-testing (~> 1.0, >= 1.0.5)
24
+ rails-dom-testing (~> 2.0)
25
+ actionpack (5.0.1)
26
+ actionview (= 5.0.1)
27
+ activesupport (= 5.0.1)
28
+ rack (~> 2.0)
29
+ rack-test (~> 0.6.3)
30
+ rails-dom-testing (~> 2.0)
27
31
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
28
- actionview (4.2.3)
29
- activesupport (= 4.2.3)
32
+ actionview (5.0.1)
33
+ activesupport (= 5.0.1)
30
34
  builder (~> 3.1)
31
35
  erubis (~> 2.7.0)
32
- rails-dom-testing (~> 1.0, >= 1.0.5)
36
+ rails-dom-testing (~> 2.0)
33
37
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
34
- activejob (4.2.3)
35
- activesupport (= 4.2.3)
36
- globalid (>= 0.3.0)
37
- activemodel (4.2.3)
38
- activesupport (= 4.2.3)
39
- builder (~> 3.1)
40
- activerecord (4.2.3)
41
- activemodel (= 4.2.3)
42
- activesupport (= 4.2.3)
43
- arel (~> 6.0)
44
- activesupport (4.2.3)
38
+ activejob (5.0.1)
39
+ activesupport (= 5.0.1)
40
+ globalid (>= 0.3.6)
41
+ activemodel (5.0.1)
42
+ activesupport (= 5.0.1)
43
+ activerecord (5.0.1)
44
+ activemodel (= 5.0.1)
45
+ activesupport (= 5.0.1)
46
+ arel (~> 7.0)
47
+ activesupport (5.0.1)
48
+ concurrent-ruby (~> 1.0, >= 1.0.2)
45
49
  i18n (~> 0.7)
46
- json (~> 1.7, >= 1.7.7)
47
50
  minitest (~> 5.1)
48
- thread_safe (~> 0.3, >= 0.3.4)
49
51
  tzinfo (~> 1.1)
50
- arel (6.0.3)
51
- better_errors (1.1.0)
52
+ arel (7.1.4)
53
+ better_errors (2.1.1)
52
54
  coderay (>= 1.0.0)
53
55
  erubis (>= 2.6.6)
54
- builder (3.2.2)
55
- coderay (1.1.0)
56
+ rack (>= 0.9.0)
57
+ builder (3.2.3)
58
+ coderay (1.1.1)
56
59
  coffee-script (2.4.1)
57
60
  coffee-script-source
58
61
  execjs
59
- coffee-script-source (1.10.0)
60
- concurrent-ruby (1.0.1)
61
- connection_pool (2.2.0)
62
- coveralls (0.7.0)
63
- multi_json (~> 1.3)
64
- rest-client
65
- simplecov (>= 0.7)
66
- term-ansicolor
67
- thor
62
+ coffee-script-source (1.12.2)
63
+ concurrent-ruby (1.0.4)
64
+ connection_pool (2.2.1)
68
65
  diff-lcs (1.2.5)
69
- docile (1.1.3)
70
66
  erubis (2.7.0)
71
- execjs (2.6.0)
72
- generator_spec (0.9.2)
67
+ execjs (2.7.0)
68
+ generator_spec (0.9.3)
73
69
  activesupport (>= 3.0.0)
74
70
  railties (>= 3.0.0)
75
- globalid (0.3.6)
71
+ globalid (0.3.7)
76
72
  activesupport (>= 4.1.0)
77
73
  i18n (0.7.0)
78
- jquery-rails (4.1.1)
74
+ jquery-rails (4.2.2)
79
75
  rails-dom-testing (>= 1, < 3)
80
76
  railties (>= 4.2.0)
81
77
  thor (>= 0.14, < 2.0)
82
- json (1.8.3)
83
- loofah (2.0.2)
78
+ loofah (2.0.3)
84
79
  nokogiri (>= 1.5.9)
85
80
  mail (2.6.4)
86
81
  mime-types (>= 1.16, < 4)
87
82
  method_source (0.8.2)
88
- mime-types (2.6.1)
89
- mini_portile (0.6.2)
90
- minitest (5.7.0)
91
- multi_json (1.11.0)
92
- nokogiri (1.6.6.2)
93
- mini_portile (~> 0.6.0)
94
- pry (0.9.12.6)
95
- coderay (~> 1.0)
96
- method_source (~> 0.8)
83
+ mime-types (3.1)
84
+ mime-types-data (~> 3.2015)
85
+ mime-types-data (3.2016.0521)
86
+ mini_portile2 (2.1.0)
87
+ minitest (5.10.1)
88
+ nio4r (1.2.1)
89
+ nokogiri (1.7.0.1)
90
+ mini_portile2 (~> 2.1.0)
91
+ pry (0.10.4)
92
+ coderay (~> 1.1.0)
93
+ method_source (~> 0.8.1)
97
94
  slop (~> 3.4)
98
- pry-rails (0.3.2)
95
+ pry-rails (0.3.4)
99
96
  pry (>= 0.9.10)
100
- rack (1.6.4)
97
+ rack (2.0.1)
101
98
  rack-test (0.6.3)
102
99
  rack (>= 1.0)
103
- rails (4.2.3)
104
- actionmailer (= 4.2.3)
105
- actionpack (= 4.2.3)
106
- actionview (= 4.2.3)
107
- activejob (= 4.2.3)
108
- activemodel (= 4.2.3)
109
- activerecord (= 4.2.3)
110
- activesupport (= 4.2.3)
100
+ rails (5.0.1)
101
+ actioncable (= 5.0.1)
102
+ actionmailer (= 5.0.1)
103
+ actionpack (= 5.0.1)
104
+ actionview (= 5.0.1)
105
+ activejob (= 5.0.1)
106
+ activemodel (= 5.0.1)
107
+ activerecord (= 5.0.1)
108
+ activesupport (= 5.0.1)
111
109
  bundler (>= 1.3.0, < 2.0)
112
- railties (= 4.2.3)
113
- sprockets-rails
114
- rails-deprecated_sanitizer (1.0.3)
115
- activesupport (>= 4.2.0.alpha)
116
- rails-dom-testing (1.0.6)
117
- activesupport (>= 4.2.0.beta, < 5.0)
118
- nokogiri (~> 1.6.0)
119
- rails-deprecated_sanitizer (>= 1.0.1)
120
- rails-html-sanitizer (1.0.2)
110
+ railties (= 5.0.1)
111
+ sprockets-rails (>= 2.0.0)
112
+ rails-dom-testing (2.0.2)
113
+ activesupport (>= 4.2.0, < 6.0)
114
+ nokogiri (~> 1.6)
115
+ rails-html-sanitizer (1.0.3)
121
116
  loofah (~> 2.0)
122
- railties (4.2.3)
123
- actionpack (= 4.2.3)
124
- activesupport (= 4.2.3)
117
+ railties (5.0.1)
118
+ actionpack (= 5.0.1)
119
+ activesupport (= 5.0.1)
120
+ method_source
125
121
  rake (>= 0.8.7)
126
122
  thor (>= 0.18.1, < 2.0)
127
- rake (10.4.2)
128
- redis (3.2.2)
129
- rest-client (1.6.7)
130
- mime-types (>= 1.16)
131
- rspec-core (2.14.8)
132
- rspec-expectations (2.14.5)
133
- diff-lcs (>= 1.1.3, < 2.0)
134
- rspec-mocks (2.14.6)
135
- rspec-rails (2.14.2)
123
+ rake (12.0.0)
124
+ redis (3.3.2)
125
+ rspec-core (3.5.4)
126
+ rspec-support (~> 3.5.0)
127
+ rspec-expectations (3.5.0)
128
+ diff-lcs (>= 1.2.0, < 2.0)
129
+ rspec-support (~> 3.5.0)
130
+ rspec-mocks (3.5.0)
131
+ diff-lcs (>= 1.2.0, < 2.0)
132
+ rspec-support (~> 3.5.0)
133
+ rspec-rails (3.5.2)
136
134
  actionpack (>= 3.0)
137
- activemodel (>= 3.0)
138
135
  activesupport (>= 3.0)
139
136
  railties (>= 3.0)
140
- rspec-core (~> 2.14.0)
141
- rspec-expectations (~> 2.14.0)
142
- rspec-mocks (~> 2.14.0)
143
- rufus-scheduler (3.2.0)
144
- simplecov (0.8.2)
145
- docile (~> 1.1.0)
146
- multi_json
147
- simplecov-html (~> 0.8.0)
148
- simplecov-html (0.8.0)
149
- slop (3.5.0)
150
- sprockets (3.5.2)
137
+ rspec-core (~> 3.5.0)
138
+ rspec-expectations (~> 3.5.0)
139
+ rspec-mocks (~> 3.5.0)
140
+ rspec-support (~> 3.5.0)
141
+ rspec-support (3.5.0)
142
+ rufus-scheduler (3.3.2)
143
+ tzinfo
144
+ slop (3.6.0)
145
+ sprockets (3.7.1)
151
146
  concurrent-ruby (~> 1.0)
152
147
  rack (> 1, < 3)
153
- sprockets-rails (3.0.4)
148
+ sprockets-rails (3.2.0)
154
149
  actionpack (>= 4.0)
155
150
  activesupport (>= 4.0)
156
151
  sprockets (>= 3.0.0)
157
- sqlite3 (1.3.11)
158
- term-ansicolor (1.3.0)
159
- tins (~> 1.0)
160
- thor (0.19.1)
152
+ sqlite3 (1.3.13)
153
+ thor (0.19.4)
161
154
  thread_safe (0.3.5)
162
- tins (1.3.0)
163
155
  tzinfo (1.2.2)
164
156
  thread_safe (~> 0.1)
157
+ websocket-driver (0.6.4)
158
+ websocket-extensions (>= 0.1.0)
159
+ websocket-extensions (0.1.2)
165
160
 
166
161
  PLATFORMS
167
162
  ruby
@@ -169,10 +164,11 @@ PLATFORMS
169
164
  DEPENDENCIES
170
165
  better_errors
171
166
  bundler (>= 1.8)
172
- coveralls
173
167
  dashing-rails!
174
168
  generator_spec
175
169
  pry-rails
176
- rspec-rails (~> 2.14)
177
- simplecov
170
+ rspec-rails (~> 3.5)
178
171
  sqlite3
172
+
173
+ BUNDLED WITH
174
+ 1.11.2
@@ -1,13 +1,13 @@
1
1
  module Dashing
2
2
  class ApplicationController < ActionController::Base
3
3
 
4
- before_filter :authentication_with_devise
4
+ before_action :authentication_with_devise
5
5
 
6
6
  private
7
7
 
8
8
  def authentication_with_devise
9
9
  Dashing.config.devise_allowed_models.each do |model|
10
- self.send("authenticate_#{model.to_s}!")
10
+ send("authenticate_#{model.to_s}!")
11
11
  end
12
12
  end
13
13
 
@@ -1,7 +1,7 @@
1
1
  module Dashing
2
2
  class DashboardsController < ApplicationController
3
3
 
4
- before_filter :check_dashboard_name, only: :show
4
+ before_action :check_dashboard_name, only: :show
5
5
 
6
6
  rescue_from ActionView::MissingTemplate, with: :template_not_found
7
7
 
@@ -1,9 +1,9 @@
1
1
  module Dashing
2
2
  class WidgetsController < ApplicationController
3
3
 
4
- before_filter :check_accessibility, only: :update
5
- before_filter :check_widget_name, only: [:show, :update]
6
- before_filter :prepend_view_paths, only: :show
4
+ before_action :check_accessibility, only: :update
5
+ before_action :check_widget_name, only: [:show, :update]
6
+ before_action :prepend_view_paths, only: :show
7
7
 
8
8
  rescue_from ActionView::MissingTemplate, with: :template_not_found
9
9
 
@@ -6,26 +6,10 @@ Dashing.gridsterLayout = (positions) ->
6
6
  Dashing.customGridsterLayout = true
7
7
  positions = positions.replace(/^"|"$/g, '')
8
8
  positions = $.parseJSON(positions)
9
- widgets = $("[data-row]")
10
- maxRow = 1
11
- maxCol = 1
12
- numColumns = Dashing.numColumns || 1
9
+ widgets = $("[data-row^=]")
13
10
  for widget, index in widgets
14
- if positions? and index < positions.length
15
- $(widget).attr('data-row', positions[index].row)
16
- $(widget).attr('data-col', positions[index].col)
17
- if positions[index].row > maxRow
18
- maxRow = positions[index].row
19
- maxCol = positions[index].col + 1
20
- else if positions[index].row == maxRow and positions[index].col >= maxCol
21
- maxCol = positions[index].col + 1
22
- else
23
- if maxCol > numColumns
24
- maxRow += 1
25
- maxCol = 1
26
- $(widget).attr('data-row', maxRow)
27
- $(widget).attr('data-col', maxCol)
28
- maxCol += 1
11
+ $(widget).attr('data-row', positions[index].row)
12
+ $(widget).attr('data-col', positions[index].col)
29
13
 
30
14
  Dashing.getWidgetPositions = ->
31
15
  $(".gridster ul:first").gridster().data('gridster').serialize()
@@ -40,9 +24,7 @@ Dashing.showGridsterInstructions = ->
40
24
  <script type='text/javascript'>\n
41
25
  $(function() {\n
42
26
  \ \ Dashing.gridsterLayout('#{JSON.stringify(Dashing.currentWidgetPositions)}')\n
43
- });\n
44
- </script>
45
- ")
27
+ });\n</script>")
46
28
 
47
29
  $ ->
48
30
  $('#save-gridster').leanModal()
@@ -53,11 +53,7 @@ module Dashing
53
53
  private
54
54
 
55
55
  def request_thread_count
56
- if defined?(::Puma) && ::Puma.respond_to?(:cli_config)
57
- ::Puma.cli_config.options.fetch(:max_threads, 5).to_i
58
- else
59
- 5
60
- end
56
+ Integer(ENV['RAILS_MAX_THREADS'] || 5)
61
57
  end
62
58
  end
63
59
  end
@@ -1,3 +1,3 @@
1
1
  module Dashing
2
- VERSION = '2.5.0'
2
+ VERSION = '2.6.0'
3
3
  end
@@ -1,18 +1,23 @@
1
- require 'spec_helper'
2
-
3
- describe Dashing::ApplicationController do
1
+ RSpec.describe Dashing::ApplicationController do
4
2
 
5
3
  describe '#authentication_with_devise' do
6
4
 
7
5
  let(:models) { [:user, :admin] }
6
+ let!(:devise_instances) do
7
+ module DeviseInstances
8
+ def authenticate_user!; end
9
+ def authenticate_admin!; end
10
+ end
11
+ end
8
12
 
9
13
  before do
10
- Dashing.stub_chain(:config, :devise_allowed_models).and_return(models)
14
+ controller.extend(DeviseInstances)
15
+ allow(Dashing).to receive_message_chain(:config, :devise_allowed_models).and_return(models)
11
16
  end
12
17
 
13
18
  it 'calls devise authenticate method' do
14
- expect(controller).to receive("authenticate_#{models.first.to_s}!")
15
- expect(controller).to receive("authenticate_#{models.last.to_s}!")
19
+ expect(controller).to receive("authenticate_user!")
20
+ expect(controller).to receive("authenticate_admin!")
16
21
  controller.send(:authentication_with_devise)
17
22
  end
18
23