yello 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/yello/from_yaml.rb +14 -1
- data/lib/yello/version.rb +1 -1
- data/spec/from_yaml_spec.rb +7 -0
- data/spec/test.yml +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aabee71da49699c3b6ff833dcb30b04f09fcea09
|
4
|
+
data.tar.gz: 0c5a39f06e3e9515b109ffacb36b41d4b62b974f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/yello/from_yaml.rb
CHANGED
@@ -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
data/spec/from_yaml_spec.rb
CHANGED
@@ -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:
|