task-list 0.4 → 0.5
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 +4 -4
- data/bin/tl +4 -0
- data/lib/task-list/parser.rb +11 -3
- data/lib/task-list/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ecdf05a74c6c2d7c09a9689daf5f7615da4e1ce
|
4
|
+
data.tar.gz: 4a03aff8f84e34b1c7b536a6d3994754cb6fa059
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0662d7d1a013b6237019399fa43389646dbe2f811845cab6dc7ad15940c6d5634dc2e062db54dedf518937e152563828d0a8ae8dd0fae8f53de8ec34a52684f1
|
7
|
+
data.tar.gz: c9f6f942baf8098cff9ab25279287b7326f11b1ca08ec34ca972194377db9412da3391be0c2dcea2747d340200165d6a9af37e8bc8717b51c11f14714c5fe641
|
data/bin/tl
CHANGED
@@ -12,6 +12,10 @@ OptionParser.new do |opts|
|
|
12
12
|
options[:plain] = true
|
13
13
|
end
|
14
14
|
|
15
|
+
opts.on("-d", "--directory DIRECTORY", "Specify the directory to search (default to cwd)") do |o|
|
16
|
+
options[:search_path] = o
|
17
|
+
end
|
18
|
+
|
15
19
|
opts.on("-t", "--type", "Type of tasks to list") do |o|
|
16
20
|
options[:type] = o
|
17
21
|
end
|
data/lib/task-list/parser.rb
CHANGED
@@ -2,9 +2,10 @@ require "find"
|
|
2
2
|
|
3
3
|
module TaskList
|
4
4
|
class Parser
|
5
|
-
attr_reader :files, :tasks
|
5
|
+
attr_reader :files, :tasks, :search_path
|
6
6
|
|
7
7
|
def initialize(arguments: [], options: {})
|
8
|
+
self.search_path = options[:search_path]
|
8
9
|
@plain = options[:plain] if options[:plain]
|
9
10
|
@type = options[:type].upcase if options[:type]
|
10
11
|
@files = fuzzy_find_files queries: arguments
|
@@ -12,6 +13,14 @@ module TaskList
|
|
12
13
|
VALID_TASKS.each { |t| @tasks[t.to_sym] = [] }
|
13
14
|
end
|
14
15
|
|
16
|
+
def search_path=(value)
|
17
|
+
if value.nil? || value.empty?
|
18
|
+
@search_path = "."
|
19
|
+
else
|
20
|
+
@search_path = value
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
15
24
|
# Parse all the collected files to find tasks
|
16
25
|
# and populate the tasks hash
|
17
26
|
def parse!
|
@@ -52,8 +61,7 @@ module TaskList
|
|
52
61
|
patterns = regexify queries
|
53
62
|
|
54
63
|
paths = []
|
55
|
-
|
56
|
-
Find.find('.') do |path|
|
64
|
+
Find.find(self.search_path) do |path|
|
57
65
|
paths << path unless FileTest.directory?(path)
|
58
66
|
end
|
59
67
|
|
data/lib/task-list/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: task-list
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.5'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aziz Light
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: TaskList parses source code to find code tags and list them in a terminal.
|
14
14
|
See README.md for more info.
|