yello 0.0.2 → 0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 53f59f3ce6c8b7442b08df75a3cb3a09ba8ef971
4
- data.tar.gz: 213ec88254c7f718d948d0d148971016d9a6991c
3
+ metadata.gz: aabee71da49699c3b6ff833dcb30b04f09fcea09
4
+ data.tar.gz: 0c5a39f06e3e9515b109ffacb36b41d4b62b974f
5
5
  SHA512:
6
- metadata.gz: cca7da0bbd202cd09b3967d0164e66b055f2dfd120d067e5a46f5d0321f7732884b08c58678e1d5d0100a25b6393bfbed3a78c043c8f32ae4e7b033c2d48c3d9
7
- data.tar.gz: 52cb613d4bcb5512d8da150def556d7c98a4fdc38fbe21dba9da3fefe1f1c1a03d58735c7b77faadbe4add1612b6c1dd39b1f0fb62c86a691d8bcc9aa694b031
6
+ metadata.gz: 4c4393f355eb2bc2c2efe19caad19f35df179b4122c470fab21394a4fc879729de197748f369ac7e8a8cb987e96769b658a07e07ca4e3695b21ec1075b81dd56
7
+ data.tar.gz: 953370abcb1399d5aa3d322d446b6a2dea1595ab87d848bee712820ccc16f6be5b94e4559585a3ee7e9e03a44eef4f7bedb6b4edf8ac07093f86df7fc14a9df3
data/README.md CHANGED
@@ -28,8 +28,13 @@ Not Started:
28
28
  - Have lunch with your manager
29
29
  - Get a key card
30
30
  - Attend the noob-101 workshop
31
+ # Shorthand for a simple checklist
32
+ checklist:
33
+ - item 1
34
+ - item 2
31
35
  - Submit your first bugfix:
32
36
  desc: You must fix a bug to prove your worth.
37
+ # Long form for if you need multiple checklists or custom names.
33
38
  checklists:
34
39
  - Process:
35
40
  - Write tests
@@ -32,7 +32,20 @@ module Yello
32
32
  def checklists(hash)
33
33
  (hash['checklists'] || []).map{|h|
34
34
  Checklist.new(h.keys[0], h.values[0] || [])
35
- }
35
+ }.tap do |result|
36
+ # Look for checklist shorthand if no checklists are found.
37
+ if result.empty?
38
+ result.concat checklist_shorthand(hash)
39
+ end
40
+ end
41
+ end
42
+
43
+ def checklist_shorthand(hash)
44
+ if hash['checklist']
45
+ [Checklist.new('Checklist', hash['checklist'])]
46
+ else
47
+ []
48
+ end
36
49
  end
37
50
  end
38
51
  end
data/lib/yello/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Yello
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
@@ -9,6 +9,7 @@ describe Yello do
9
9
  let(:lists) { Yello.from_yaml(File.read("#{__dir__}/test.yml")) }
10
10
  let(:cards) { lists[0].cards }
11
11
  let(:checklists) { cards[4].checklists }
12
+ let(:default_checklist){ cards[3].checklists[0] }
12
13
 
13
14
  it 'should have lists' do
14
15
  expect(lists.size).to eq 3
@@ -29,4 +30,10 @@ describe Yello do
29
30
  expect(checklists[0].items.size).to eq 4
30
31
  expect(checklists[0].items[0]).to eq 'Write tests'
31
32
  end
33
+
34
+ it 'should have a default checklist' do
35
+ expect(default_checklist).not_to eq nil
36
+ expect(default_checklist.name).to eq 'Checklist'
37
+ expect(default_checklist.items.size).to eq 2
38
+ end
32
39
  end
data/spec/test.yml CHANGED
@@ -3,7 +3,10 @@ Not Started:
3
3
  - Get an email account
4
4
  - Have lunch with your manager
5
5
  - Get a key card
6
- - Attend the noob-101 workshop
6
+ - Attend the noob-101 workshop:
7
+ checklist:
8
+ - item 1
9
+ - item 2
7
10
  - Submit your first bugfix:
8
11
  desc: You must fix a bug to prove your worth.
9
12
  checklists:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yello
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mike Shea