CoffeeTags 0.1.7 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/README.md +31 -45
- data/lib/CoffeeTags/version.rb +1 -1
- data/lib/CoffeeTags.rb +0 -13
- data/plugin/coffee-autotag.vim +82 -0
- data/spec/fixtures/append-expected.ctags +1 -1
- data/spec/fixtures/append.ctags +2 -2
- data/spec/fixtures/blockcomment.ctags +1 -1
- data/spec/fixtures/campfire.js.tags +1 -1
- data/spec/fixtures/out.test-relative-append.ctags +2 -2
- data/spec/fixtures/out.test-relative.ctags +1 -1
- data/spec/fixtures/out.test-two.ctags +1 -1
- data/spec/fixtures/out.test.ctags +1 -1
- metadata +2 -2
- data/vim/tagbar-coffee.vim.erb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA512:
|
3
|
-
|
4
|
-
|
3
|
+
metadata.gz: 91f1d33e4b9f60700b8ad9f8c08623dc40c4430261779c8f96af4727ff8c9c2f7b61747f8c2e6554c47d14cdd8a4dec31cd3e7a74484ea9c835386fcb056902f
|
4
|
+
data.tar.gz: 2ca1695728468889e80d42e6af100d5be7529ca4d35c7427e908861f5c5aafdcffbe3c0a342a783031b205a2da78e745f903320c9a5284f01b408c537218c01f
|
5
5
|
SHA1:
|
6
|
-
|
7
|
-
|
6
|
+
metadata.gz: 09f5e25db80c8a227e51a6c0e17014419c7c5e73
|
7
|
+
data.tar.gz: 36379f4c63b53f19c6864533135ab9b4e7bb1950
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
# CoffeeTags
|
2
2
|
|
3
|
-
### Latest version: `0.1
|
3
|
+
### Latest version: `0.2.1`
|
4
4
|
|
5
5
|
A simple tool for generating CoffeeScript tags (Ctags compatible).
|
6
6
|
|
7
7
|
[![Build Status](https://secure.travis-ci.org/lukaszkorecki/CoffeeTags.png?branch=master)](http://travis-ci.org/lukaszkorecki/CoffeeTags)
|
8
8
|
|
9
|
-
|
10
9
|
### [Watch a quick demo](http://ascii.io/a/26)
|
11
10
|
|
12
11
|
### Example + Screenshot
|
@@ -38,23 +37,46 @@ will generate standard TAGS file which later can be used with Vim (standard `:ta
|
|
38
37
|
|
39
38
|
Just use `coffeetags --help`
|
40
39
|
|
41
|
-
#
|
40
|
+
# Ruby Gem
|
41
|
+
|
42
|
+
## Installation
|
43
|
+
|
44
|
+
`gem install CoffeeTags`
|
45
|
+
|
46
|
+
## Usage
|
47
|
+
|
48
|
+
`$ coffeetags --help`
|
49
|
+
|
50
|
+
# Vim
|
51
|
+
|
52
|
+
This can also be used as a vim plugin that will update tag files on save, and support visualization with [TagBar](https://github.com/majutsushi/tagbar). You will still need to install the gem as described above as well as install the plugin to vim. You can install it via:
|
42
53
|
|
43
|
-
|
54
|
+
## Install
|
44
55
|
|
45
|
-
|
56
|
+
* [Pathogen](https://github.com/tpope/vim-pathogen)
|
57
|
+
* `git clone https://github.com/lukaszkorecki/CoffeeTags ~/.vim/bundle/CoffeeTags`
|
58
|
+
* [NeoBundle](https://github.com/Shougo/neobundle.vim)
|
59
|
+
* `NeoBundle 'lukaszkorecki/CoffeeTags'`
|
60
|
+
* [Vundle](https://github.com/gmarik/vundle)
|
61
|
+
* `Bundle 'lukaszkorecki/CoffeeTags'`
|
62
|
+
* manual
|
63
|
+
* copy all of the files into your `~/.vim` directory
|
46
64
|
|
65
|
+
## Configuration
|
47
66
|
|
48
|
-
|
49
|
-
* add TagBar config to your .vimrc
|
67
|
+
In you `~/.vimrc` you can configure the plugin with:
|
50
68
|
|
51
|
-
|
69
|
+
```
|
70
|
+
let g:CoffeeAutoDisabled=<0 or 1> " Disables autotaging on save (Default: 0 [false])
|
71
|
+
let g:CoffeeAutoTagFile=<filename> " Name of the generated tag file (Default: ./tags)
|
72
|
+
let g:CoffeeAutoTagIncludeVars=<0 or 1> " Includes variables (Default: 0 [false])
|
73
|
+
let g:CoffeeAutoTagTagRelative=<0 or 1> " Sets file names to the relative path from the tag file location to the tag file location (Default: 1 [true])
|
74
|
+
```
|
52
75
|
|
53
76
|
## Sublime Text
|
54
77
|
|
55
78
|
*TODO* - I don't use ST myself, but PRs with HOWTO are welcomed
|
56
79
|
|
57
|
-
|
58
80
|
## Config types
|
59
81
|
|
60
82
|
CoffeeTags can work in 2 modes:
|
@@ -64,49 +86,13 @@ CoffeeTags can work in 2 modes:
|
|
64
86
|
|
65
87
|
Second mode is activated by adding `--include-vars` to command line arguments
|
66
88
|
|
67
|
-
# CoffeeTags + TagBar + Vim
|
68
|
-
|
69
|
-
## Config in vimrc
|
70
|
-
|
71
|
-
You can add the config to your .vimrc (making sure that the old one is removed)
|
72
|
-
by:
|
73
|
-
|
74
|
-
coffeetags --vim-conf >> ~/.vimrc
|
75
|
-
|
76
|
-
or (for 2nd mode)
|
77
|
-
|
78
|
-
coffeetags --include-vars --vim-conf >> ~/.vimrc
|
79
|
-
|
80
|
-
|
81
|
-
## Config as a filetype plugin
|
82
|
-
|
83
|
-
You can generate a special filetype plugin and tagbar will use that
|
84
|
-
automatically.
|
85
|
-
|
86
|
-
This option is preferable if you want to keep your vimrc short.
|
87
|
-
|
88
|
-
coffeetags --vim-conf > ~/.vim/ftplugin/coffee/tagbar-coffee.vim
|
89
|
-
coffeetags [--include-vars] --vim-conf > ~/.vim/ftplugin/coffee/tagbar-coffee.vim
|
90
|
-
|
91
|
-
or if you're using pathogen
|
92
|
-
|
93
|
-
coffeetags [--include-vars] --vim-conf > ~/.vim/bundle/coffeetags/ftplugin/coffee/tagbar-coffee.vim
|
94
|
-
coffeetags --vim-conf > ~/.vim/bundle/coffeetags/ftplugin/coffee/tagbar-coffee.vim
|
95
|
-
|
96
|
-
|
97
|
-
* open your coffeescript file and open TagBar.
|
98
|
-
|
99
|
-
Done!
|
100
|
-
|
101
89
|
# TODO
|
102
90
|
|
103
91
|
- squash all bugs
|
104
92
|
|
105
|
-
|
106
93
|
# License
|
107
94
|
|
108
95
|
MIT
|
109
96
|
|
110
|
-
|
111
97
|
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/lukaszkorecki/coffeetags/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
|
112
98
|
|
data/lib/CoffeeTags/version.rb
CHANGED
data/lib/CoffeeTags.rb
CHANGED
@@ -22,14 +22,6 @@ module Coffeetags
|
|
22
22
|
URL = "https://github.com/lukaszkorecki/CoffeeTags"
|
23
23
|
|
24
24
|
class Utils
|
25
|
-
def self.tagbar_conf include_vars
|
26
|
-
include_vars_opt = include_vars ? "--include-vars" : ''
|
27
|
-
|
28
|
-
tmpl_file = File.read(File.expand_path("../../vim/tagbar-coffee.vim.erb", __FILE__))
|
29
|
-
tmpl = ERB.new(tmpl_file)
|
30
|
-
|
31
|
-
tmpl.result(binding)
|
32
|
-
end
|
33
25
|
|
34
26
|
def self.option_parser args
|
35
27
|
args << '-h' if args.empty?
|
@@ -69,11 +61,6 @@ module Coffeetags
|
|
69
61
|
options[:tag_relative] = true
|
70
62
|
end
|
71
63
|
|
72
|
-
opts.on('--vim-conf', 'Generate TagBar config (more info https://gist.github.com/1935512 )') do
|
73
|
-
puts tagbar_conf options[:include_vars]
|
74
|
-
exit
|
75
|
-
end
|
76
|
-
|
77
64
|
opts.on('-v', '--version', 'Current version') do
|
78
65
|
puts Coffeetags::VERSION
|
79
66
|
exit
|
@@ -0,0 +1,82 @@
|
|
1
|
+
if exists("g:loaded_coffee_autotag")
|
2
|
+
finish
|
3
|
+
endif
|
4
|
+
|
5
|
+
let g:loaded_coffee_autotag=1
|
6
|
+
|
7
|
+
if !has("ruby")
|
8
|
+
echohl WarningMsg
|
9
|
+
echo "Coffee auto tag requires Vim to be compiled with Ruby support"
|
10
|
+
echohl none
|
11
|
+
finish
|
12
|
+
endif
|
13
|
+
|
14
|
+
let s:CoffeeAutoTagFile="./tags"
|
15
|
+
let s:CoffeeAutoTagIncludeVars=0
|
16
|
+
let s:CoffeeAutoTagTagRelative=1
|
17
|
+
|
18
|
+
if !exists("g:CoffeeAutoTagDisabled")
|
19
|
+
let g:CoffeeAutoTagDisabled = 0
|
20
|
+
endif
|
21
|
+
|
22
|
+
if exists("g:CoffeeAutoTagFile")
|
23
|
+
let s:CoffeeAutoTagFile = g:CoffeeAutoTagFile
|
24
|
+
endif
|
25
|
+
|
26
|
+
if exists("g:CoffeeAutoTagIncludeVars")
|
27
|
+
let s:CoffeeAutoTagIncludeVars = g:CoffeeAutoTagIncludeVars
|
28
|
+
endif
|
29
|
+
|
30
|
+
if exists("g:CoffeeAutoTagTagRelative")
|
31
|
+
let s:CoffeeAutoTagTagRelative = g:CoffeeAutoTagTagRelative
|
32
|
+
endif
|
33
|
+
|
34
|
+
if s:CoffeeAutoTagIncludeVars
|
35
|
+
let s:raw_args="--include-vars"
|
36
|
+
else
|
37
|
+
let s:raw_args=""
|
38
|
+
endif
|
39
|
+
|
40
|
+
let g:tagbar_type_coffee = {
|
41
|
+
\ 'ctagsbin' : 'coffeetags',
|
42
|
+
\ 'ctagsargs' : s:raw_args,
|
43
|
+
\ 'kinds' : [
|
44
|
+
\ 'f:functions',
|
45
|
+
\ 'o:object',
|
46
|
+
\ ],
|
47
|
+
\ 'sro' : ".",
|
48
|
+
\ 'kind2scope' : {
|
49
|
+
\ 'f' : 'object',
|
50
|
+
\ 'o' : 'object',
|
51
|
+
\ }
|
52
|
+
\ }
|
53
|
+
|
54
|
+
|
55
|
+
function! CoffeeAutoTag()
|
56
|
+
if g:CoffeeAutoTagDisabled
|
57
|
+
finish
|
58
|
+
endif
|
59
|
+
|
60
|
+
let cmd = 'coffeetags --append -f ' . s:CoffeeAutoTagFile . ' '
|
61
|
+
|
62
|
+
if s:CoffeeAutoTagIncludeVars
|
63
|
+
let cmd .= '--include-vars '
|
64
|
+
endif
|
65
|
+
|
66
|
+
if s:CoffeeAutoTagTagRelative
|
67
|
+
let cmd .= '--tag-relative '
|
68
|
+
endif
|
69
|
+
|
70
|
+
let cmd .= expand("%:p")
|
71
|
+
|
72
|
+
let output = system(cmd)
|
73
|
+
|
74
|
+
if exists(":TlistUpdate")
|
75
|
+
TlistUpdate
|
76
|
+
endif
|
77
|
+
endfunction
|
78
|
+
|
79
|
+
augroup CoffeeAutoTag
|
80
|
+
au!
|
81
|
+
autocmd BufWritePost,FileWritePost *.coffee call CoffeeAutoTag()
|
82
|
+
augroup END
|
@@ -3,7 +3,7 @@
|
|
3
3
|
!_TAG_PROGRAM_AUTHOR Łukasz Korecki /lukasz@coffeesounds.com/
|
4
4
|
!_TAG_PROGRAM_NAME CoffeeTags //
|
5
5
|
!_TAG_PROGRAM_URL https://github.com/lukaszkorecki/CoffeeTags /GitHub repository/
|
6
|
-
!_TAG_PROGRAM_VERSION 0.1
|
6
|
+
!_TAG_PROGRAM_VERSION 0.2.1 //
|
7
7
|
@filter spec/fixtures/test.coffee /^ @filter = ->$/;" f lineno:14 object:Wat.ho type:function
|
8
8
|
_loop spec/fixtures/test.coffee /^_loop = (x) ->$/;" f lineno:19 object:window type:function
|
9
9
|
baz spec/fixtures/blockcomment.coffee /^baz : (x, y) ->$/;" f lineno:15 object:window type:function
|
data/spec/fixtures/append.ctags
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
!_TAG_PROGRAM_AUTHOR Łukasz Korecki /lukasz@coffeesounds.com/
|
4
4
|
!_TAG_PROGRAM_NAME CoffeeTags //
|
5
5
|
!_TAG_PROGRAM_URL https://github.com/lukaszkorecki/CoffeeTags /GitHub repository/
|
6
|
-
!_TAG_PROGRAM_VERSION 0.1
|
7
|
-
!_TAG_PROGRAM_VERSION 0.1
|
6
|
+
!_TAG_PROGRAM_VERSION 0.2.1 //
|
7
|
+
!_TAG_PROGRAM_VERSION 0.2.1 //
|
8
8
|
!_THIS_LINE_SHOULD_GET_REMOVED Nothing to see here //
|
9
9
|
@filter spec/fixtures/test.coffee /^ @filter = ->$/;" f lineno:14 object:Wat.ho type:function
|
10
10
|
_loop spec/fixtures/test.coffee /^_loop = (x) ->$/;" f lineno:19 object:window type:function
|
@@ -3,7 +3,7 @@
|
|
3
3
|
!_TAG_PROGRAM_AUTHOR Łukasz Korecki /lukasz@coffeesounds.com/
|
4
4
|
!_TAG_PROGRAM_NAME CoffeeTags //
|
5
5
|
!_TAG_PROGRAM_URL https://github.com/lukaszkorecki/CoffeeTags /GitHub repository/
|
6
|
-
!_TAG_PROGRAM_VERSION 0.1
|
6
|
+
!_TAG_PROGRAM_VERSION 0.2.1 //
|
7
7
|
baz spec/fixtures/blockcomment.coffee /^baz : (x, y) ->$/;" f lineno:15 object:window type:function
|
8
8
|
echo2 spec/fixtures/blockcomment.coffee /^echo2 :-> console.log 'echo'$/;" f lineno:7 object:window type:function
|
9
9
|
echo3 spec/fixtures/blockcomment.coffee /^echo3 :-> console.log 'echo'$/;" f lineno:23 object:window type:function
|
@@ -3,7 +3,7 @@
|
|
3
3
|
!_TAG_PROGRAM_AUTHOR Łukasz Korecki /lukasz@coffeesounds.com/
|
4
4
|
!_TAG_PROGRAM_NAME CoffeeTags //
|
5
5
|
!_TAG_PROGRAM_URL https://github.com/lukaszkorecki/CoffeeTags /GitHub repository/
|
6
|
-
!_TAG_PROGRAM_VERSION 0.1
|
6
|
+
!_TAG_PROGRAM_VERSION 0.2.1 //
|
7
7
|
bump spec/fixtures/campfire.coffee /^ bump : ->$/;" f lineno:46 object:Test type:function
|
8
8
|
constructor spec/fixtures/campfire.coffee /^ constructor: (api_key, host) ->$/;" f lineno:8 object:Campfire type:function
|
9
9
|
handlers spec/fixtures/campfire.coffee /^ handlers: (callbacks) ->$/;" f lineno:14 object:Campfire type:function
|
@@ -3,8 +3,8 @@
|
|
3
3
|
!_TAG_PROGRAM_AUTHOR Łukasz Korecki /lukasz@coffeesounds.com/
|
4
4
|
!_TAG_PROGRAM_NAME CoffeeTags //
|
5
5
|
!_TAG_PROGRAM_URL https://github.com/lukaszkorecki/CoffeeTags /GitHub repository/
|
6
|
-
!_TAG_PROGRAM_VERSION 0.1
|
7
|
-
!_TAG_PROGRAM_VERSION 0.1
|
6
|
+
!_TAG_PROGRAM_VERSION 0.2.1 //
|
7
|
+
!_TAG_PROGRAM_VERSION 0.2.1 //
|
8
8
|
!_THIS_LINE_SHOULD_GET_REMOVED Nothing to see here //
|
9
9
|
@filter ../spec/fixtures/test.coffee /^ @filter = ->$/;" f lineno:14 object:Wat.ho type:function
|
10
10
|
_loop ../spec/fixtures/test.coffee /^_loop = (x) ->$/;" f lineno:19 object:window type:function
|
@@ -3,7 +3,7 @@
|
|
3
3
|
!_TAG_PROGRAM_AUTHOR Łukasz Korecki /lukasz@coffeesounds.com/
|
4
4
|
!_TAG_PROGRAM_NAME CoffeeTags //
|
5
5
|
!_TAG_PROGRAM_URL https://github.com/lukaszkorecki/CoffeeTags /GitHub repository/
|
6
|
-
!_TAG_PROGRAM_VERSION 0.1
|
6
|
+
!_TAG_PROGRAM_VERSION 0.2.1 //
|
7
7
|
@filter ../spec/fixtures/test.coffee /^ @filter = ->$/;" f lineno:14 object:Wat.ho type:function
|
8
8
|
_loop ../spec/fixtures/test.coffee /^_loop = (x) ->$/;" f lineno:19 object:window type:function
|
9
9
|
beam_magnum ../spec/fixtures/test.coffee /^beam_magnum : -> deployed(true)$/;" f lineno:44 object:window type:function
|
@@ -3,7 +3,7 @@
|
|
3
3
|
!_TAG_PROGRAM_AUTHOR Łukasz Korecki /lukasz@coffeesounds.com/
|
4
4
|
!_TAG_PROGRAM_NAME CoffeeTags //
|
5
5
|
!_TAG_PROGRAM_URL https://github.com/lukaszkorecki/CoffeeTags /GitHub repository/
|
6
|
-
!_TAG_PROGRAM_VERSION 0.1
|
6
|
+
!_TAG_PROGRAM_VERSION 0.2.1 //
|
7
7
|
@filter spec/fixtures/test.coffee /^ @filter = ->$/;" f lineno:14 object:Wat.ho type:function
|
8
8
|
_loop spec/fixtures/test.coffee /^_loop = (x) ->$/;" f lineno:19 object:window type:function
|
9
9
|
beam_magnum spec/fixtures/test.coffee /^beam_magnum : -> deployed(true)$/;" f lineno:44 object:window type:function
|
@@ -3,7 +3,7 @@
|
|
3
3
|
!_TAG_PROGRAM_AUTHOR Łukasz Korecki /lukasz@coffeesounds.com/
|
4
4
|
!_TAG_PROGRAM_NAME CoffeeTags //
|
5
5
|
!_TAG_PROGRAM_URL https://github.com/lukaszkorecki/CoffeeTags /GitHub repository/
|
6
|
-
!_TAG_PROGRAM_VERSION 0.1
|
6
|
+
!_TAG_PROGRAM_VERSION 0.2.1 //
|
7
7
|
@filter spec/fixtures/test.coffee /^ @filter = ->$/;" f lineno:14 object:Wat.ho type:function
|
8
8
|
_loop spec/fixtures/test.coffee /^_loop = (x) ->$/;" f lineno:19 object:window type:function
|
9
9
|
beam_magnum spec/fixtures/test.coffee /^beam_magnum : -> deployed(true)$/;" f lineno:44 object:window type:function
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: CoffeeTags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "\xC5\x81ukasz Korecki"
|
@@ -38,6 +38,7 @@ files:
|
|
38
38
|
- lib/CoffeeTags/formatter.rb
|
39
39
|
- lib/CoffeeTags/parser.rb
|
40
40
|
- lib/CoffeeTags/version.rb
|
41
|
+
- plugin/coffee-autotag.vim
|
41
42
|
- spec/coffeetags_spec.rb
|
42
43
|
- spec/fixtures/append-expected.ctags
|
43
44
|
- spec/fixtures/append.ctags
|
@@ -61,7 +62,6 @@ files:
|
|
61
62
|
- spec/spec_helper.rb
|
62
63
|
- tagbar-info.markdown
|
63
64
|
- test.rb
|
64
|
-
- vim/tagbar-coffee.vim.erb
|
65
65
|
homepage: http://github.com/lukaszkorecki/CoffeeTags
|
66
66
|
licenses:
|
67
67
|
- MIT
|
data/vim/tagbar-coffee.vim.erb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
if executable('coffeetags')
|
2
|
-
let g:tagbar_type_coffee = {
|
3
|
-
\ 'ctagsbin' : 'coffeetags',
|
4
|
-
\ 'ctagsargs' : '<%= include_vars_opt %>',
|
5
|
-
\ 'kinds' : [
|
6
|
-
\ 'f:functions',
|
7
|
-
\ 'o:object',
|
8
|
-
\ ],
|
9
|
-
\ 'sro' : ".",
|
10
|
-
\ 'kind2scope' : {
|
11
|
-
\ 'f' : 'object',
|
12
|
-
\ 'o' : 'object',
|
13
|
-
\ }
|
14
|
-
\ }
|
15
|
-
endif
|