appboard 1.0.2 → 1.0.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.
- data/README.md +8 -11
- data/examples/barchart.rb +36 -0
- data/examples/bubblechart.rb +33 -0
- data/examples/columnchart.rb +35 -0
- data/examples/fillergauge.rb +27 -0
- data/examples/funnelchart.rb +33 -0
- data/examples/linechart.rb +34 -0
- data/examples/piechart.rb +33 -0
- data/examples/radialgauge.rb +27 -0
- data/examples/singlenumner.rb +19 -0
- data/lib/appboard/bootstrap.rb +24 -21
- data/lib/appboard/version.rb +1 -1
- data/lib/appboard.rb +5 -5
- metadata +16 -7
data/README.md
CHANGED
@@ -9,7 +9,7 @@ Further reading:
|
|
9
9
|
* [Home page](http://appboard.me/)
|
10
10
|
* [The essential documentation](http://appboard.me/docs)
|
11
11
|
* [List of available widgets](http://appboard.me/docs/widgets)
|
12
|
-
|
12
|
+
* [Follow us on Twitter](http://twitter.com/appboard)
|
13
13
|
|
14
14
|
NOTE: We are currently in private beta. Please let me know (eugene@appboard.me) if you'd like an invite.
|
15
15
|
|
@@ -38,7 +38,7 @@ or you could define API key in call block:
|
|
38
38
|
require 'rubygems'
|
39
39
|
require 'appboard'
|
40
40
|
|
41
|
-
Appboard.
|
41
|
+
Appboard.push {
|
42
42
|
apiKey "abcd1234"
|
43
43
|
|
44
44
|
widget('some name here') {
|
@@ -72,8 +72,8 @@ There is several options how you could use API:
|
|
72
72
|
|
73
73
|
require 'rubygems'
|
74
74
|
require 'appboard'
|
75
|
-
|
76
|
-
Appboard.settings
|
75
|
+
|
76
|
+
Appboard.settings = { :apiKey => "abcd1234" }
|
77
77
|
|
78
78
|
widget = Appboard.widget('some name here') {
|
79
79
|
uid "abcd1234"
|
@@ -83,7 +83,7 @@ There is several options how you could use API:
|
|
83
83
|
}
|
84
84
|
}
|
85
85
|
|
86
|
-
response = widget.
|
86
|
+
response = widget.push # push data to Dashboard on appboard.me
|
87
87
|
|
88
88
|
response.success? # => true
|
89
89
|
response.code # => 200
|
@@ -94,10 +94,7 @@ There is several options how you could use API:
|
|
94
94
|
require 'rubygems'
|
95
95
|
require 'appboard'
|
96
96
|
|
97
|
-
Appboard.
|
98
|
-
|
99
|
-
|
100
|
-
Appboard.pub {
|
97
|
+
Appboard.push {
|
101
98
|
apiKey "abcd1234"
|
102
99
|
|
103
100
|
widget('widget1') {
|
@@ -106,14 +103,14 @@ There is several options how you could use API:
|
|
106
103
|
data do {
|
107
104
|
# Data is here
|
108
105
|
}
|
109
|
-
|
106
|
+
}
|
110
107
|
widget('widget2') {
|
111
108
|
uid "abcd4321"
|
112
109
|
|
113
110
|
data do {
|
114
111
|
# Data is here
|
115
112
|
}
|
116
|
-
|
113
|
+
}
|
117
114
|
}
|
118
115
|
|
119
116
|
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'appboard'
|
3
|
+
|
4
|
+
#
|
5
|
+
# Updates Bar Chart on Dashboard (see http://appboard.me/docs/barchart)
|
6
|
+
# Don't forget to specify your apiKey and widget identifier.
|
7
|
+
#
|
8
|
+
Appboard.push {
|
9
|
+
apiKey 'wOUpOJeOozcgPdZa'
|
10
|
+
|
11
|
+
widget('some name here') {
|
12
|
+
uid "ULcgjwNlKgqNPEpz"
|
13
|
+
data do
|
14
|
+
{
|
15
|
+
:xAxis => ["Jan", "Feb", "Mar", "Apr"],
|
16
|
+
:series => [
|
17
|
+
{
|
18
|
+
:name => "A",
|
19
|
+
:entries => [2, 3, 4, 1]
|
20
|
+
},
|
21
|
+
{
|
22
|
+
:name => "B",
|
23
|
+
:entries => [1, 2, 3, 4]
|
24
|
+
},
|
25
|
+
{
|
26
|
+
:name => "C",
|
27
|
+
:entries => [2, 4, 2, 2]
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
31
|
+
end
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
|
36
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'appboard'
|
3
|
+
|
4
|
+
#
|
5
|
+
# Updates Bubble Chart on Dashboard (see http://appboard.me/docs/bubblechart)
|
6
|
+
# Don't forget to specify your apiKey and widget identifier.
|
7
|
+
#
|
8
|
+
Appboard.push {
|
9
|
+
apiKey 'wOUpOJeOozcgPdZa'
|
10
|
+
|
11
|
+
widget('some name here') {
|
12
|
+
uid "dwTgneCxzCOlFTjI"
|
13
|
+
data do
|
14
|
+
{
|
15
|
+
:series => [
|
16
|
+
{
|
17
|
+
:name => "A",
|
18
|
+
:entries => 10
|
19
|
+
},
|
20
|
+
{
|
21
|
+
:name => "B",
|
22
|
+
:entries => 15
|
23
|
+
},
|
24
|
+
{
|
25
|
+
:name => "C",
|
26
|
+
:entries => 60
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
end
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'appboard'
|
3
|
+
|
4
|
+
#
|
5
|
+
# Updates Column Chart on Dashboard (see http://appboard.me/docs/columnchart)
|
6
|
+
# Don't forget to specify your apiKey and widget identifier.
|
7
|
+
#
|
8
|
+
Appboard.push {
|
9
|
+
apiKey 'wOUpOJeOozcgPdZa'
|
10
|
+
|
11
|
+
widget('some name here') {
|
12
|
+
uid "HkGIhTInYAwwwXbQ"
|
13
|
+
data do
|
14
|
+
{
|
15
|
+
:xAxis => ["Jan", "Feb", "Mar", "Apr"],
|
16
|
+
:series => [
|
17
|
+
{
|
18
|
+
:name => "A",
|
19
|
+
:entries => [2, 3, 4, 1]
|
20
|
+
},
|
21
|
+
{
|
22
|
+
:name => "B",
|
23
|
+
:entries => [3, 4, 2, 1]
|
24
|
+
},
|
25
|
+
{
|
26
|
+
:name => "C",
|
27
|
+
:entries => [5, 2, 1, 3]
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
31
|
+
end
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
35
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'appboard'
|
3
|
+
|
4
|
+
#
|
5
|
+
# Updates Filler Gauge on Dashboard (see http://appboard.me/docs/gauge)
|
6
|
+
# Don't forget to specify your apiKey and widget identifier.
|
7
|
+
#
|
8
|
+
Appboard.push {
|
9
|
+
apiKey 'wOUpOJeOozcgPdZa'
|
10
|
+
|
11
|
+
widget('some name here') {
|
12
|
+
uid "vCmpsvRHKoLBZTBN"
|
13
|
+
data do
|
14
|
+
{
|
15
|
+
:value => 80,
|
16
|
+
:minimum => 0,
|
17
|
+
:maximum => 100,
|
18
|
+
:ranges => [
|
19
|
+
{:range => 80, :fillColor => "#9ac736"},
|
20
|
+
{:range => 15, :fillColor => "#e06f0f"},
|
21
|
+
{:range => 5, :fillColor => "#fd1d25"}
|
22
|
+
]
|
23
|
+
}
|
24
|
+
end
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'appboard'
|
3
|
+
|
4
|
+
#
|
5
|
+
# Updates Funnel Chart on Dashboard (see http://appboard.me/docs/funnelchart)
|
6
|
+
# Don't forget to specify your apiKey and widget identifier.
|
7
|
+
#
|
8
|
+
Appboard.push {
|
9
|
+
apiKey 'wOUpOJeOozcgPdZa'
|
10
|
+
|
11
|
+
widget('some name here') {
|
12
|
+
uid "wyKUysnPLOmXpLcC"
|
13
|
+
data do
|
14
|
+
{
|
15
|
+
:series => [
|
16
|
+
{
|
17
|
+
:name => "A",
|
18
|
+
:entries => 1
|
19
|
+
},
|
20
|
+
{
|
21
|
+
:name => "B",
|
22
|
+
:entries => 20
|
23
|
+
},
|
24
|
+
{
|
25
|
+
:name => "C",
|
26
|
+
:entries => 5
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
end
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'appboard'
|
3
|
+
|
4
|
+
#
|
5
|
+
# Updates Line Chart on Dashboard (see http://appboard.me/docs/linechart)
|
6
|
+
# Don't forget to specify your apiKey and widget identifier.
|
7
|
+
#
|
8
|
+
Appboard.push {
|
9
|
+
apiKey 'wOUpOJeOozcgPdZa'
|
10
|
+
|
11
|
+
widget('some name here') {
|
12
|
+
uid "CrnBIfRFvkFcNKPX"
|
13
|
+
data do
|
14
|
+
{
|
15
|
+
:xAxis => ["Jan", "Feb", "Mar", "Apr"],
|
16
|
+
:series => [
|
17
|
+
{
|
18
|
+
:name => "A",
|
19
|
+
:entries => [1, 2, 3, 4]
|
20
|
+
},
|
21
|
+
{
|
22
|
+
:name => "B",
|
23
|
+
:entries => [10, 15, 20, 10]
|
24
|
+
},
|
25
|
+
{
|
26
|
+
:name => "C",
|
27
|
+
:entries => [20, 10, 5, 5]
|
28
|
+
}
|
29
|
+
]
|
30
|
+
}
|
31
|
+
end
|
32
|
+
}
|
33
|
+
}
|
34
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'appboard'
|
3
|
+
|
4
|
+
#
|
5
|
+
# Updates Pie Chart on Dashboard (see http://appboard.me/docs/piechart)
|
6
|
+
# Don't forget to specify your apiKey and widget identifier.
|
7
|
+
#
|
8
|
+
Appboard.push {
|
9
|
+
apiKey 'wOUpOJeOozcgPdZa'
|
10
|
+
|
11
|
+
widget('some name here') {
|
12
|
+
uid "QHKUBwxBPpiaAinB"
|
13
|
+
data do
|
14
|
+
{
|
15
|
+
:series => [
|
16
|
+
{
|
17
|
+
:name => "A",
|
18
|
+
:entries => 1
|
19
|
+
},
|
20
|
+
{
|
21
|
+
:name => "B",
|
22
|
+
:entries => 2
|
23
|
+
},
|
24
|
+
{
|
25
|
+
:name => "C",
|
26
|
+
:entries => 3
|
27
|
+
}
|
28
|
+
]
|
29
|
+
}
|
30
|
+
end
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'appboard'
|
3
|
+
|
4
|
+
#
|
5
|
+
# Updates Radial Gauge on Dashboard (see http://appboard.me/docs/gauge)
|
6
|
+
# Don't forget to specify your apiKey and widget identifier.
|
7
|
+
#
|
8
|
+
Appboard.push {
|
9
|
+
apiKey 'wOUpOJeOozcgPdZa'
|
10
|
+
|
11
|
+
widget('some name here') {
|
12
|
+
uid "BEMTCnwSYHQntaBS"
|
13
|
+
data do
|
14
|
+
{
|
15
|
+
:value => 80,
|
16
|
+
:minimum => 0,
|
17
|
+
:maximum => 100,
|
18
|
+
:ranges => [
|
19
|
+
{:range => 80, :fillColor => "#9ac736"},
|
20
|
+
{:range => 15, :fillColor => "#e06f0f"},
|
21
|
+
{:range => 5, :fillColor => "#fd1d25"}
|
22
|
+
]
|
23
|
+
}
|
24
|
+
end
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'appboard'
|
3
|
+
|
4
|
+
#
|
5
|
+
# Updates Singge Number on Dashboard (see http://appboard.me/docs/singlenumber)
|
6
|
+
# Don't forget to specify your apiKey and widget identifier.
|
7
|
+
#
|
8
|
+
Appboard.push {
|
9
|
+
apiKey 'wOUpOJeOozcgPdZa'
|
10
|
+
|
11
|
+
widget('some name here') {
|
12
|
+
uid "weXtrkUwSeZGvcRK"
|
13
|
+
data do
|
14
|
+
{
|
15
|
+
:current => 100
|
16
|
+
}
|
17
|
+
end
|
18
|
+
}
|
19
|
+
}
|
data/lib/appboard/bootstrap.rb
CHANGED
@@ -1,22 +1,25 @@
|
|
1
|
-
module Appboard
|
2
|
-
module Bootstrap
|
3
|
-
def default_settings
|
4
|
-
url = URI.parse(ENV["APPBOARD_API_URL"] || 'http://api.appboard.me')
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
:
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
1
|
+
module Appboard
|
2
|
+
module Bootstrap
|
3
|
+
def default_settings
|
4
|
+
url = URI.parse(ENV["APPBOARD_API_URL"] || 'http://api.appboard.me')
|
5
|
+
apiKey = ENV["APPBOARD_API_KEY"]
|
6
|
+
|
7
|
+
{
|
8
|
+
:url => url,
|
9
|
+
:apiKey => apiKey,
|
10
|
+
:version => 'v1',
|
11
|
+
:logging => false
|
12
|
+
}
|
13
|
+
rescue Object => e
|
14
|
+
raise "invalid APPBOARD_API_URL: (#{url.inspect}) #{e.class} -> #{e.message}"
|
15
|
+
end
|
16
|
+
|
17
|
+
def settings
|
18
|
+
@@settings ||= default_settings
|
19
|
+
end
|
20
|
+
|
21
|
+
def settings=(settings_hash)
|
22
|
+
@@settings = default_settings.update(settings_hash)
|
23
|
+
end
|
24
|
+
end
|
22
25
|
end
|
data/lib/appboard/version.rb
CHANGED
data/lib/appboard.rb
CHANGED
@@ -23,9 +23,9 @@ module Appboard
|
|
23
23
|
@apiKey
|
24
24
|
end
|
25
25
|
|
26
|
-
#
|
26
|
+
# Push on dashboard all defined widgets in block
|
27
27
|
#
|
28
|
-
# appboard.
|
28
|
+
# appboard.push {
|
29
29
|
# # Do stuff in here
|
30
30
|
# }
|
31
31
|
#
|
@@ -35,13 +35,13 @@ module Appboard
|
|
35
35
|
#
|
36
36
|
# Refer to default config below for how to set these as defaults
|
37
37
|
#
|
38
|
-
def
|
38
|
+
def push(options = {}, &block)
|
39
39
|
@config = settings.update(options)
|
40
|
-
|
40
|
+
|
41
41
|
self.instance_eval(&block) if block_given?
|
42
42
|
end
|
43
43
|
|
44
|
-
# Define a widget. May be called inside
|
44
|
+
# Define a widget. May be called inside push loop or separately
|
45
45
|
#
|
46
46
|
# widget('name') {
|
47
47
|
# data {
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appboard
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 17
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 3
|
10
|
+
version: 1.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- appboard.me
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-06-
|
18
|
+
date: 2011-06-30 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -79,7 +79,7 @@ dependencies:
|
|
79
79
|
version: "0"
|
80
80
|
requirement: *id004
|
81
81
|
type: :development
|
82
|
-
description: Simple and opinionated interface on top of RESTful HTTP API for pushing your data to appboard.me
|
82
|
+
description: Simple and opinionated interface on top of RESTful HTTP API for pushing your data to Dashboard on appboard.me
|
83
83
|
email: eugene@appboard.me
|
84
84
|
executables: []
|
85
85
|
|
@@ -89,13 +89,22 @@ extra_rdoc_files:
|
|
89
89
|
- LICENSE.txt
|
90
90
|
- README.md
|
91
91
|
files:
|
92
|
+
- README.md
|
93
|
+
- examples/barchart.rb
|
94
|
+
- examples/bubblechart.rb
|
95
|
+
- examples/columnchart.rb
|
96
|
+
- examples/fillergauge.rb
|
97
|
+
- examples/funnelchart.rb
|
98
|
+
- examples/linechart.rb
|
99
|
+
- examples/piechart.rb
|
100
|
+
- examples/radialgauge.rb
|
101
|
+
- examples/singlenumner.rb
|
92
102
|
- lib/appboard.rb
|
93
103
|
- lib/appboard/bootstrap.rb
|
94
104
|
- lib/appboard/rest_api.rb
|
95
105
|
- lib/appboard/version.rb
|
96
106
|
- lib/appboard/widget.rb
|
97
107
|
- LICENSE.txt
|
98
|
-
- README.md
|
99
108
|
has_rdoc: true
|
100
109
|
homepage: https://github.com/appboard/appboard
|
101
110
|
licenses: []
|
@@ -129,6 +138,6 @@ rubyforge_project:
|
|
129
138
|
rubygems_version: 1.3.7
|
130
139
|
signing_key:
|
131
140
|
specification_version: 3
|
132
|
-
summary: API interface on top of RESTful HTTP API for pushing your data to appboard.me
|
141
|
+
summary: API interface on top of RESTful HTTP API for pushing your data to Dashboard on appboard.me
|
133
142
|
test_files: []
|
134
143
|
|