all_todo 0.2.1 → 0.2.2

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: 98a9c021f0f22862a142d5bf6ce3e65f133e9857
4
- data.tar.gz: 48671fc37fd8d760dc584d84b92a077851780176
3
+ metadata.gz: 192b1843267e3884b969ca256cd87a8333b36761
4
+ data.tar.gz: 9a36c427cb2cd0d0e3505d90307cd7626653c4f5
5
5
  SHA512:
6
- metadata.gz: bba1f3a72ec846d4f13a69ba049b84fef8985831cf50922b48e664259b77b8b36052c553db549dcbbb62b3ddbf41052293372e6a0da5fce962b88b7addb10ea0
7
- data.tar.gz: 4d2c5c8f9b6f11a5cb979f000ca75e439c71eb5bb33238def7d43ffdcbbc7d78814d5e78d64f643507bd47c1a5a3cd136c267d6271dac4882dbaf06f10488e74
6
+ metadata.gz: d16cd2af8a0fb7d81a524a81ed7261b7f32838032640ad21a0fe1bcca2e62a705fabfa24caef79ecece827a0c1917291956bc9e334f6f4a89d4abc33c8d7ba92
7
+ data.tar.gz: 8e2794188b6f57861e2a73683a0827a917fc0e3072bacbca08ef27b155b21c8842ab501ce2e5b3a029b50f04fb890bcb930e6f97c5453431d91e1ce826400174
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
data/lib/all_todo.rb CHANGED
@@ -17,15 +17,20 @@ class AllTodo
17
17
  lines = s.lines
18
18
  lines.shift 3
19
19
 
20
- @fields = %w(todo when duration priority status note tags)
20
+ @fields = %w( todo heading when duration priority status note tags)
21
21
  declar = "<?ph schema='sections[title]/section[#{@fields.join(',')}]'" +
22
22
  " format_masks[0]='[!todo]'?>"
23
23
 
24
- @px = PolyrexHeadings.new(declar + "\n" + lines.join).to_polyrex
24
+ # add a marker to identify the headings after parsing the records
25
25
 
26
- @px.each_recursive do |x, parent|
26
+ s2 = lines.join.gsub(/^#+\s+/,'\0:')
27
+
28
+ @px = PolyrexHeadings.new(declar + "\n" + s2).to_polyrex
29
+
30
+ @px.each_recursive do |x, parent, level|
27
31
 
28
32
  todo = x.todo
33
+
29
34
  raw_status = todo.slice!(/\[.*\]\s+/)
30
35
  x.todo = todo
31
36
 
@@ -43,6 +48,21 @@ class AllTodo
43
48
 
44
49
  end
45
50
 
51
+ # is it a heading?
52
+
53
+ heading = todo[/^:(.*)/,1]
54
+
55
+ if heading then
56
+
57
+ # does the heading contain tags?
58
+
59
+ raw_tags = heading.slice!(/\s+#.*$/)
60
+ x.tags = raw_tags[/#\s+(.*)/,1] if raw_tags
61
+ x.heading = heading
62
+ x.todo = ''
63
+
64
+ end
65
+
46
66
  end
47
67
 
48
68
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: all_todo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  4IWTpx4UfuUB+a/n3zRd7tPzfsCnbjv0WeNaOLxPEdrqrbPxdMp0ULnHMi6/cuMX
32
32
  +/4csIEIHj2yLg==
33
33
  -----END CERTIFICATE-----
34
- date: 2016-11-23 00:00:00.000000000 Z
34
+ date: 2016-11-24 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: pxrowx
metadata.gz.sig CHANGED
Binary file