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 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{Simple tags generator for CoffeeScript}
12
- s.description = %q{CoffeeTags generates tag file for use with TagBar.vim}
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 ) for use with Vim + [TagBar plugin](https://github.com/majutsushi/tagbar)
3
+ A simple tool for generating CoffeeScript tags (Ctags compatible ).
4
4
 
5
- ![screenshot!](https://img.skitch.com/20110922-bf1dipa6kgdu2i18yr1xh8nwa3.png)
5
+ Showing only functions (right) or with variables included (left)
6
6
 
7
- It might work with other plugins/editors which can use Ctags (such as Emacs or
8
- TagList for Vim).
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 vim_config >> ~/.vimrc`
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
@@ -54,7 +54,7 @@ HELP
54
54
 
55
55
  to_print.each { |str| puts str }
56
56
 
57
- args << Dir['./**/*.coffee', './**/Cakefile'] if recursive
57
+ args += Dir['./**/*.coffee', './**/Cakefile'] if recursive
58
58
  [output, include_vars, args] unless args.empty?
59
59
  end
60
60
 
@@ -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}.*-\>/ ? 'f' : 'o'
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
 
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Coffeetags
3
- VERSION = "0.0.1.6"
3
+ VERSION = "0.0.1.7"
4
4
  end
@@ -37,3 +37,5 @@ for f in dir
37
37
  console.log f
38
38
 
39
39
  zorb = get['x=\\/f'].getLast('/woot$')
40
+
41
+ bound_func = (ok) => wat(ok)
@@ -56,3 +56,9 @@
56
56
  :kind: f
57
57
  :parent: Array
58
58
  :level: 0
59
+ - :source: 'bound_func = (ok) => wat(ok)'
60
+ :line: 41
61
+ :level: 0
62
+ :kind: f
63
+ :name: 'bound_func'
64
+ :parent: window
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: 71
4
+ hash: 69
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
9
  - 1
10
- - 6
11
- version: 0.0.1.6
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-10 00:00:00 +01:00
19
+ date: 2011-10-12 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies: []
22
22
 
23
- description: CoffeeTags generates tag file for use with TagBar.vim
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: Simple tags generator for CoffeeScript
88
+ summary: tags generator for CoffeeScript
89
89
  test_files:
90
90
  - spec/coffeetags_spec.rb
91
91
  - spec/fixtures/campfire.coffee