dashing-rails 2.4.0 → 2.4.1

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.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZjU5M2MwMTMxNDA5ODVmOWZhYzY5OTQyYzNhZTA5ZmRiZjAyNDNkNA==
5
- data.tar.gz: !binary |-
6
- M2Y3YTljNTgxYTQ0YWFlNTI3YTQ3NzYyODQ3NTQ5ZmYzYzU1OWJjNA==
2
+ SHA1:
3
+ metadata.gz: 8ce6e2cd46ff8f40f2f30dbafafa37ca1f2edc78
4
+ data.tar.gz: fe0b9bacd1d469d3b93c75d954276aed098ba9e7
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- ZjExNzRmNTcxOTFiMjRkN2YyZjI4ZTAwMTc2NzRmODQzZmQxNmZmYWY3NTY3
10
- NzE4ZDJmNTM1ZTQ0MjE0ZGNhYTBhZTMxMmJjMWE3NjA4NDk5NzZiOTFmMjk0
11
- OWNkNjNhNzJhYTRkNmM4Yjg1ZWU2NWViZDU4OTcxMGFkYTNmZmM=
12
- data.tar.gz: !binary |-
13
- MzhmNjVjMTkwN2MwYmRiN2M5NjVmM2ZkMzM4YjU0ZmE3NGY2NjhiMjAzZjlj
14
- OWFmYzFlYTMwYzI2MDlkZTUwMjgxMmMyMjRkNjcyZmZhYzNlZThkOTg1ZDFi
15
- N2RjOWE2MWM5ZDFlMjFkMmQ0MWU5NWRmYzRkNDA2OWZmYTEyYWY=
6
+ metadata.gz: fa6f88787044305580c92ba337e1b2ebae3d27227c36ea832468e2b8b55a69dec3c244f0c34cf90c871638a8ce3989bb67424e2efc2bfa57ca743dd3cb9c21b9
7
+ data.tar.gz: 5533d93a76b01520d0b4a3744e55027be9c7310d003c69745ad0a92a58d0c889247bbc96e520ce9c93ae398748a9cd70ec594df41407e708946872906d8b3a0b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 2.4.1
2
+
3
+ * Update graph widget coffee code
4
+
1
5
  ## 2.4.0
2
6
 
3
7
  * Update Batman.js using `batman-rails` gem
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dashing-rails (2.4.0)
4
+ dashing-rails (2.4.1)
5
5
  batman-rails (~> 0.16.1)
6
6
  coffee-script (~> 2.2)
7
7
  connection_pool (~> 2.0)
@@ -50,8 +50,8 @@ GEM
50
50
  coffee-script (2.3.0)
51
51
  coffee-script-source
52
52
  execjs
53
- coffee-script-source (1.7.1)
54
- connection_pool (2.0.0)
53
+ coffee-script-source (1.9.1)
54
+ connection_pool (2.1.2)
55
55
  coveralls (0.7.0)
56
56
  multi_json (~> 1.3)
57
57
  rest-client
@@ -61,7 +61,7 @@ GEM
61
61
  diff-lcs (1.2.5)
62
62
  docile (1.1.3)
63
63
  erubis (2.7.0)
64
- execjs (2.2.1)
64
+ execjs (2.4.0)
65
65
  generator_spec (0.9.2)
66
66
  activesupport (>= 3.0.0)
67
67
  railties (>= 3.0.0)
@@ -104,7 +104,7 @@ GEM
104
104
  rake (>= 0.8.7)
105
105
  thor (>= 0.18.1, < 2.0)
106
106
  rake (10.3.2)
107
- redis (3.1.0)
107
+ redis (3.2.1)
108
108
  rest-client (1.6.7)
109
109
  mime-types (>= 1.16)
110
110
  rspec-core (2.14.8)
@@ -119,7 +119,7 @@ GEM
119
119
  rspec-core (~> 2.14.0)
120
120
  rspec-expectations (~> 2.14.0)
121
121
  rspec-mocks (~> 2.14.0)
122
- rufus-scheduler (3.0.8)
122
+ rufus-scheduler (3.0.9)
123
123
  tzinfo
124
124
  simplecov (0.8.2)
125
125
  docile (~> 1.1.0)
@@ -127,15 +127,15 @@ GEM
127
127
  simplecov-html (~> 0.8.0)
128
128
  simplecov-html (0.8.0)
129
129
  slop (3.5.0)
130
- sprockets (2.12.1)
130
+ sprockets (2.12.3)
131
131
  hike (~> 1.2)
132
132
  multi_json (~> 1.0)
133
133
  rack (~> 1.0)
134
134
  tilt (~> 1.1, != 1.3.0)
135
- sprockets-rails (2.1.3)
135
+ sprockets-rails (2.2.4)
136
136
  actionpack (>= 3.0)
137
137
  activesupport (>= 3.0)
138
- sprockets (~> 2.8)
138
+ sprockets (>= 2.8, < 4.0)
139
139
  sqlite3 (1.3.9)
140
140
  term-ansicolor (1.3.0)
141
141
  tins (~> 1.0)
data/README.md CHANGED
@@ -18,10 +18,6 @@ A huge thanks to Shopify for their great work with the Sinatra version.
18
18
 
19
19
  Dashing is a Rails engine that lets you build beautiful dashboards.
20
20
 
21
- [Click here for a video tutorial on how to use this gem:](http://devcasts.co/dashing-rails-making-dashingly-handsome-dashboards/)
22
-
23
- [![dashing-rails-devcast](http://devcasts.co/wp-content/uploads/2014/03/dashing-rails.png)](http://devcasts.co/dashing-rails-making-dashingly-handsome-dashboards/)
24
-
25
21
  Check out a demo over [here](http://dashingdemo.herokuapp.com/sample). [Here's another one](http://dashingdemo.herokuapp.com/sampletv), optimized for 1080p screens.
26
22
 
27
23
  Key features:
@@ -44,45 +40,45 @@ Key features:
44
40
 
45
41
  1. Install the gem by adding the following in your `Gemfile`:
46
42
 
47
- ```ruby
48
- gem 'dashing-rails'
49
- ```
43
+ ```ruby
44
+ gem 'dashing-rails'
45
+ ```
50
46
 
51
47
  2. Install puma server by adding the following in your `Gemfile`:
52
48
 
53
- ```ruby
54
- gem 'puma'
55
- ```
49
+ ```ruby
50
+ gem 'puma'
51
+ ```
56
52
 
57
53
  3. Bundle install
58
54
 
59
- ```
60
- $ bundle
61
- ```
55
+ ```
56
+ $ bundle
57
+ ```
62
58
 
63
59
  4. Install the dependencies using the following command:
64
60
 
65
- ```
66
- $ rails g dashing:install
67
- ```
61
+ ```
62
+ $ rails g dashing:install
63
+ ```
68
64
 
69
65
  5. Start redis server:
70
66
 
71
- ```
72
- $ redis-server
73
- ```
67
+ ```
68
+ $ redis-server
69
+ ```
74
70
 
75
71
  6. Open `config/environments/development.rb` and add:
76
72
 
77
- ```ruby
78
- config.allow_concurrency = true
79
- ```
73
+ ```ruby
74
+ config.allow_concurrency = true
75
+ ```
80
76
 
81
77
  7. Start your server (must be a multi threaded server - See [Requirements](https://github.com/gottfrois/dashing-rails#requirements))
82
78
 
83
- ```
84
- $ rails s
85
- ```
79
+ ```
80
+ $ rails s
81
+ ```
86
82
 
87
83
  8. Point your browser at [http://localhost:3000/dashing/dashboards](http://localhost:3000/dashing/dashboards) and have fun!
88
84
 
@@ -20,7 +20,7 @@ module Dashing
20
20
  end
21
21
 
22
22
  def dashboard_path(name)
23
- Dashing.config.dashboards_views_path.call.join(name)
23
+ Dashing.config.dashboards_views_path.join(name)
24
24
  end
25
25
 
26
26
  def template_not_found
@@ -8,7 +8,7 @@ module Dashing
8
8
  rescue_from ActionView::MissingTemplate, with: :template_not_found
9
9
 
10
10
  def show
11
- render file: widget_path
11
+ render file: widget_path, layout: false
12
12
  end
13
13
 
14
14
  def update
@@ -6,10 +6,26 @@ Dashing.gridsterLayout = (positions) ->
6
6
  Dashing.customGridsterLayout = true
7
7
  positions = positions.replace(/^"|"$/g, '')
8
8
  positions = $.parseJSON(positions)
9
- widgets = $("[data-row^=]")
9
+ widgets = $("[data-row]")
10
+ maxRow = 1
11
+ maxCol = 1
12
+ numColumns = Dashing.numColumns || 1
10
13
  for widget, index in widgets
11
- $(widget).attr('data-row', positions[index].row)
12
- $(widget).attr('data-col', positions[index].col)
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
13
29
 
14
30
  Dashing.getWidgetPositions = ->
15
31
  $(".gridster ul:first").gridster().data('gridster').serialize()
data/lib/dashing.rb CHANGED
@@ -14,7 +14,7 @@ module Dashing
14
14
  end
15
15
 
16
16
  def first_dashboard
17
- files = Dir[config.dashboards_views_path.call.join('*')].collect { |f| File.basename(f, '.*') }
17
+ files = Dir[config.dashboards_views_path.join('*')].collect { |f| File.basename(f, '.*') }
18
18
  files.sort.first
19
19
  end
20
20
 
@@ -29,11 +29,11 @@ module Dashing
29
29
  @devise_allowed_models = []
30
30
 
31
31
  # Jobs
32
- @jobs_path = -> { Rails.root.join('app', 'jobs') }
32
+ @jobs_path = Rails.root.join('app', 'jobs')
33
33
 
34
34
  # Dashboards
35
35
  @default_dashboard = nil
36
- @dashboards_views_path = -> { Rails.root.join('app', 'views', 'dashing', 'dashboards') }
36
+ @dashboards_views_path = Rails.root.join('app', 'views', 'dashing', 'dashboards')
37
37
  @dashboard_layout_path = 'dashing/dashboard'
38
38
 
39
39
  # Widgets
@@ -14,7 +14,7 @@ module Dashing
14
14
  end
15
15
 
16
16
  initializer 'require dashing jobs' do
17
- Dir[Dashing.config.jobs_path.call.join('**', '*.rb')].each { |file| require file }
17
+ Dir[Dashing.config.jobs_path.join('**', '*.rb')].each { |file| require file }
18
18
  end
19
19
 
20
20
  initializer 'fix redis child connection' do
@@ -1,3 +1,3 @@
1
1
  module Dashing
2
- VERSION = '2.4.0'
2
+ VERSION = '2.4.1'
3
3
  end
@@ -27,19 +27,19 @@ Dashing.configure do |config|
27
27
  #
28
28
  # You can change default views and assets paths with the following config:
29
29
  #
30
- # config.widgets_views_path = -> { Rails.root.join('app', 'views', 'dashing', 'widgets') }
31
- # config.widgets_js_path = 'app/assets/javascripts/dashing'
32
- # config.widgets_css_path = 'app/assets/stylesheets/dashing'
30
+ # config.widgets_views_path = Rails.root.join('app', 'views', 'dashing', 'widgets')
31
+ # config.widgets_js_path = Rails.root.join('app', 'assets', 'javascripts', 'dashing')
32
+ # config.widgets_css_path = Rails.root.join('app', 'assets', 'stylesheets', 'dashing')
33
33
 
34
34
  # rufus-scheduler worker path
35
- # config.jobs_path = -> { Rails.root.join('app', 'jobs') }
35
+ # config.jobs_path = Rails.root.join('app', 'jobs')
36
36
 
37
37
  # Engine path to use for accessing engine's routes.
38
38
  # Ex: http://your_app/dashing/dashboard/my_dashboard_name
39
39
  # config.engine_path = '/dashing'
40
40
 
41
41
  # The dashboards views path used to find dashboards.
42
- # config.dashboards_views_path = -> { Rails.root.join('app', 'views', 'dashing', 'dashboards') }
42
+ # config.dashboards_views_path = Rails.root.join('app', 'views', 'dashing', 'dashboards')
43
43
 
44
44
  # The Dashing layout used to display metrics.
45
45
  # config.dashboard_layout_path = 'dashing/dashboard'
@@ -32,7 +32,7 @@ Dashing.configure do |config|
32
32
  # config.widgets_css_path = 'app/assets/stylesheets/dashing'
33
33
 
34
34
  # rufus-scheduler worker path
35
- # config.jobs_path = 'app/jobs/'
35
+ # config.jobs_path = Rails.root.join('app', 'jobs')
36
36
 
37
37
  # Engine path to use for accessing engine's routes.
38
38
  # Ex: http://your_app/dashing/dashboard/my_dashboard_name
@@ -20,11 +20,11 @@ describe Dashing::Configuration do
20
20
  it { expect(instance.devise_allowed_models).to be_empty }
21
21
 
22
22
  # Jobs
23
- it { expect(instance.jobs_path.call.to_s).to include('app/jobs') }
23
+ it { expect(instance.jobs_path.to_s).to include('app/jobs') }
24
24
 
25
25
  # Dashboards
26
26
  it { expect(instance.default_dashboard).to be_nil }
27
- it { expect(instance.dashboards_views_path.call.to_s).to include('app/views/dashing/dashboards') }
27
+ it { expect(instance.dashboards_views_path.to_s).to include('app/views/dashing/dashboards') }
28
28
  it { expect(instance.dashboard_layout_path).to eq('dashing/dashboard') }
29
29
 
30
30
  # Widgets
@@ -6,15 +6,13 @@ class Dashing.Graph extends Dashing.Widget
6
6
  if points
7
7
  points[points.length - 1].y
8
8
 
9
- loadNode: (_node) ->
10
- node = super(_node)
11
-
12
- container = $(node).parent()
9
+ ready: ->
10
+ container = $(@node).parent()
13
11
  # Gross hacks. Let's fix this.
14
12
  width = (Dashing.widget_base_dimensions[0] * container.data("sizex")) + Dashing.widget_margins[0] * 2 * (container.data("sizex") - 1)
15
13
  height = (Dashing.widget_base_dimensions[1] * container.data("sizey"))
16
14
  @graph = new Rickshaw.Graph(
17
- element: node
15
+ element: @node
18
16
  width: width
19
17
  height: height
20
18
  renderer: @get("graphtype")
@@ -24,6 +22,7 @@ class Dashing.Graph extends Dashing.Widget
24
22
  data: [{x:0, y:0}]
25
23
  }
26
24
  ]
25
+ padding: {top: 0.02, left: 0.02, right: 0.02, bottom: 0.02}
27
26
  )
28
27
 
29
28
  @graph.series[0].data = @get('points') if @get('points')
@@ -32,8 +31,6 @@ class Dashing.Graph extends Dashing.Widget
32
31
  y_axis = new Rickshaw.Graph.Axis.Y(graph: @graph, tickFormat: Rickshaw.Fixtures.Number.formatKMBT)
33
32
  @graph.render()
34
33
 
35
- return node
36
-
37
34
  onData: (data) ->
38
35
  if @graph
39
36
  @graph.series[0].data = data.points
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dashing-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pierre-Louis Gottfrois
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-24 00:00:00.000000000 Z
11
+ date: 2015-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -314,12 +314,12 @@ require_paths:
314
314
  - lib
315
315
  required_ruby_version: !ruby/object:Gem::Requirement
316
316
  requirements:
317
- - - ! '>='
317
+ - - '>='
318
318
  - !ruby/object:Gem::Version
319
319
  version: '0'
320
320
  required_rubygems_version: !ruby/object:Gem::Requirement
321
321
  requirements:
322
- - - ! '>='
322
+ - - '>='
323
323
  - !ruby/object:Gem::Version
324
324
  version: '0'
325
325
  requirements: []
@@ -387,4 +387,3 @@ test_files:
387
387
  - spec/lib/generators/widget_generator_spec.rb
388
388
  - spec/spec_helper.rb
389
389
  - spec/support/controller_spec_helpers.rb
390
- has_rdoc: