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 +3 -0
- data/lib/CoffeeTags.rb +9 -2
- data/lib/CoffeeTags/version.rb +1 -1
- metadata +4 -4
data/README.md
CHANGED
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 =~
|
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!
|
data/lib/CoffeeTags/version.rb
CHANGED
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:
|
4
|
+
hash: 71
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
9
|
- 1
|
10
|
-
-
|
11
|
-
version: 0.0.1.
|
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-
|
19
|
+
date: 2011-10-10 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|