leftronicapi 1.3.2 → 1.3.3

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,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MDdlYWY3MzVjYmU0ODRlMDg5NDZlNDJjMTBmMGY3NzRiZjczYWU2ZQ==
4
+ ZmVmZWZkN2FjNDQ4MDdiNjUxMjAyZDJlYWIzNTU4Yjk1NjFiYjBlMQ==
5
5
  data.tar.gz: !binary |-
6
- ZWUyZGIzOGE1YmJmN2FiNWZhYjc3MTk1MjNkZGNhOGRiMzI5MDg5ZQ==
6
+ YTZiNDMzOGRjMmNiZTE1YmVlMjY4OWVmYjkwMWY5YjU2MmMwZDlmNA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ODM0NDliMDgyYWU4YzZjN2MyYjQwMTI3ZWE2MDM0ZjBkM2I0M2JkMWUyMjIw
10
- N2ViMjgzMTZmZmNlN2M3ZDY4OTNjODA2YzE0MGRjNWM5Y2M1MmYxNDJiMDk2
11
- YWNiODE0YzViNmI3NGUxNzFiZGY1MDA2ZTA4MDhlYzQ2ZDg2YjM=
9
+ NzJlYzBhODA4NGQ5MzNiODMxNjYzNmQyMjk5MmE3MTJmMzMwZTA0ZTc4Njk4
10
+ MmM3ZmEzZDNiMDAxY2NlZTYyYjlkZmI3NmRlY2Y3M2UwZWM0ZTFjMzRkMTI5
11
+ ZDcxN2I0MmE0ZWNmYzg3MTRjNmVkYmViNjgzMmJiZWM2NGZhMjE=
12
12
  data.tar.gz: !binary |-
13
- M2YyYzkzZGZlMGEwZDVlMzdlZTkzZmRjYWI1ODEzZTJjNTY1ZWFjZWE5ZmU3
14
- NGFhNzI5NjU1MmUwZDFlMmNjMWI3YmE5Y2NjZGM0YWE0MzA2OWQxNzlkMzIw
15
- NTVhZWMyM2QzZGEyZDE5NTdhM2JjYmNjZDZjZTA5MTJiN2JhY2M=
13
+ OTA1ZDdjYTI0OTZmNDRjMGNhNjc0ZmEwZWRjYmNkNmZmMThjZjQ0NzU4Mzgy
14
+ OGI3ZmFmZDZmZGY4Y2QwOTI3ZTc0OGEwZjcxMGY1MWVhZjI2NmJjYjkwYTA0
15
+ YzljZGI4ZGNmZGE3MjJiYmQ1OWI4YmUxYTYyNWM0NTVkN2I1MmQ=
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ Jeweler::Tasks.new do |gem|
20
20
  gem.description = %Q{Provides a set of functions to update Leftronic dashboard widgets with custom data. Data is submitted by an HTTP POST request with data encoded in the JSON format.}
21
21
  gem.email = "support@leftronic.com"
22
22
  gem.authors = ["Leftronic"]
23
- gem.version = '1.3.2'
23
+ gem.version = '1.3.3'
24
24
  ### dependencies defined in Gemfile
25
25
  end
26
26
  Jeweler::RubygemsDotOrgTasks.new
@@ -1,10 +1,10 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = %q{leftronicapi}
3
- s.version = "1.3.2"
3
+ s.version = "1.3.3"
4
4
 
5
5
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
6
  s.authors = ["Leftronic"]
7
- s.date = %q{2014-05-31}
7
+ s.date = %q{2014-06-02}
8
8
  s.description = %q{Provides a set of functions to update Leftronic dashboard widgets with custom data. Data is submitted by an HTTP POST request with data encoded in the JSON format.}
9
9
  s.email = %q{support@leftronic.com}
10
10
  s.files = [
@@ -62,6 +62,35 @@ class Leftronic
62
62
  post stream, 'table' => data_rows
63
63
  end
64
64
 
65
+ # Push an image url to an image widget
66
+ def push_image(stream, img_url)
67
+ post stream, 'imgUrl' => img_url
68
+ end
69
+
70
+ # Push to a label widget
71
+ def push_label(stream, label)
72
+ post stream, 'label' => label
73
+ end
74
+
75
+ # Push to an xy graph
76
+ def push_pair(stream, x, y)
77
+ if (x.class == Array) and (y.class == Array)
78
+ # Check that x and y are the same length
79
+ if x.length != y.length
80
+ raise 'Unequal array lengths.'
81
+ end
82
+ point = []
83
+ for i in 0..x.length - 1
84
+ point[i] = {'x' => x[i], 'y' => y[i]}
85
+ end
86
+ else
87
+ # Just push a single point
88
+ point = {'x' => x, 'y' => y}
89
+ end
90
+ post stream, point
91
+ end
92
+
93
+ # Clear a widget
65
94
  def clear(stream)
66
95
  post stream, 'clear', 'command'
67
96
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: leftronicapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.2
4
+ version: 1.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leftronic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-31 00:00:00.000000000 Z
11
+ date: 2014-06-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: curb