CoffeeTags 0.0.1.4 → 0.0.1.6

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -13,6 +13,9 @@ TagList for Vim).
13
13
  * Vim
14
14
  * [TagBar plugin](https://github.com/majutsushi/tagbar)
15
15
 
16
+ # Halp!
17
+
18
+ `coffeetags --help`
16
19
 
17
20
  # Installation
18
21
 
data/lib/CoffeeTags.rb CHANGED
@@ -21,6 +21,8 @@ module Coffeetags
21
21
  STRINGS = {
22
22
  'version' => "#{NAME} #{Coffeetags::VERSION} by #{AUTHOR} ( #{URL} )",
23
23
  'help' => <<-HELP
24
+ -R - process current directory recursively and look for all *.coffee files
25
+ --f <file> - save tags to <file>, if <file> == '-' tags get print out to STDOUT (jscatgs style)
24
26
  --version - coffeetags version
25
27
  --vim-conf - print out tagbar config for vim
26
28
  --include-vars - include objects/variables in generated tags
@@ -30,7 +32,10 @@ HELP
30
32
  class Utils
31
33
 
32
34
  def self.option_parser args
35
+ args = ['--version', '--help'] if args.empty?
36
+
33
37
  include_vars = ! args.delete('--include-vars').nil?
38
+ recursive = ! args.delete('-R').nil?
34
39
 
35
40
  output = nil
36
41
 
@@ -38,16 +43,18 @@ HELP
38
43
  output = args[ args.index('-f') + 1]
39
44
  args.delete '-f'
40
45
  args.delete output
46
+ output = nil if output == '-'
41
47
  end
42
48
 
43
49
  to_print = [].tap do |_to_print|
44
- _to_print << args.delete( '--help')
45
50
  _to_print << args.delete( '--version')
51
+ _to_print << args.delete( '--help')
46
52
  end.reject { |i| i.nil? }.map { |i| i.sub '--', ''}.map { |s| STRINGS[s] }
47
53
  ( to_print << tagbar_conf(include_vars) ) unless args.delete('--vim-conf').nil?
48
54
 
49
55
  to_print.each { |str| puts str }
50
56
 
57
+ args << Dir['./**/*.coffee', './**/Cakefile'] if recursive
51
58
  [output, include_vars, args] unless args.empty?
52
59
  end
53
60
 
@@ -61,7 +68,7 @@ HELP
61
68
 
62
69
  __out << Coffeetags::Formatter.header
63
70
 
64
- files.reject { |f| f =~ /^--/}.each do |file|
71
+ files.reject { |f| f =~ /^-/}.each do |file|
65
72
  sc = File.read file
66
73
  parser = Coffeetags::Parser.new sc, include_vars
67
74
  parser.execute!
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Coffeetags
3
- VERSION = "0.0.1.4"
3
+ VERSION = "0.0.1.6"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: CoffeeTags
3
3
  version: !ruby/object:Gem::Version
4
- hash: 67
4
+ hash: 71
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
9
  - 1
10
- - 4
11
- version: 0.0.1.4
10
+ - 6
11
+ version: 0.0.1.6
12
12
  platform: ruby
13
13
  authors:
14
14
  - "\xC5\x81ukasz Korecki"
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-10-06 00:00:00 +01:00
19
+ date: 2011-10-10 00:00:00 +01:00
20
20
  default_executable:
21
21
  dependencies: []
22
22