geckoboard 0.0.7 → 0.0.8

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: 95e22c79f5e1af580025727b0894c1c7c1ea17e2
4
- data.tar.gz: 0af27b9e8441407b7dc2c9fda89066014bf3217f
3
+ metadata.gz: 87e25e2c0cfce9529db9931769ca803b1c79ef2d
4
+ data.tar.gz: 106fc4c18c1f8733476ea6caddd8172672baf5b6
5
5
  SHA512:
6
- metadata.gz: da1cfb50f759538d231e5c25162c11129808cde651b4cf3236897d987ea99bf9427b53cdb6d3d69be31a181ba78aaceed115fd10c6f1538693a4d49fca8ba881
7
- data.tar.gz: f827c9af8d49920f05f5926756461e63c65d4c168caa259d4fd0b7ae59e5f2f51e7e166d001c0bf2ba451634f17b5c6d2f0397603001a61632bcbb3c7d185eb7
6
+ metadata.gz: 3c1b9ba6f324c81fa075d9f8f11c43a0d77ca7a0210da944d884814f2b86ed8a042aa5841e4ffa6695ef3dc7d35e820f38b4ba45f4c18fe4a1fb4a7ad82bfa7a
7
+ data.tar.gz: 4ab15232cf88bba859b3b545f5b3ccd3d0b92790c9b1f78663fff6bcc8ba1e2053a2ea3e8ea9c2edd6ea6db4da0bef7f5f87b39c38f078466159e1ab21ad828e
data/README.md CHANGED
@@ -19,6 +19,11 @@ If you use bundler, add it to your Gemfile:
19
19
  Geckoboard.number('text', 2) # text and value
20
20
  ```
21
21
 
22
+ ### Text
23
+ ```ruby
24
+ Geckoboard.text('text value', type: 2) # text value and optional attributes
25
+ ```
26
+
22
27
  ### List item
23
28
 
24
29
  ```ruby
data/lib/geckoboard.rb CHANGED
@@ -22,6 +22,12 @@ class Geckoboard
22
22
  ]
23
23
  end
24
24
 
25
+ def self.text(text_value, other_attributes = {})
26
+ widget item: [
27
+ gecko_item(text_value, nil, other_attributes)
28
+ ]
29
+ end
30
+
25
31
  def self.comparison(first, second)
26
32
  widget item: [
27
33
  gecko_item('', first),
@@ -1,3 +1,3 @@
1
1
  class Geckoboard
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
@@ -85,6 +85,23 @@ describe Geckoboard do
85
85
  end
86
86
  end
87
87
 
88
+ describe '.text' do
89
+ context 'with arguments' do
90
+ let(:text_value) { 'text' }
91
+ let(:type) { 2 }
92
+ let(:text) { Geckoboard.text(text_value, type: type) }
93
+ let(:parsed_text) { JSON.parse(text) }
94
+
95
+ it 'should have text value' do
96
+ expect(parsed_text['item'].first['text']).to eq text_value
97
+ end
98
+
99
+ it 'should have type' do
100
+ expect(parsed_text['item'].first['type']).to eq type
101
+ end
102
+ end
103
+ end
104
+
88
105
  describe '.comparison' do
89
106
  context 'with arguments' do
90
107
  let(:first) { 1 }
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.7
4
+ version: 0.0.8
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-07-11 00:00:00.000000000 Z
11
+ date: 2014-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler