panic_board_data 1.0.1 → 1.0.2
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 +4 -4
- data/.DS_Store +0 -0
- data/README.md +102 -16
- data/lib/panic_board_data/version.rb +1 -1
- data/panic_board_data.gemspec +3 -3
- data/samples/graphs.jpg +0 -0
- data/samples/single_value_1.jpg +0 -0
- data/samples/single_value_2.jpg +0 -0
- data/samples/tables.jpg +0 -0
- metadata +9 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 187785c2fdbc4bce731a3d75e50e507419e21860
|
|
4
|
+
data.tar.gz: 22ad3a8fad2d2b45aec4849f22dae2397590ccca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3d41bc571afe5ca3f7e90c3a0890afda31ead122a7459662039c1455614b56151ee81d8fd5359882c8179b07f209ce0e29c4db13c90435d8f421f5633eed3858
|
|
7
|
+
data.tar.gz: 88617ad930d4fd4e38e4ca6a8f7d19cba21cbe220eb8d56d871dab13ffbdcaa0430709cc1d70664d9a1f84e0ba4dd139a03c9158fd8272d48b75217f97d5a159
|
data/.DS_Store
ADDED
|
Binary file
|
data/README.md
CHANGED
|
@@ -1,29 +1,115 @@
|
|
|
1
1
|
# PanicBoardData
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
This gem exists to make it eaiser to display data on your Panic Status Board.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Usage
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
The Panic Status Board loads itself with data it pulls from the internet.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Therefore, if you want to show very custom data in your Status Board, you'll want to create a website that serves that custom data.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
With this gem, the easiest way to do this is to create a simple Sinatra application. Create a simple site that returns the output from this gem, and your custom Status Board will be good-to-go.
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
#### Tables
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+

|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
````ruby
|
|
18
|
+
# Sinatra example
|
|
19
|
+
get '/my_table' do
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
# sample images for our board
|
|
22
|
+
images = [build_image('http://tinyurl.com/mnvjm96'),
|
|
23
|
+
build_image('http://tinyurl.com/kt3hp7v')]
|
|
24
|
+
|
|
25
|
+
# special note: An array of values (like "images") will
|
|
26
|
+
# be flattened into a single value in the cell...
|
|
27
|
+
# so no need to concatenate things like rows of images.
|
|
28
|
+
data = [['Project A', "5 days", images, progress_bar_to(3)],
|
|
29
|
+
['Project B', "2 days", images[0], progress_bar_to(7)],
|
|
30
|
+
['Project C', "9 days", images[1], progress_bar_to(1)],
|
|
31
|
+
['Project D', "1 day", nil, progress_bar_to(8)]]
|
|
32
|
+
|
|
33
|
+
table = PanicBoardData::Table.new data
|
|
34
|
+
|
|
35
|
+
# optionally set the column widths
|
|
36
|
+
table.widths = [nil, 125, 100]
|
|
37
|
+
|
|
38
|
+
# return HTML necessary for import into Status Board
|
|
39
|
+
table.to_html
|
|
40
|
+
|
|
41
|
+
end
|
|
42
|
+
````
|
|
43
|
+
|
|
44
|
+
#### Graphs
|
|
45
|
+
|
|
46
|
+

|
|
47
|
+
|
|
48
|
+
````ruby
|
|
49
|
+
#another Sinatra example
|
|
50
|
+
get '/graph_example' do
|
|
51
|
+
|
|
52
|
+
# one set of data
|
|
53
|
+
hotdogs = PanicBoardData::DataSequence.new('Hotdogs')
|
|
54
|
+
hotdogs.data['Sunday'] = 4
|
|
55
|
+
hotdogs.data['Monday'] = 3
|
|
56
|
+
hotdogs.data['Tuesday'] = 4
|
|
57
|
+
hotdogs.data['Wednesday'] = 8
|
|
58
|
+
hotdogs.data['Thursday'] = 10
|
|
59
|
+
hotdogs.data['Friday'] = 11
|
|
60
|
+
hotdogs.data['Saturday'] = 2
|
|
61
|
+
|
|
62
|
+
# another set of data
|
|
63
|
+
burgers = PanicBoardData::DataSequence.new('Burgers')
|
|
64
|
+
burgers.data['Sunday'] = 1
|
|
65
|
+
burgers.data['Monday'] = 7
|
|
66
|
+
burgers.data['Tuesday'] = 5
|
|
67
|
+
burgers.data['Wednesday'] = 6
|
|
68
|
+
burgers.data['Thursday'] = 10
|
|
69
|
+
burgers.data['Friday'] = 15
|
|
70
|
+
burgers.data['Saturday'] = 5
|
|
71
|
+
|
|
72
|
+
# build the graph
|
|
73
|
+
graph = PanicBoardData::Graph.new
|
|
74
|
+
graph.title = "Purchases"
|
|
75
|
+
|
|
76
|
+
# this can be :bar or :line
|
|
77
|
+
graph.type = :bar
|
|
78
|
+
|
|
79
|
+
# add the sets of data you want to display in the graph
|
|
80
|
+
graph.data_sequences << hotdogs
|
|
81
|
+
graph.data_sequences << burgers
|
|
82
|
+
|
|
83
|
+
# return JSON necessary for import into Status Board
|
|
84
|
+
graph.to_json
|
|
85
|
+
|
|
86
|
+
end
|
|
87
|
+
````
|
|
88
|
+
|
|
89
|
+
#### Single Values
|
|
90
|
+
|
|
91
|
+
These can be really big...
|
|
92
|
+
|
|
93
|
+

|
|
94
|
+
|
|
95
|
+
````ruby
|
|
96
|
+
# yet another Sinatra example
|
|
97
|
+
get '/single_value' do
|
|
98
|
+
heading = 'How many people live in the United States?'
|
|
99
|
+
value = PanicBoardData::SingleValue.new heading, '317,044,240'
|
|
100
|
+
|
|
101
|
+
# return HTML necessary for import into Status Board
|
|
102
|
+
value.to_html
|
|
103
|
+
end
|
|
104
|
+
````
|
|
20
105
|
|
|
21
|
-
|
|
106
|
+
... or very small.
|
|
22
107
|
|
|
23
|
-
|
|
108
|
+

|
|
24
109
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
110
|
+
````ruby
|
|
111
|
+
# yet another Sinatra example
|
|
112
|
+
get '/single_value' do
|
|
113
|
+
PanicBoardData::SingleValue.new('Logins Today', 1).to_html
|
|
114
|
+
end
|
|
115
|
+
````
|
data/panic_board_data.gemspec
CHANGED
|
@@ -8,9 +8,9 @@ Gem::Specification.new do |spec|
|
|
|
8
8
|
spec.version = PanicBoardData::VERSION
|
|
9
9
|
spec.authors = ["Darren Cauthon"]
|
|
10
10
|
spec.email = ["darren@cauthon.com"]
|
|
11
|
-
spec.description = %q{Export data for Panic Board}
|
|
12
|
-
spec.summary = %q{Export data for Panic Board}
|
|
13
|
-
spec.homepage = ""
|
|
11
|
+
spec.description = %q{Export data for Panic Status Board}
|
|
12
|
+
spec.summary = %q{Export data for Panic Status Board}
|
|
13
|
+
spec.homepage = "http://www.github.com/darrencauthon/panic_board_data"
|
|
14
14
|
spec.license = "MIT"
|
|
15
15
|
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
data/samples/graphs.jpg
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
data/samples/tables.jpg
ADDED
|
Binary file
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: panic_board_data
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Darren Cauthon
|
|
@@ -94,13 +94,14 @@ dependencies:
|
|
|
94
94
|
- - '>='
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '0'
|
|
97
|
-
description: Export data for Panic Board
|
|
97
|
+
description: Export data for Panic Status Board
|
|
98
98
|
email:
|
|
99
99
|
- darren@cauthon.com
|
|
100
100
|
executables: []
|
|
101
101
|
extensions: []
|
|
102
102
|
extra_rdoc_files: []
|
|
103
103
|
files:
|
|
104
|
+
- .DS_Store
|
|
104
105
|
- .gitignore
|
|
105
106
|
- Gemfile
|
|
106
107
|
- LICENSE.txt
|
|
@@ -115,12 +116,16 @@ files:
|
|
|
115
116
|
- lib/panic_board_data/table.rb
|
|
116
117
|
- lib/panic_board_data/version.rb
|
|
117
118
|
- panic_board_data.gemspec
|
|
119
|
+
- samples/graphs.jpg
|
|
120
|
+
- samples/single_value_1.jpg
|
|
121
|
+
- samples/single_value_2.jpg
|
|
122
|
+
- samples/tables.jpg
|
|
118
123
|
- spec/panic_board_data/graph_spec.rb
|
|
119
124
|
- spec/panic_board_data/kernel_spec.rb
|
|
120
125
|
- spec/panic_board_data/single_value_spec.rb
|
|
121
126
|
- spec/panic_board_data/table_spec.rb
|
|
122
127
|
- spec/spec_helper.rb
|
|
123
|
-
homepage:
|
|
128
|
+
homepage: http://www.github.com/darrencauthon/panic_board_data
|
|
124
129
|
licenses:
|
|
125
130
|
- MIT
|
|
126
131
|
metadata: {}
|
|
@@ -143,7 +148,7 @@ rubyforge_project:
|
|
|
143
148
|
rubygems_version: 2.0.2
|
|
144
149
|
signing_key:
|
|
145
150
|
specification_version: 4
|
|
146
|
-
summary: Export data for Panic Board
|
|
151
|
+
summary: Export data for Panic Status Board
|
|
147
152
|
test_files:
|
|
148
153
|
- spec/panic_board_data/graph_spec.rb
|
|
149
154
|
- spec/panic_board_data/kernel_spec.rb
|