checkcheckit 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -82,7 +82,8 @@ class CheckCheckIt::Console
82
82
  top_level_dir = File.basename dir
83
83
  puts top_level_dir
84
84
  Dir[dir + '/*'].each do |file|
85
- puts " " + List.new(file).name
85
+ list = List.new(file)
86
+ puts " #{list.name}\t #{list.header}"
86
87
  end
87
88
  end
88
89
  end
@@ -9,6 +9,13 @@ class List
9
9
  @current_step = 0
10
10
  end
11
11
 
12
+ def header
13
+ return if @body.lines.to_a.empty?
14
+ if line = @body.lines.first.strip
15
+ line if line =~ /#/
16
+ end
17
+ end
18
+
12
19
  def to_h
13
20
  {name: @name, steps: @steps.map(&:to_h)}
14
21
  end
@@ -1,3 +1,3 @@
1
1
  module CheckCheckIt
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -5,12 +5,12 @@ class ConsoleTest < CheckCheckIt::TestCase
5
5
  super
6
6
  end
7
7
 
8
- def test_lists_orgs_and_lists
8
+ def test_lists_orgs_and_lists_with_headers
9
9
  Examples.create_grocery_list(home)
10
10
  check "list"
11
11
  assert_match(/^# Checklists\n/, output)
12
12
  assert_match(/^personal\n/, output)
13
- assert_match(/^ groceries\n/, output)
13
+ assert_match(/^ groceries\t # These be the groceries\n/, output)
14
14
  end
15
15
 
16
16
  def test_configurable_list_dir
@@ -18,7 +18,7 @@ class ConsoleTest < CheckCheckIt::TestCase
18
18
  FileUtils.mkdir_p(dir)
19
19
 
20
20
  check "list --home /foo"
21
- assert_match(/^personal\n/, output)
21
+ assert_match(/^personal\n/, output)
22
22
  end
23
23
 
24
24
 
@@ -13,6 +13,7 @@ module Examples
13
13
  dir = File.join(home, 'personal')
14
14
  FileUtils.mkdir_p(dir)
15
15
  File.open(File.join(dir, 'groceries'), 'w') do |file|
16
+ file << "# These be the groceries\n"
16
17
  file << "- pineapple \n"
17
18
  file << "- mangoes \n enhance the flavor with \n spice\n"
18
19
  file << "- fudge \n best from a place in sutter creek"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: checkcheckit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  segments:
117
117
  - 0
118
- hash: -1878263409394188210
118
+ hash: -1282752391799519508
119
119
  required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  none: false
121
121
  requirements:
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  segments:
126
126
  - 0
127
- hash: -1878263409394188210
127
+ hash: -1282752391799519508
128
128
  requirements: []
129
129
  rubyforge_project:
130
130
  rubygems_version: 1.8.23