honkdo 0.0.0 → 0.0.1

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.
@@ -1,7 +1,5 @@
1
1
  step :grep do
2
- grep = `git grep -H -n -i TO[D]O .`
3
- unless $?.exitstatus.zero?
4
- grep = `grep -r -H -n -i TO[D]O .`
5
- end
6
- grep.gsub("--\n","")
2
+ git = File.exists? ".git/"
3
+ appendix = " -H -n -i TO[D]O ."
4
+ (git ? `git grep #{appendix}` : `grep -r #{appendix}`).gsub("--\n","")
7
5
  end
@@ -1,9 +1,10 @@
1
1
  step :print do |todos|
2
-
2
+
3
3
  last_tag, last_file = nil
4
4
  todos.each do |t|
5
5
  unless last_tag == t[:tag]
6
6
  last_tag = t[:tag]
7
+ last_file = nil
7
8
  puts last_tag
8
9
  end
9
10
  unless last_file == t[:file]
@@ -12,5 +13,5 @@ step :print do |todos|
12
13
  end
13
14
  puts " #{t[:line]}: #{t[:text]}"
14
15
  end
15
- end
16
16
 
17
+ end
@@ -1,7 +1,9 @@
1
1
  step :sort do |todos|
2
2
  todos.sort do |a,b|
3
- (a[:priority] <=> b[:priority]) * 10000 +
4
- (a[:file] <=> b[:file])
3
+ (a[:priority] <=> b[:priority]) * 1000000 +
4
+ (a[:tag] <=> b[:tag]) * 10000 +
5
+ (a[:file] <=> b[:file]) * 100 +
6
+ (a[:line] <=> b[:line])
5
7
  end
6
8
  end
7
9
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honkdo
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 0
10
- version: 0.0.0
9
+ - 1
10
+ version: 0.0.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sven