geckoboard 0.0.5 → 0.0.6

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 509758bbaf9928f39ef6f1efb444cab8da55bf1b
4
- data.tar.gz: fab2d2a75c8e8bb39b526eff91c3c355897f4794
3
+ metadata.gz: 9d954ced2876d79d95d9e61e4b9628f1165947d7
4
+ data.tar.gz: a302a0017f62bb942f0e6f576a48480e56d4e570
5
5
  SHA512:
6
- metadata.gz: ce8e2111f4ce85f0a69057ddbfa72fa31ee9c2fc7b260164283cf655db6f9ba2a5565c66e38c84d66d21a12d1f3a27b21ae7b47aec792c3b079e3f339741e80f
7
- data.tar.gz: 81114b3a9b32e0b98a7abda4ffa48c0893185d635575de2a3090d3761ab49968dfdadd26f29f2b87c034bfaa8bacef538a3a5610793be3088cdc5638cc9fd98a
6
+ metadata.gz: 038f1028e23e7b904e336f1a0f751c384a77a4f8dffc37bb3f301d4d7702b80ec4ce643277879d0e3b4189f2d66cdb1bd39aa1eb4b540464cb3a00728aa5a7e3
7
+ data.tar.gz: e3f1b5d43c6c217e94060a31267cc00a8151f52c8784d76faf8cdbc9a4c439f50cd484c87f353b20fb8f452150457b80e86f167de1bee1a017d44927dfda0a07
data/README.md CHANGED
@@ -14,6 +14,11 @@ If you use bundler, add it to your Gemfile:
14
14
 
15
15
  ## Usage
16
16
 
17
+ ### [Number](https://developer.geckoboard.com/#number-and-secondary-stat)
18
+ ```ruby
19
+ Geckoboard.number('text', 2) # text and value
20
+ ```
21
+
17
22
  ### List item
18
23
 
19
24
  ```ruby
@@ -65,6 +70,15 @@ Geckoboard.pie([
65
70
  ])
66
71
  ```
67
72
 
73
+ ### Funnel
74
+
75
+ ```ruby
76
+ Geckoboard.funnel([
77
+ Geckoboard.funnel_item('Top funnel part', 100),
78
+ Geckoboard.funnel_item('Bottom funnel part', 50)
79
+ ])
80
+ ```
81
+
68
82
  ### Helper Methods
69
83
 
70
84
  #### Gecko Item
@@ -1,3 +1,3 @@
1
1
  class Geckoboard
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
data/lib/geckoboard.rb CHANGED
@@ -49,6 +49,14 @@ class Geckoboard
49
49
  widget item: value, max: max, min: min
50
50
  end
51
51
 
52
+ def self.funnel(funnel_items)
53
+ widget item: funnel_items
54
+ end
55
+
56
+ def self.funnel_item(label, value)
57
+ gecko_item(nil, value, { label: label })
58
+ end
59
+
52
60
  protected
53
61
 
54
62
  def self.widget(widget)
@@ -186,4 +186,32 @@ describe Geckoboard do
186
186
  end
187
187
  end
188
188
  end
189
+
190
+ describe '.funnel' do
191
+ context 'with argument' do
192
+ let(:funnel_items) { [1, 2, 3] }
193
+ let(:funnel) { Geckoboard.funnel(funnel_items) }
194
+ let(:parsed_funnel) { JSON.parse(funnel) }
195
+
196
+ it 'should have funnel item' do
197
+ expect(parsed_funnel['item']).to eq funnel_items
198
+ end
199
+ end
200
+ end
201
+
202
+ describe '.funnel_item' do
203
+ context 'with argument' do
204
+ let(:value) { 10 }
205
+ let(:label) { 'label' }
206
+ let(:funnel_item) { Geckoboard.funnel_item(label, value) }
207
+
208
+ it 'should have value' do
209
+ expect(funnel_item[:value]).to eq value
210
+ end
211
+
212
+ it 'should have label' do
213
+ expect(funnel_item[:label]).to eq label
214
+ end
215
+ end
216
+ end
189
217
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: geckoboard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nayeem Syed
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-25 00:00:00.000000000 Z
11
+ date: 2014-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler