gecko-pusher 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,10 +3,16 @@ module Gecko
3
3
  module Channel
4
4
  class LineChart < Base
5
5
 
6
- def push(*args)
6
+ def push(points, options = {})
7
7
  data = {
8
- item: args
8
+ item: points
9
9
  }
10
+ unless options.empty?
11
+ data[:settings] = {}
12
+ [:colour, :axisx, :axisy].each do |setting|
13
+ data[:settings][setting] = options[setting] if options[setting]
14
+ end
15
+ end
10
16
  _push(data)
11
17
  end
12
18
 
@@ -1,5 +1,5 @@
1
1
  module Gecko
2
2
  module Pusher
3
- VERSION = "0.0.1"
3
+ VERSION = "0.0.2"
4
4
  end
5
5
  end
@@ -17,8 +17,35 @@ describe Gecko::Pusher::Channel::LineChart do
17
17
  item: [ 1,2,3,4,5 ]
18
18
  }
19
19
  stub = stub_gecko_post(WIDGET_KEY, data)
20
- @channel.push(1,2,3,4,5)
20
+ @channel.push([1,2,3,4,5])
21
21
  stub.should have_been_requested
22
22
  end
23
23
 
24
+ it "should push values with line colour" do
25
+ data = {
26
+ item: [1,2,3,4,5],
27
+ settings: {
28
+ colour: "#FFFFFF"
29
+ }
30
+ }
31
+ stub = stub_gecko_post(WIDGET_KEY, data)
32
+ @channel.push([1,2,3,4,5], colour: "#FFFFFF")
33
+ stub.should have_been_requested
34
+ end
35
+
36
+ it "should push values with axis options" do
37
+ data = {
38
+ item: [1,2,3,4,5],
39
+ settings: {
40
+ colour: "#FFFFFF",
41
+ axisx: ["Mon", "Tues", "Wed"],
42
+ axisy: ["1", "2", "3"]
43
+ }
44
+ }
45
+ stub = stub_gecko_post(WIDGET_KEY, data)
46
+ @channel.push([1,2,3,4,5], colour: "#FFFFFF", axisy: ["1", "2", "3"], axisx: ["Mon", "Tues", "Wed"])
47
+ stub.should have_been_requested
48
+
49
+ end
50
+
24
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gecko-pusher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-06-19 00:00:00.000000000 Z
12
+ date: 2012-06-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -167,7 +167,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
167
167
  version: '0'
168
168
  segments:
169
169
  - 0
170
- hash: 2628149161098194948
170
+ hash: 205409277355117486
171
171
  required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  none: false
173
173
  requirements:
@@ -176,7 +176,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
176
176
  version: '0'
177
177
  segments:
178
178
  - 0
179
- hash: 2628149161098194948
179
+ hash: 205409277355117486
180
180
  requirements: []
181
181
  rubyforge_project:
182
182
  rubygems_version: 1.8.23