task-list 0.3.1 → 0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bfe656ba73537650b1cdbc55a60aa6fa3dea0a3d
4
- data.tar.gz: 67498a55aad7100e218e0f7bfac5f4e8ecd64641
3
+ metadata.gz: f810f7a8f3caac1fa3fd505a1145fb7d3c26d359
4
+ data.tar.gz: ca797339f20080c53f3411778fdc8b595c5e7335
5
5
  SHA512:
6
- metadata.gz: ef820b23ba7a81321907635b7e3d82c45343eac4431b22dde28dbfaeae3b141cdea4df3f4945d7b55d2c2fec5f8cb0d5a69d38f64c77a981dc4c076215705ef2
7
- data.tar.gz: 1ccbb0134885467b76e8ae556ec7bd49c4f529487d7531b04446cac81cd128108571320efdf580aac30e2f658fd472d0b8ffb438480e1b4aa8adeb1cebb72748
6
+ metadata.gz: 60c4656630e430c3b811bc038f85463424dc1f4a32ba80d23694f170172086b4980abc59e21f8a0863d82fb7a00e3b80a627812efee95ce7994be169514b215c
7
+ data.tar.gz: f15a7e1ef88be707b1e12e9b8746862416b6d7dc51334fd80d145974305c5c1e5dd5f2f548f3949f19e5774e324020a70ee6d2568c886e044d72fedcd61b1dcd
@@ -1,25 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- task-list (0.1)
4
+ task-list (0.3)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
8
8
  specs:
9
- guard (0.8.8)
10
- thor (~> 0.14.6)
11
- guard-minitest (0.4.0)
12
- guard (~> 0.4)
13
- rb-fsevent (0.4.3.1)
14
- ruby_gntp (0.3.4)
15
- thor (0.14.6)
16
9
 
17
10
  PLATFORMS
18
11
  ruby
19
12
 
20
13
  DEPENDENCIES
21
- guard
22
- guard-minitest
23
- rb-fsevent
24
- ruby_gntp
25
14
  task-list!
data/bin/tl CHANGED
@@ -8,6 +8,10 @@ options = {}
8
8
  OptionParser.new do |opts|
9
9
  opts.banner = "Usage: tl [<query>] [<option> ...]"
10
10
 
11
+ opts.on("-p", "--plain", "No colours in the output") do
12
+ options[:plain] = true
13
+ end
14
+
11
15
  opts.on("-t", "--type", "Type of tasks to list") do |o|
12
16
  options[:type] = o
13
17
  end
@@ -5,8 +5,8 @@ module TaskList
5
5
  attr_reader :files, :tasks
6
6
 
7
7
  def initialize(arguments: [], options: {})
8
+ @plain = options[:plain] if options[:plain]
8
9
  @type = options[:type].upcase if options[:type]
9
- # @files = fuzzy_find_files queries: arguments unless arguments.empty?
10
10
  @files = fuzzy_find_files queries: arguments
11
11
  @tasks = {}
12
12
  VALID_TASKS.each { |t| @tasks[t.to_sym] = [] }
@@ -29,7 +29,12 @@ module TaskList
29
29
 
30
30
  tasks.each do |task|
31
31
  puts task[:task]
32
- puts " \e[30m\e[1mline #{task[:line_number]} in #{task[:file]}\e[0m"
32
+
33
+ if self.plain?
34
+ puts " line #{task[:line_number]} in #{task[:file]}"
35
+ else
36
+ puts " \e[30m\e[1mline #{task[:line_number]} in #{task[:file]}\e[0m"
37
+ end
33
38
  end
34
39
 
35
40
  puts
@@ -37,6 +42,10 @@ module TaskList
37
42
  end
38
43
  end
39
44
 
45
+ def plain?
46
+ !!@plain
47
+ end
48
+
40
49
  private
41
50
 
42
51
  def fuzzy_find_files(queries: [])
@@ -48,7 +57,7 @@ module TaskList
48
57
  paths << path unless FileTest.directory?(path)
49
58
  end
50
59
 
51
- paths.map! { |p| p.gsub /\A\.\//, "" }
60
+ paths.map! { |p| p.gsub(/\A\.\//, "") }
52
61
 
53
62
  EXCLUDED_DIRECTORIES.each do |d|
54
63
  paths.delete_if { |p| p =~ /\A#{Regexp.escape(d)}/ }
@@ -173,7 +182,7 @@ module TaskList
173
182
  line_number = 1
174
183
  while line = f.gets
175
184
  types.each do |type|
176
- result = line.match /#{Regexp.escape(type)}[\s,:-]+(\S.*)\Z/ rescue nil
185
+ result = line.match(/#{Regexp.escape(type)}[\s,:-]+(\S.*)\Z/) rescue nil
177
186
 
178
187
  unless result.nil?
179
188
  task = {
@@ -1,3 +1,3 @@
1
1
  module TaskList
2
- VERSION = "0.3.1"
2
+ VERSION = "0.4"
3
3
  end
@@ -10,6 +10,7 @@ Gem::Specification.new do |s|
10
10
  s.homepage = "https://github.com/AzizLight/TaskList"
11
11
  s.summary = %q{Code tasks parser and lister}
12
12
  s.description = %q{TaskList parses source code to find code tags and list them in a terminal. See README.md for more info.}
13
+ s.license = "MIT"
13
14
 
14
15
  s.files = `git ls-files`.split("\n")
15
16
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
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.3.1
4
+ version: '0.4'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aziz Light
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-12-28 00:00:00.000000000 Z
11
+ date: 2014-05-21 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.
@@ -19,7 +19,7 @@ executables:
19
19
  extensions: []
20
20
  extra_rdoc_files: []
21
21
  files:
22
- - .gitignore
22
+ - ".gitignore"
23
23
  - Gemfile
24
24
  - Gemfile.lock
25
25
  - LICENSE.md
@@ -33,7 +33,8 @@ files:
33
33
  - lib/task-list/version.rb
34
34
  - task-list.gemspec
35
35
  homepage: https://github.com/AzizLight/TaskList
36
- licenses: []
36
+ licenses:
37
+ - MIT
37
38
  metadata: {}
38
39
  post_install_message:
39
40
  rdoc_options: []
@@ -41,17 +42,17 @@ require_paths:
41
42
  - lib
42
43
  required_ruby_version: !ruby/object:Gem::Requirement
43
44
  requirements:
44
- - - '>='
45
+ - - ">="
45
46
  - !ruby/object:Gem::Version
46
47
  version: '0'
47
48
  required_rubygems_version: !ruby/object:Gem::Requirement
48
49
  requirements:
49
- - - '>='
50
+ - - ">="
50
51
  - !ruby/object:Gem::Version
51
52
  version: '0'
52
53
  requirements: []
53
54
  rubyforge_project:
54
- rubygems_version: 2.0.14
55
+ rubygems_version: 2.2.2
55
56
  signing_key:
56
57
  specification_version: 4
57
58
  summary: Code tasks parser and lister