leftronicapi 1.2.0 → 1.3.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 +15 -0
- data/Rakefile +3 -4
- data/leftronicapi.gemspec +5 -24
- data/lib/leftronic.rb +94 -84
- metadata +108 -124
- data/.document +0 -5
- data/LICENSE.txt +0 -165
- data/README.md +0 -111
- data/README.rdoc +0 -47
- data/VERSION +0 -1
- data/leftronicapi-1.0.0.gem +0 -0
- data/test/helper.rb +0 -18
- data/test/test_leftronic.rb +0 -7
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZDQ4ZWQzODUxMzE4MjYwNTM4MmZkYTFkMTVlYzkyNzZjZGIxN2I0ZA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
ZWU4ODViOTA1NDkzNzI4Y2Y5NzY0NzAxNDNjNWY0YTQ2MGU5YWUxNw==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
YWE0ZGJjNjAzMjhhMjVkNDhiNGUyNTE1YjljZDA0NzlkM2M1OTAxODA1MGVk
|
10
|
+
ZmIzNTkzZDA1MDA4NmMyNzYwMzU4MDA4YzFjMWI2Yjk4OTJlMDFmMTU3YTNh
|
11
|
+
MTg2MDE1ODE4MDFjNjcyMDVlMGI0NzUzYjcwMDE1NmY0YzA3ODk=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
M2Q5ODEwZDZmMDhiY2EyNGNmOTYxYTRjNjY3N2E2NTU2ZDMxNTU3NjVkNzQ4
|
14
|
+
MWU4MTEzOTUxODQyOWQwMThlZjNkN2QzYzBiMWJmMTViZDdhYzkyZDVlNDhl
|
15
|
+
NGNmNDIwZjg1MTkyY2Y4ZjkwYTE3ZTM2OTc0OWM3OGQxNmM0MjI=
|
data/Rakefile
CHANGED
@@ -15,13 +15,12 @@ require 'jeweler'
|
|
15
15
|
Jeweler::Tasks.new do |gem|
|
16
16
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
17
|
gem.name = "leftronicapi"
|
18
|
-
gem.homepage = "
|
19
|
-
gem.license = "GNU - LGPL"
|
18
|
+
gem.homepage = "https://github.com/leftronic/leftronic/tree/master/ruby"
|
20
19
|
gem.summary = %Q{The official Ruby Gem to interface with the Leftronic API.}
|
21
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.}
|
22
21
|
gem.email = "support@leftronic.com"
|
23
|
-
gem.authors = ["
|
24
|
-
gem.version = '1.
|
22
|
+
gem.authors = ["Leftronic"]
|
23
|
+
gem.version = '1.3.1'
|
25
24
|
### dependencies defined in Gemfile
|
26
25
|
end
|
27
26
|
Jeweler::RubygemsDotOrgTasks.new
|
data/leftronicapi.gemspec
CHANGED
@@ -1,39 +1,20 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
1
|
Gem::Specification.new do |s|
|
7
2
|
s.name = %q{leftronicapi}
|
8
|
-
s.version = "1.
|
3
|
+
s.version = "1.3.1"
|
9
4
|
|
10
5
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["
|
12
|
-
s.date = %q{
|
6
|
+
s.authors = ["Leftronic"]
|
7
|
+
s.date = %q{2014-05-31}
|
13
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.}
|
14
9
|
s.email = %q{support@leftronic.com}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE.txt",
|
17
|
-
"README.md",
|
18
|
-
"README.rdoc"
|
19
|
-
]
|
20
10
|
s.files = [
|
21
|
-
".document",
|
22
11
|
"Gemfile",
|
23
12
|
"Gemfile.lock",
|
24
|
-
"LICENSE.txt",
|
25
|
-
"README.md",
|
26
|
-
"README.rdoc",
|
27
13
|
"Rakefile",
|
28
|
-
"VERSION",
|
29
|
-
"leftronicapi-1.0.0.gem",
|
30
14
|
"leftronicapi.gemspec",
|
31
|
-
"lib/leftronic.rb"
|
32
|
-
"test/helper.rb",
|
33
|
-
"test/test_leftronic.rb"
|
15
|
+
"lib/leftronic.rb"
|
34
16
|
]
|
35
|
-
s.homepage = %q{
|
36
|
-
s.licenses = ["GNU - LGPL"]
|
17
|
+
s.homepage = %q{https://www.leftronic.com/}
|
37
18
|
s.require_paths = ["lib"]
|
38
19
|
s.rubygems_version = %q{1.3.6}
|
39
20
|
s.summary = %q{The official Ruby Gem to interface with the Leftronic API.}
|
data/lib/leftronic.rb
CHANGED
@@ -1,84 +1,94 @@
|
|
1
|
-
require 'net/http'
|
2
|
-
require 'net/https'
|
3
|
-
require 'rubygems'
|
4
|
-
require 'json'
|
5
|
-
|
6
|
-
class Leftronic
|
7
|
-
ALLOWED_COLORS = [:red, :yellow, :green, :blue, :purple]
|
8
|
-
attr_accessor :key
|
9
|
-
def url=(url)
|
10
|
-
@url = URI(url.to_s)
|
11
|
-
end
|
12
|
-
def url
|
13
|
-
@url.to_s
|
14
|
-
end
|
15
|
-
|
16
|
-
def initialize(key, url='https://
|
17
|
-
@key = key
|
18
|
-
self.url = url
|
19
|
-
end
|
20
|
-
|
21
|
-
# Push anything to a widget
|
22
|
-
def push(stream, object)
|
23
|
-
post stream, object
|
24
|
-
end
|
25
|
-
|
26
|
-
# Push a Number to a widget
|
27
|
-
def push_number(stream, point)
|
28
|
-
post stream, point
|
29
|
-
end
|
30
|
-
|
31
|
-
# Push a geographic location (latitude and longitude) to a Map widget
|
32
|
-
def push_geo(stream, lat, long, color=nil)
|
33
|
-
post stream, 'latitude' => lat, 'longitude' => long, 'color' => color
|
34
|
-
end
|
35
|
-
|
36
|
-
# Push a title and message to a Text Feed widget
|
37
|
-
def push_text(stream, title, message)
|
38
|
-
post stream, 'title' => title, 'msg' => message
|
39
|
-
end
|
40
|
-
|
41
|
-
# Push a hash to a Leaderboard widget
|
42
|
-
def push_leaderboard(stream, hash)
|
43
|
-
leaderboard = hash.inject([]) do |array, (key, value)|
|
44
|
-
array << {'name' => key, 'value' => value}
|
45
|
-
end
|
46
|
-
post stream, 'leaderboard' => leaderboard
|
47
|
-
end
|
48
|
-
|
49
|
-
# Push an array to a List widget
|
50
|
-
def push_list(stream, *array)
|
51
|
-
post stream, 'list' => array.flatten.map{|item| {'listItem' => item}}
|
52
|
-
end
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
1
|
+
require 'net/http'
|
2
|
+
require 'net/https'
|
3
|
+
require 'rubygems'
|
4
|
+
require 'json'
|
5
|
+
|
6
|
+
class Leftronic
|
7
|
+
ALLOWED_COLORS = [:red, :yellow, :green, :blue, :purple]
|
8
|
+
attr_accessor :key
|
9
|
+
def url=(url)
|
10
|
+
@url = URI(url.to_s)
|
11
|
+
end
|
12
|
+
def url
|
13
|
+
@url.to_s
|
14
|
+
end
|
15
|
+
|
16
|
+
def initialize(key, url='https://www.leftronic.com/customSend/')
|
17
|
+
@key = key
|
18
|
+
self.url = url
|
19
|
+
end
|
20
|
+
|
21
|
+
# Push anything to a widget
|
22
|
+
def push(stream, object)
|
23
|
+
post stream, object
|
24
|
+
end
|
25
|
+
|
26
|
+
# Push a Number to a widget
|
27
|
+
def push_number(stream, point)
|
28
|
+
post stream, point
|
29
|
+
end
|
30
|
+
|
31
|
+
# Push a geographic location (latitude and longitude) to a Map widget
|
32
|
+
def push_geo(stream, lat, long, color=nil)
|
33
|
+
post stream, 'latitude' => lat, 'longitude' => long, 'color' => color
|
34
|
+
end
|
35
|
+
|
36
|
+
# Push a title and message to a Text Feed widget
|
37
|
+
def push_text(stream, title, message)
|
38
|
+
post stream, 'title' => title, 'msg' => message
|
39
|
+
end
|
40
|
+
|
41
|
+
# Push a hash to a Leaderboard widget
|
42
|
+
def push_leaderboard(stream, hash)
|
43
|
+
leaderboard = hash.inject([]) do |array, (key, value)|
|
44
|
+
array << {'name' => key, 'value' => value}
|
45
|
+
end
|
46
|
+
post stream, 'leaderboard' => leaderboard
|
47
|
+
end
|
48
|
+
|
49
|
+
# Push an array to a List widget
|
50
|
+
def push_list(stream, *array)
|
51
|
+
post stream, 'list' => array.flatten.map{|item| {'listItem' => item}}
|
52
|
+
end
|
53
|
+
|
54
|
+
# Push a string to an html widget
|
55
|
+
def push_html(stream, html)
|
56
|
+
post stream, 'html' => html
|
57
|
+
end
|
58
|
+
|
59
|
+
# Push an array to a table widget
|
60
|
+
def push_table(stream, header_row, data_rows)
|
61
|
+
data_rows.insert(0, header_row)
|
62
|
+
post stream, 'table' => data_rows
|
63
|
+
end
|
64
|
+
|
65
|
+
protected
|
66
|
+
|
67
|
+
def post(stream, params)
|
68
|
+
request = build_request(stream, params)
|
69
|
+
connection = build_connection
|
70
|
+
connection.start{|http| http.request request}
|
71
|
+
params
|
72
|
+
end
|
73
|
+
|
74
|
+
def build_request(stream, params)
|
75
|
+
request = Net::HTTP::Post.new @url.request_uri
|
76
|
+
request['Accept'] = 'application/json'
|
77
|
+
request['Content-Type'] = 'application/json'
|
78
|
+
request.body = {
|
79
|
+
'accessKey' => @key,
|
80
|
+
'streamName' => stream,
|
81
|
+
'point' => params
|
82
|
+
}.to_json
|
83
|
+
request
|
84
|
+
end
|
85
|
+
|
86
|
+
def build_connection # NOTE: Does not open the connection
|
87
|
+
connection = Net::HTTP.new @url.host, @url.port
|
88
|
+
if @url.scheme == 'https'
|
89
|
+
connection.use_ssl = true
|
90
|
+
connection.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
91
|
+
end
|
92
|
+
connection
|
93
|
+
end
|
94
|
+
end
|
metadata
CHANGED
@@ -1,163 +1,147 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: leftronicapi
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
segments:
|
6
|
-
- 1
|
7
|
-
- 2
|
8
|
-
- 0
|
9
|
-
version: 1.2.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.3.1
|
10
5
|
platform: ruby
|
11
|
-
authors:
|
12
|
-
-
|
6
|
+
authors:
|
7
|
+
- Leftronic
|
13
8
|
autorequire:
|
14
9
|
bindir: bin
|
15
10
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
prerelease: false
|
22
|
-
type: :runtime
|
11
|
+
date: 2014-05-31 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
23
14
|
name: curb
|
24
|
-
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
- 0
|
30
|
-
version: "0"
|
31
|
-
requirement: *id001
|
32
|
-
- !ruby/object:Gem::Dependency
|
33
|
-
prerelease: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
34
20
|
type: :runtime
|
35
|
-
name: json
|
36
|
-
version_requirements: &id002 !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - ">="
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
segments:
|
41
|
-
- 0
|
42
|
-
version: "0"
|
43
|
-
requirement: *id002
|
44
|
-
- !ruby/object:Gem::Dependency
|
45
21
|
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: json
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ! '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
46
34
|
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ! '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
47
42
|
name: rake
|
48
|
-
|
49
|
-
requirements:
|
50
|
-
- -
|
51
|
-
- !ruby/object:Gem::Version
|
52
|
-
|
53
|
-
|
54
|
-
version: "0"
|
55
|
-
requirement: *id003
|
56
|
-
- !ruby/object:Gem::Dependency
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ! '>='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
57
49
|
prerelease: false
|
58
|
-
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
59
56
|
name: shoulda
|
60
|
-
|
61
|
-
requirements:
|
62
|
-
- -
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
|
65
|
-
- 0
|
66
|
-
version: "0"
|
67
|
-
requirement: *id004
|
68
|
-
- !ruby/object:Gem::Dependency
|
69
|
-
prerelease: false
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
70
62
|
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
71
70
|
name: bundler
|
72
|
-
|
73
|
-
requirements:
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
74
73
|
- - ~>
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
segments:
|
77
|
-
- 1
|
78
|
-
- 0
|
79
|
-
- 0
|
74
|
+
- !ruby/object:Gem::Version
|
80
75
|
version: 1.0.0
|
81
|
-
requirement: *id005
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
prerelease: false
|
84
76
|
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.0.0
|
83
|
+
- !ruby/object:Gem::Dependency
|
85
84
|
name: jeweler
|
86
|
-
|
87
|
-
requirements:
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
88
87
|
- - ~>
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
segments:
|
91
|
-
- 1
|
92
|
-
- 6
|
93
|
-
- 4
|
88
|
+
- !ruby/object:Gem::Version
|
94
89
|
version: 1.6.4
|
95
|
-
requirement: *id006
|
96
|
-
- !ruby/object:Gem::Dependency
|
97
|
-
prerelease: false
|
98
90
|
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ~>
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: 1.6.4
|
97
|
+
- !ruby/object:Gem::Dependency
|
99
98
|
name: rcov
|
100
|
-
|
101
|
-
requirements:
|
102
|
-
- -
|
103
|
-
- !ruby/object:Gem::Version
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - ! '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ! '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: Provides a set of functions to update Leftronic dashboard widgets with
|
112
|
+
custom data. Data is submitted by an HTTP POST request with data encoded in the
|
113
|
+
JSON format.
|
109
114
|
email: support@leftronic.com
|
110
115
|
executables: []
|
111
|
-
|
112
116
|
extensions: []
|
113
|
-
|
114
|
-
|
115
|
-
- LICENSE.txt
|
116
|
-
- README.md
|
117
|
-
- README.rdoc
|
118
|
-
files:
|
119
|
-
- .document
|
117
|
+
extra_rdoc_files: []
|
118
|
+
files:
|
120
119
|
- Gemfile
|
121
120
|
- Gemfile.lock
|
122
|
-
- LICENSE.txt
|
123
|
-
- README.md
|
124
|
-
- README.rdoc
|
125
121
|
- Rakefile
|
126
|
-
- VERSION
|
127
|
-
- leftronicapi-1.0.0.gem
|
128
122
|
- leftronicapi.gemspec
|
129
123
|
- lib/leftronic.rb
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
homepage: http://github.com/sonofabell/leftronic-ruby
|
134
|
-
licenses:
|
135
|
-
- GNU - LGPL
|
124
|
+
homepage: https://www.leftronic.com/
|
125
|
+
licenses: []
|
126
|
+
metadata: {}
|
136
127
|
post_install_message:
|
137
128
|
rdoc_options: []
|
138
|
-
|
139
|
-
require_paths:
|
129
|
+
require_paths:
|
140
130
|
- lib
|
141
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- -
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
segments:
|
153
|
-
- 0
|
154
|
-
version: "0"
|
131
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
132
|
+
requirements:
|
133
|
+
- - ! '>='
|
134
|
+
- !ruby/object:Gem::Version
|
135
|
+
version: '0'
|
136
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
|
+
requirements:
|
138
|
+
- - ! '>='
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: '0'
|
155
141
|
requirements: []
|
156
|
-
|
157
142
|
rubyforge_project:
|
158
|
-
rubygems_version:
|
143
|
+
rubygems_version: 2.2.2
|
159
144
|
signing_key:
|
160
145
|
specification_version: 3
|
161
146
|
summary: The official Ruby Gem to interface with the Leftronic API.
|
162
147
|
test_files: []
|
163
|
-
|
data/.document
DELETED
data/LICENSE.txt
DELETED
@@ -1,165 +0,0 @@
|
|
1
|
-
GNU LESSER GENERAL PUBLIC LICENSE
|
2
|
-
Version 3, 29 June 2007
|
3
|
-
|
4
|
-
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
5
|
-
Everyone is permitted to copy and distribute verbatim copies
|
6
|
-
of this license document, but changing it is not allowed.
|
7
|
-
|
8
|
-
|
9
|
-
This version of the GNU Lesser General Public License incorporates
|
10
|
-
the terms and conditions of version 3 of the GNU General Public
|
11
|
-
License, supplemented by the additional permissions listed below.
|
12
|
-
|
13
|
-
0. Additional Definitions.
|
14
|
-
|
15
|
-
As used herein, "this License" refers to version 3 of the GNU Lesser
|
16
|
-
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
17
|
-
General Public License.
|
18
|
-
|
19
|
-
"The Library" refers to a covered work governed by this License,
|
20
|
-
other than an Application or a Combined Work as defined below.
|
21
|
-
|
22
|
-
An "Application" is any work that makes use of an interface provided
|
23
|
-
by the Library, but which is not otherwise based on the Library.
|
24
|
-
Defining a subclass of a class defined by the Library is deemed a mode
|
25
|
-
of using an interface provided by the Library.
|
26
|
-
|
27
|
-
A "Combined Work" is a work produced by combining or linking an
|
28
|
-
Application with the Library. The particular version of the Library
|
29
|
-
with which the Combined Work was made is also called the "Linked
|
30
|
-
Version".
|
31
|
-
|
32
|
-
The "Minimal Corresponding Source" for a Combined Work means the
|
33
|
-
Corresponding Source for the Combined Work, excluding any source code
|
34
|
-
for portions of the Combined Work that, considered in isolation, are
|
35
|
-
based on the Application, and not on the Linked Version.
|
36
|
-
|
37
|
-
The "Corresponding Application Code" for a Combined Work means the
|
38
|
-
object code and/or source code for the Application, including any data
|
39
|
-
and utility programs needed for reproducing the Combined Work from the
|
40
|
-
Application, but excluding the System Libraries of the Combined Work.
|
41
|
-
|
42
|
-
1. Exception to Section 3 of the GNU GPL.
|
43
|
-
|
44
|
-
You may convey a covered work under sections 3 and 4 of this License
|
45
|
-
without being bound by section 3 of the GNU GPL.
|
46
|
-
|
47
|
-
2. Conveying Modified Versions.
|
48
|
-
|
49
|
-
If you modify a copy of the Library, and, in your modifications, a
|
50
|
-
facility refers to a function or data to be supplied by an Application
|
51
|
-
that uses the facility (other than as an argument passed when the
|
52
|
-
facility is invoked), then you may convey a copy of the modified
|
53
|
-
version:
|
54
|
-
|
55
|
-
a) under this License, provided that you make a good faith effort to
|
56
|
-
ensure that, in the event an Application does not supply the
|
57
|
-
function or data, the facility still operates, and performs
|
58
|
-
whatever part of its purpose remains meaningful, or
|
59
|
-
|
60
|
-
b) under the GNU GPL, with none of the additional permissions of
|
61
|
-
this License applicable to that copy.
|
62
|
-
|
63
|
-
3. Object Code Incorporating Material from Library Header Files.
|
64
|
-
|
65
|
-
The object code form of an Application may incorporate material from
|
66
|
-
a header file that is part of the Library. You may convey such object
|
67
|
-
code under terms of your choice, provided that, if the incorporated
|
68
|
-
material is not limited to numerical parameters, data structure
|
69
|
-
layouts and accessors, or small macros, inline functions and templates
|
70
|
-
(ten or fewer lines in length), you do both of the following:
|
71
|
-
|
72
|
-
a) Give prominent notice with each copy of the object code that the
|
73
|
-
Library is used in it and that the Library and its use are
|
74
|
-
covered by this License.
|
75
|
-
|
76
|
-
b) Accompany the object code with a copy of the GNU GPL and this license
|
77
|
-
document.
|
78
|
-
|
79
|
-
4. Combined Works.
|
80
|
-
|
81
|
-
You may convey a Combined Work under terms of your choice that,
|
82
|
-
taken together, effectively do not restrict modification of the
|
83
|
-
portions of the Library contained in the Combined Work and reverse
|
84
|
-
engineering for debugging such modifications, if you also do each of
|
85
|
-
the following:
|
86
|
-
|
87
|
-
a) Give prominent notice with each copy of the Combined Work that
|
88
|
-
the Library is used in it and that the Library and its use are
|
89
|
-
covered by this License.
|
90
|
-
|
91
|
-
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
92
|
-
document.
|
93
|
-
|
94
|
-
c) For a Combined Work that displays copyright notices during
|
95
|
-
execution, include the copyright notice for the Library among
|
96
|
-
these notices, as well as a reference directing the user to the
|
97
|
-
copies of the GNU GPL and this license document.
|
98
|
-
|
99
|
-
d) Do one of the following:
|
100
|
-
|
101
|
-
0) Convey the Minimal Corresponding Source under the terms of this
|
102
|
-
License, and the Corresponding Application Code in a form
|
103
|
-
suitable for, and under terms that permit, the user to
|
104
|
-
recombine or relink the Application with a modified version of
|
105
|
-
the Linked Version to produce a modified Combined Work, in the
|
106
|
-
manner specified by section 6 of the GNU GPL for conveying
|
107
|
-
Corresponding Source.
|
108
|
-
|
109
|
-
1) Use a suitable shared library mechanism for linking with the
|
110
|
-
Library. A suitable mechanism is one that (a) uses at run time
|
111
|
-
a copy of the Library already present on the user's computer
|
112
|
-
system, and (b) will operate properly with a modified version
|
113
|
-
of the Library that is interface-compatible with the Linked
|
114
|
-
Version.
|
115
|
-
|
116
|
-
e) Provide Installation Information, but only if you would otherwise
|
117
|
-
be required to provide such information under section 6 of the
|
118
|
-
GNU GPL, and only to the extent that such information is
|
119
|
-
necessary to install and execute a modified version of the
|
120
|
-
Combined Work produced by recombining or relinking the
|
121
|
-
Application with a modified version of the Linked Version. (If
|
122
|
-
you use option 4d0, the Installation Information must accompany
|
123
|
-
the Minimal Corresponding Source and Corresponding Application
|
124
|
-
Code. If you use option 4d1, you must provide the Installation
|
125
|
-
Information in the manner specified by section 6 of the GNU GPL
|
126
|
-
for conveying Corresponding Source.)
|
127
|
-
|
128
|
-
5. Combined Libraries.
|
129
|
-
|
130
|
-
You may place library facilities that are a work based on the
|
131
|
-
Library side by side in a single library together with other library
|
132
|
-
facilities that are not Applications and are not covered by this
|
133
|
-
License, and convey such a combined library under terms of your
|
134
|
-
choice, if you do both of the following:
|
135
|
-
|
136
|
-
a) Accompany the combined library with a copy of the same work based
|
137
|
-
on the Library, uncombined with any other library facilities,
|
138
|
-
conveyed under the terms of this License.
|
139
|
-
|
140
|
-
b) Give prominent notice with the combined library that part of it
|
141
|
-
is a work based on the Library, and explaining where to find the
|
142
|
-
accompanying uncombined form of the same work.
|
143
|
-
|
144
|
-
6. Revised Versions of the GNU Lesser General Public License.
|
145
|
-
|
146
|
-
The Free Software Foundation may publish revised and/or new versions
|
147
|
-
of the GNU Lesser General Public License from time to time. Such new
|
148
|
-
versions will be similar in spirit to the present version, but may
|
149
|
-
differ in detail to address new problems or concerns.
|
150
|
-
|
151
|
-
Each version is given a distinguishing version number. If the
|
152
|
-
Library as you received it specifies that a certain numbered version
|
153
|
-
of the GNU Lesser General Public License "or any later version"
|
154
|
-
applies to it, you have the option of following the terms and
|
155
|
-
conditions either of that published version or of any later version
|
156
|
-
published by the Free Software Foundation. If the Library as you
|
157
|
-
received it does not specify a version number of the GNU Lesser
|
158
|
-
General Public License, you may choose any version of the GNU Lesser
|
159
|
-
General Public License ever published by the Free Software Foundation.
|
160
|
-
|
161
|
-
If the Library as you received it specifies that a proxy can decide
|
162
|
-
whether future versions of the GNU Lesser General Public License shall
|
163
|
-
apply, that proxy's public statement of acceptance of any version is
|
164
|
-
permanent authorization for you to choose that version for the
|
165
|
-
Library.
|
data/README.md
DELETED
@@ -1,111 +0,0 @@
|
|
1
|
-
Leftronic Ruby Gem Documentation
|
2
|
-
================================
|
3
|
-
|
4
|
-
What is Leftronic?
|
5
|
-
------------------
|
6
|
-
|
7
|
-
[Leftronic](https://beta.leftronic.com) makes powerful dashboards for business intelligence.
|
8
|
-
|
9
|
-
* Colorful and interactive data visualizations
|
10
|
-
* Templates to get you started right away
|
11
|
-
* Drag-and-drop editor makes it easy for anyone to create a powerful dashboard, customized to their needs
|
12
|
-
* Integration with Google Analytics, Twitter, Chartbeat, Zendesk, Basecamp, Pivotal Tracker, Facebook, and more to come!
|
13
|
-
* Dashboards can be protected or shared with a shortened URL
|
14
|
-
* Powerful API's for Javascript, PHP, Python, Ruby, and Java
|
15
|
-
* Python Package and Ruby Gem
|
16
|
-
|
17
|
-
Technical Notes
|
18
|
-
---------------
|
19
|
-
|
20
|
-
We also suggest checking out our [API](https://beta.leftronic.com/api) page. While the most detailed documentation is here, it has JSON and CURL examples in addition to a test form to send data to your custom widgets.
|
21
|
-
|
22
|
-
Authentication is handled by your API access key. We strongly encourage you to keep this key private. If you're logged in, your key can be found on our [API](https://beta.leftronic.com/api) page. If you plan on using one of our API libraries, you will find instructions below on how to set your access key.
|
23
|
-
|
24
|
-
All API requests are made by sending a POST request to https://beta.leftronic.com/customSend with a properly formatted JSON packet. We do not support XML.
|
25
|
-
|
26
|
-
Current API version is 1.0.
|
27
|
-
Current Ruby Gem version is 1.1.1.
|
28
|
-
|
29
|
-
Getting Started
|
30
|
-
---------------
|
31
|
-
|
32
|
-
If you haven't already, create an account at https://beta.leftronic.com/accounts/login.
|
33
|
-
|
34
|
-
Get your API access key from the API overview page at https://beta.leftronic.com/api.
|
35
|
-
|
36
|
-
We recommend checking out our [Tutorials](https://beta.leftronic.com/tutorials) to familiarize yourself with your dashboard.
|
37
|
-
|
38
|
-
Ruby Gem
|
39
|
-
--------
|
40
|
-
|
41
|
-
Start by downloading the most recent version of our Ruby Gem on [Github](https://github.com/sonofabell/leftronic-ruby) or on [RubyGems](http://rubygems.org/gems/leftronic).
|
42
|
-
|
43
|
-
### Installing Dependencies
|
44
|
-
|
45
|
-
[RubyGems](http://rubygems.org/pages/download), [Curb](http://rubygems.org/gems/curb), and [JSON](http://rubygems.org/gems/json). We recommend installing them with the [RubyGems](http://rubygems.org/pages/download) installer.
|
46
|
-
|
47
|
-
**_Note_**: Versions prior to Ruby 1.9 may need to import [rubygems](http://rubygems.org).
|
48
|
-
|
49
|
-
```ruby
|
50
|
-
require 'rubygems'
|
51
|
-
```
|
52
|
-
|
53
|
-
Import the file. Your location may vary.
|
54
|
-
|
55
|
-
```ruby
|
56
|
-
require 'leftronic'
|
57
|
-
```
|
58
|
-
|
59
|
-
Create a class instance with your API key. Feel free to name it whatever you'd like.
|
60
|
-
|
61
|
-
```ruby
|
62
|
-
leftronic = Leftronic.new "YOUR_ACCESS_KEY"
|
63
|
-
```
|
64
|
-
|
65
|
-
Here are some example functions to push to your dashboard. Be sure you have configured the correct widgets to accept custom data points. Also, be sure that you have entered your API access key correctly.
|
66
|
-
|
67
|
-
Let's start with pushing a number to a widget.
|
68
|
-
|
69
|
-
```ruby
|
70
|
-
update = leftronic.push_number "yourNumberStream", 14600
|
71
|
-
```
|
72
|
-
|
73
|
-
Now we'll push some geographic coordinates to a map widget. You can use either the U.S. or world map widgets. The first coordinate (37.8) is the latitude and the second coordinate (-122.6) is the longitude. If your request is successful, you should see a data point appear on San Francisco, California. Optionally, if you'd like to set the color of your map point simply specify that in your function call. *Note*: only red, blue, green, purple, and yellow colors are supported at this time. Incorrect or missing color will default to red.
|
74
|
-
|
75
|
-
```ruby
|
76
|
-
update = leftronic.push_geo "yourGeoStream", 37.8, -122.6
|
77
|
-
```
|
78
|
-
|
79
|
-
```ruby
|
80
|
-
update = leftronic.push_geo "yourGeoStream", 37.8, -122.6, :blue
|
81
|
-
```
|
82
|
-
|
83
|
-
Here's how you push a title and message to a text feed widget.
|
84
|
-
|
85
|
-
```ruby
|
86
|
-
update = leftronic.push_text "yourTextStream", "This is my title.", "Hello World!"
|
87
|
-
```
|
88
|
-
|
89
|
-
A leaderboard widget requires a hash. The widget will display the hash entries sorted by value.
|
90
|
-
|
91
|
-
```ruby
|
92
|
-
update = leftronic.push_leaderboard "yourBoardStream", some_hash
|
93
|
-
```
|
94
|
-
```ruby
|
95
|
-
update = leftronic.push_leaderboard "yourBoardStream", 'Johnny' => 84, 'Jamie' => 75, 'Lance' => 62
|
96
|
-
```
|
97
|
-
|
98
|
-
Finally, let's push an array to a list widget.
|
99
|
-
|
100
|
-
```ruby
|
101
|
-
update = leftronic.push_list "yourListStream", some_array
|
102
|
-
```
|
103
|
-
```ruby
|
104
|
-
update = leftronic.push_list "yourListStream", 'Elizabeth', 'Marshall', 'Claire', 'Nolan'
|
105
|
-
```
|
106
|
-
```
|
107
|
-
|
108
|
-
Feedback and Issues
|
109
|
-
-------------------
|
110
|
-
|
111
|
-
If you notice any bugs or other issues, submit a patch or send us a pull request. You can also send us an email at <support@leftronic.com>.
|
data/README.rdoc
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
= Leftronic Ruby Gem
|
2
|
-
|
3
|
-
== What is Leftronic?
|
4
|
-
|
5
|
-
Leftronic[https://beta.leftronic.com] makes powerful dashboards for business intelligence.
|
6
|
-
|
7
|
-
* Colorful and interactive data visualizations
|
8
|
-
* Templates to get you started right away
|
9
|
-
* Drag-and-drop editor makes it easy for anyone to create a powerful dashboard, customized to their needs
|
10
|
-
* Integration with Google Analytics, Twitter, Chartbeat, Zendesk, Basecamp, Pivotal Tracker, Facebook, and more to come!
|
11
|
-
* Dashboards can be protected or shared with a shortened URL
|
12
|
-
* Powerful API's for Javascript, PHP, Python, Ruby, and Java
|
13
|
-
* Python Package and Ruby Gem
|
14
|
-
|
15
|
-
== Technical Notes
|
16
|
-
|
17
|
-
We also suggest checking out our API[https://beta.leftronic.com/api] page. While the most detailed documentation is here, it has JSON and CURL examples in addition to a test form to send data to your custom widgets.
|
18
|
-
|
19
|
-
Authentication is handled by your API access key. We strongly encourage you to keep this key private. If you're logged in, your key can be found on our API[https://beta.leftronic.com/api] page. If you plan on using one of our API libraries, you will find instructions below on how to set your access key.
|
20
|
-
|
21
|
-
All API requests are made by sending a POST request to https://beta.leftronic.com/customSend with a properly formatted JSON packet. We do not support XML.
|
22
|
-
|
23
|
-
Current API version is 1.0.
|
24
|
-
|
25
|
-
== Getting Started
|
26
|
-
|
27
|
-
If you haven't already, create an account at https://beta.leftronic.com/accounts/login.
|
28
|
-
|
29
|
-
Get your API access key from the API overview page at https://beta.leftronic.com/api.
|
30
|
-
|
31
|
-
We recommend checking out our Tutorials[https://beta.leftronic.com/tutorials] to familiarize yourself with your dashboard.
|
32
|
-
|
33
|
-
For examples and further documentation, the source for this Gem is on Github[https://github.com/sonofabell/leftronic-ruby].
|
34
|
-
|
35
|
-
== Contributing to Leftronic Gem
|
36
|
-
|
37
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
38
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
39
|
-
* Fork the project
|
40
|
-
* Start a feature/bugfix branch
|
41
|
-
* Commit and push until you are happy with your contribution
|
42
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
43
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
44
|
-
|
45
|
-
== Copyright
|
46
|
-
|
47
|
-
Copyright (c) 2011 Leftronic[https://beta.leftronic.com]. License is GNU Library or Lesser General Public License (LGPL). A copy of the license is available at http://www.gnu.org/copyleft/lesser.html. See LICENSE.txt for further details.
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
1.1.1
|
data/leftronicapi-1.0.0.gem
DELETED
Binary file
|
data/test/helper.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'bundler'
|
3
|
-
begin
|
4
|
-
Bundler.setup(:default, :development)
|
5
|
-
rescue Bundler::BundlerError => e
|
6
|
-
$stderr.puts e.message
|
7
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
-
exit e.status_code
|
9
|
-
end
|
10
|
-
require 'test/unit'
|
11
|
-
require 'shoulda'
|
12
|
-
|
13
|
-
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
|
14
|
-
$LOAD_PATH.unshift(File.dirname(__FILE__))
|
15
|
-
require 'leftronic'
|
16
|
-
|
17
|
-
class Test::Unit::TestCase
|
18
|
-
end
|