CoffeeTags 0.0.1.6 → 0.0.1.7
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.
- data/CoffeeTags.gemspec +2 -2
- data/README.md +23 -5
- data/lib/CoffeeTags.rb +1 -1
- data/lib/CoffeeTags/parser.rb +1 -2
- data/lib/CoffeeTags/version.rb +1 -1
- data/spec/fixtures/test.coffee +2 -0
- data/spec/fixtures/test_tree.yaml +6 -0
- data/spec/parser_spec.rb +5 -0
- metadata +6 -6
data/CoffeeTags.gemspec
CHANGED
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
|
|
8
8
|
s.authors = ["Łukasz Korecki"]
|
9
9
|
s.email = ["lukasz@coffeesounds.com"]
|
10
10
|
s.homepage = "http://github.com/lukaszkorecki/CoffeeTags"
|
11
|
-
s.summary = %q{
|
12
|
-
s.description = %q{CoffeeTags generates
|
11
|
+
s.summary = %q{tags generator for CoffeeScript}
|
12
|
+
s.description = %q{CoffeeTags generates ctags compatibile tags for CoffeeScript.}
|
13
13
|
|
14
14
|
s.rubyforge_project = "CoffeeTags"
|
15
15
|
|
data/README.md
CHANGED
@@ -1,22 +1,40 @@
|
|
1
1
|
# CoffeeTags
|
2
2
|
|
3
|
-
A simple tool for generating tags (Ctags compatible )
|
3
|
+
A simple tool for generating CoffeeScript tags (Ctags compatible ).
|
4
4
|
|
5
|
-
|
5
|
+
Showing only functions (right) or with variables included (left)
|
6
6
|
|
7
|
-
|
8
|
-
|
7
|
+
|
8
|
+
<div class="thumbnail">
|
9
|
+
|
10
|
+
<a href="http://skitch.com/plugawy/gyfnb/1-coffeetags-1-vim-unicorn.local-tmux"><img src="http://img.skitch.com/20111012-8cjesum8ru8usqusra4yppj5cc.preview.png" alt="1. CoffeeTags:1:vim - "unicorn.local" (tmux)" /></a><br /><span>Uploaded with <a href="http://skitch.com">Skitch</a>!</span>
|
11
|
+
|
12
|
+
</div>
|
13
|
+
|
14
|
+
Designed for use with Vim + [TagBar plugin](https://github.com/majutsushi/tagbar) but also works without it. Simply configure your Vim for use with a regular tags file and generate them with the following command:
|
15
|
+
|
16
|
+
`coffeetags -R -f TAGS`
|
9
17
|
|
10
18
|
# Requirements
|
11
19
|
|
12
20
|
* ruby (either 1.8.7 or 1.9.2)
|
13
21
|
* Vim
|
22
|
+
|
23
|
+
### optional
|
24
|
+
|
14
25
|
* [TagBar plugin](https://github.com/majutsushi/tagbar)
|
15
26
|
|
16
27
|
# Halp!
|
17
28
|
|
18
29
|
`coffeetags --help`
|
19
30
|
|
31
|
+
-R - process current directory recursively and look for all *.coffee files
|
32
|
+
--f <file> - save tags to <file>, if <file> == '-' tags get print out to STDOUT (jscatgs style)
|
33
|
+
--version - coffeetags version
|
34
|
+
--vim-conf - print out tagbar config for vim
|
35
|
+
--include-vars - include objects/variables in generated tags
|
36
|
+
combine --vim-conf and --include-vars to create a config which adds '--include-vars' option
|
37
|
+
|
20
38
|
# Installation
|
21
39
|
|
22
40
|
* get the `coffeetags` tool
|
@@ -26,7 +44,7 @@ TagList for Vim).
|
|
26
44
|
|
27
45
|
* add TagBar config to your .vimrc
|
28
46
|
|
29
|
-
`coffeetags
|
47
|
+
`coffeetags --vim-conf >> ~/.vimrc` (or `coffeetags --vim-conf --include-vars >> ~/.vimrc`)
|
30
48
|
|
31
49
|
* open your coffeescript file and open TagBar.
|
32
50
|
|
data/lib/CoffeeTags.rb
CHANGED
data/lib/CoffeeTags/parser.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
require 'yaml'
|
2
1
|
module Coffeetags
|
3
2
|
class Parser
|
4
3
|
attr_reader :tree
|
@@ -92,7 +91,7 @@ module Coffeetags
|
|
92
91
|
is_previous_not_the_same = !(@tree.last and @tree.last[:name] == o[:name] and @tree.last[:level] == o[:level])
|
93
92
|
|
94
93
|
if is_in_string.nil? and is_in_comparison.nil? and has_blank_parent.nil? and is_previous_not_the_same
|
95
|
-
o[:kind] = line =~ /[:=]{1}
|
94
|
+
o[:kind] = line =~ /[:=]{1}.*[-=]\>/ ? 'f' : 'o'
|
96
95
|
o[:parent] = scope_path o
|
97
96
|
o[:parent] = @fake_parent if o[:parent].empty?
|
98
97
|
|
data/lib/CoffeeTags/version.rb
CHANGED
data/spec/fixtures/test.coffee
CHANGED
data/spec/parser_spec.rb
CHANGED
@@ -121,6 +121,11 @@ describe 'CoffeeTags::Parser' do
|
|
121
121
|
pro[:parent].should == '_loop.element'
|
122
122
|
|
123
123
|
end
|
124
|
+
it "detects a fat arrow function" do
|
125
|
+
c =@parser_test.tree.find { |i| i[:name] == 'bound_func'}
|
126
|
+
c.should == @test_tree.find {|i| i[:name] == 'bound_func'}
|
127
|
+
|
128
|
+
end
|
124
129
|
|
125
130
|
it "extracts a method defined in a prototype" do
|
126
131
|
pending 'methods defined on prototype needs implementing'
|
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: 69
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
9
|
- 1
|
10
|
-
-
|
11
|
-
version: 0.0.1.
|
10
|
+
- 7
|
11
|
+
version: 0.0.1.7
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- "\xC5\x81ukasz Korecki"
|
@@ -16,11 +16,11 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-10-
|
19
|
+
date: 2011-10-12 00:00:00 +02:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|
23
|
-
description: CoffeeTags generates
|
23
|
+
description: CoffeeTags generates ctags compatibile tags for CoffeeScript.
|
24
24
|
email:
|
25
25
|
- lukasz@coffeesounds.com
|
26
26
|
executables:
|
@@ -85,7 +85,7 @@ rubyforge_project: CoffeeTags
|
|
85
85
|
rubygems_version: 1.5.0
|
86
86
|
signing_key:
|
87
87
|
specification_version: 3
|
88
|
-
summary:
|
88
|
+
summary: tags generator for CoffeeScript
|
89
89
|
test_files:
|
90
90
|
- spec/coffeetags_spec.rb
|
91
91
|
- spec/fixtures/campfire.coffee
|