CoffeeTags 0.0.3.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -2,3 +2,4 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ vendor
data/Rakefile CHANGED
@@ -1,6 +1,7 @@
1
+ require 'rubygems'
1
2
  require 'bundler/gem_tasks'
2
3
 
3
4
  task :default => [ :test ]
4
5
  task :test do
5
- STDOUT << `rspec spec/`
6
+ exec "bundle exec rspec spec/"
6
7
  end
@@ -17,7 +17,7 @@ module Coffeetags
17
17
 
18
18
  # regexes
19
19
  @block = /^\s*(if|unless|switch|loop|do)/
20
- @class_regex = /\s*class\s*([\w\.]*)/
20
+ @class_regex = /\s*class\s*(?:@)?([\w\.]*)/
21
21
  @proto_meths = /^\s*([A-Za-z]*)::([@a-zA-Z0-9_]*)/
22
22
  @var_regex = /([@a-zA-Z0-9_]*)\s*[=:]{1}\s*$/
23
23
  @token_regex = /([@a-zA-Z0-9_]*)\s*[:=]{1}/
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Coffeetags
3
- VERSION = "0.0.3.0"
3
+ VERSION = "0.1.1"
4
4
  end
@@ -33,6 +33,7 @@ describe Utils do
33
33
 
34
34
  @fake_formatter = mock 'Formatter'
35
35
  @fake_formatter.stub! :parse_tree
36
+ @fake_formatter.stub!(:lines).and_return %w{ tag tag2 tag3 }
36
37
  @fake_formatter.stub!(:tags).and_return <<-TAG
37
38
  tag
38
39
  tag2
@@ -3,5 +3,5 @@
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.0.2.6 //
7
- echo2 spec/fixtures/blockcomment.coffee /echo2/;" f lineno:7 object:window type:function
6
+ !_TAG_PROGRAM_VERSION 0.1.0 //
7
+ echo2 spec/fixtures/blockcomment.coffee /^echo2 :-> console.log 'echo'$/;" f lineno:7 object:window type:function
@@ -1,13 +1,14 @@
1
1
  !_TAG_FILE_FORMAT 2 /extended format/
2
2
  !_TAG_FILE_SORTED 0 /0=unsorted, 1=sorted, 2=foldcase/
3
- !_TAG_PROGRAM_AUTHOR Patrick Walton /pwalton@mozilla.com/
4
- !_TAG_PROGRAM_NAME jsctags //
5
- !_TAG_PROGRAM_URL http://github.com/pcwalton/jsctags /GitHub repository/
6
- !_TAG_PROGRAM_VERSION 0.1 //
7
- Campfire examples/campfire.js /^ function Campfire(api_key, host) {$/;" f lineno:4 type:void function(any, any)
8
- constructor examples/campfire.js /^ function Campfire(api_key, host) {$/;" f lineno:4 namespace:Campfire.prototype type:void function(any, any)
9
- handlers examples/campfire.js /^ Campfire.prototype.handlers = function(callbacks) {$/;" f lineno:14 namespace:Campfire.prototype type:Object function(any)
10
- prototype examples/campfire.js /^ Campfire.prototype.handlers = function(callbacks) {$/;" v lineno:14 namespace:Campfire type:Campfire
11
- rooms examples/campfire.js /^ Campfire.prototype.rooms = function(callbacks) {$/;" f lineno:33 namespace:Campfire.prototype type:any function(any)
12
- roomInfo examples/campfire.js /^ Campfire.prototype.roomInfo = function(id, callbacks) {$/;" f lineno:36 namespace:Campfire.prototype type:any function(any, any)
13
- recent examples/campfire.js /^ Campfire.prototype.recent = function(id, since, callbacks) {$/;" f lineno:39 namespace:Campfire.prototype type:any function(any, any, any)
3
+ !_TAG_PROGRAM_AUTHOR Łukasz Korecki /lukasz@coffeesounds.com/
4
+ !_TAG_PROGRAM_NAME CoffeeTags //
5
+ !_TAG_PROGRAM_URL https://github.com/lukaszkorecki/CoffeeTags /GitHub repository/
6
+ !_TAG_PROGRAM_VERSION 0.1.0 //
7
+ bump spec/fixtures/campfire.coffee /^ bump : ->$/;" f lineno:46 object:Test type:function
8
+ constructor spec/fixtures/campfire.coffee /^ constructor: (api_key, host) ->$/;" f lineno:8 object:Campfire type:function
9
+ handlers spec/fixtures/campfire.coffee /^ handlers: (callbacks) ->$/;" f lineno:14 object:Campfire type:function
10
+ onFailure spec/fixtures/campfire.coffee /^ onFailure: (response) ->$/;" f lineno:24 object:Campfire.handlers.resp type:function
11
+ onSuccess spec/fixtures/campfire.coffee /^ onSuccess : (response) ->$/;" f lineno:16 object:Campfire.handlers.resp type:function
12
+ recent spec/fixtures/campfire.coffee /^ recent: (id, since, callbacks) ->$/;" f lineno:40 object:Campfire type:function
13
+ roomInfo spec/fixtures/campfire.coffee /^ roomInfo: (id, callbacks) ->$/;" f lineno:34 object:Campfire type:function
14
+ rooms spec/fixtures/campfire.coffee /^ rooms: (callbacks) ->$/;" f lineno:29 object:Campfire type:function
@@ -0,0 +1,2 @@
1
+ class @Campfire
2
+ constructor: ->
@@ -3,20 +3,20 @@
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.0.2.6 //
7
- bump spec/fixtures/test.coffee /bump/;" f lineno:1 object:window type:function
8
- ho spec/fixtures/test.coffee /ho/;" f lineno:5 object:Wat type:function
9
- bump spec/fixtures/test.coffee /bump/;" f lineno:10 object:Wat.ho.@lolWat type:function
10
- bump_up spec/fixtures/test.coffee /bump_up/;" f lineno:12 object:Wat.ho.@lolWat type:function
11
- @filter spec/fixtures/test.coffee /@filter/;" f lineno:14 object:Wat.ho type:function
12
- _loop spec/fixtures/test.coffee /_loop/;" f lineno:19 object:window type:function
13
- bound_func spec/fixtures/test.coffee /bound_func/;" f lineno:41 object:window type:function
14
- beam_magnum spec/fixtures/test.coffee /beam_magnum/;" f lineno:44 object:window type:function
15
- constructor spec/fixtures/campfire.coffee /constructor/;" f lineno:8 object:Campfire type:function
16
- handlers spec/fixtures/campfire.coffee /handlers/;" f lineno:14 object:Campfire type:function
17
- onSuccess spec/fixtures/campfire.coffee /onSuccess/;" f lineno:16 object:Campfire.handlers.resp type:function
18
- onFailure spec/fixtures/campfire.coffee /onFailure/;" f lineno:24 object:Campfire.handlers.resp type:function
19
- rooms spec/fixtures/campfire.coffee /rooms/;" f lineno:29 object:Campfire type:function
20
- roomInfo spec/fixtures/campfire.coffee /roomInfo/;" f lineno:34 object:Campfire type:function
21
- recent spec/fixtures/campfire.coffee /recent/;" f lineno:40 object:Campfire type:function
22
- bump spec/fixtures/campfire.coffee /bump/;" f lineno:46 object:Test type:function
6
+ !_TAG_PROGRAM_VERSION 0.1.0 //
7
+ @filter spec/fixtures/test.coffee /^ @filter = ->$/;" f lineno:14 object:Wat.ho type:function
8
+ _loop spec/fixtures/test.coffee /^_loop = (x) ->$/;" f lineno:19 object:window type:function
9
+ beam_magnum spec/fixtures/test.coffee /^beam_magnum : -> deployed(true)$/;" f lineno:44 object:window type:function
10
+ bound_func spec/fixtures/test.coffee /^bound_func = (ok) => wat(ok)$/;" f lineno:41 object:window type:function
11
+ bump spec/fixtures/campfire.coffee /^ bump : ->$/;" f lineno:46 object:Test type:function
12
+ bump spec/fixtures/test.coffee /^ bump : ->$/;" f lineno:10 object:Wat.ho.@lolWat type:function
13
+ bump spec/fixtures/test.coffee /^bump = (wat) ->$/;" f lineno:1 object:window type:function
14
+ bump_up spec/fixtures/test.coffee /^ bump_up : ->$/;" f lineno:12 object:Wat.ho.@lolWat type:function
15
+ constructor spec/fixtures/campfire.coffee /^ constructor: (api_key, host) ->$/;" f lineno:8 object:Campfire type:function
16
+ handlers spec/fixtures/campfire.coffee /^ handlers: (callbacks) ->$/;" f lineno:14 object:Campfire type:function
17
+ ho spec/fixtures/test.coffee /^ ho : (x) ->$/;" f lineno:5 object:Wat type:function
18
+ onFailure spec/fixtures/campfire.coffee /^ onFailure: (response) ->$/;" f lineno:24 object:Campfire.handlers.resp type:function
19
+ onSuccess spec/fixtures/campfire.coffee /^ onSuccess : (response) ->$/;" f lineno:16 object:Campfire.handlers.resp type:function
20
+ recent spec/fixtures/campfire.coffee /^ recent: (id, since, callbacks) ->$/;" f lineno:40 object:Campfire type:function
21
+ roomInfo spec/fixtures/campfire.coffee /^ roomInfo: (id, callbacks) ->$/;" f lineno:34 object:Campfire type:function
22
+ rooms spec/fixtures/campfire.coffee /^ rooms: (callbacks) ->$/;" f lineno:29 object:Campfire type:function
@@ -3,12 +3,12 @@
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.0.2.6 //
7
- bump spec/fixtures/test.coffee /bump/;" f lineno:1 object:window type:function
8
- ho spec/fixtures/test.coffee /ho/;" f lineno:5 object:Wat type:function
9
- bump spec/fixtures/test.coffee /bump/;" f lineno:10 object:Wat.ho.@lolWat type:function
10
- bump_up spec/fixtures/test.coffee /bump_up/;" f lineno:12 object:Wat.ho.@lolWat type:function
11
- @filter spec/fixtures/test.coffee /@filter/;" f lineno:14 object:Wat.ho type:function
12
- _loop spec/fixtures/test.coffee /_loop/;" f lineno:19 object:window type:function
13
- bound_func spec/fixtures/test.coffee /bound_func/;" f lineno:41 object:window type:function
14
- beam_magnum spec/fixtures/test.coffee /beam_magnum/;" f lineno:44 object:window type:function
6
+ !_TAG_PROGRAM_VERSION 0.1.0 //
7
+ @filter spec/fixtures/test.coffee /^ @filter = ->$/;" f lineno:14 object:Wat.ho type:function
8
+ _loop spec/fixtures/test.coffee /^_loop = (x) ->$/;" f lineno:19 object:window type:function
9
+ beam_magnum spec/fixtures/test.coffee /^beam_magnum : -> deployed(true)$/;" f lineno:44 object:window type:function
10
+ bound_func spec/fixtures/test.coffee /^bound_func = (ok) => wat(ok)$/;" f lineno:41 object:window type:function
11
+ bump spec/fixtures/test.coffee /^ bump : ->$/;" f lineno:10 object:Wat.ho.@lolWat type:function
12
+ bump spec/fixtures/test.coffee /^bump = (wat) ->$/;" f lineno:1 object:window type:function
13
+ bump_up spec/fixtures/test.coffee /^ bump_up : ->$/;" f lineno:12 object:Wat.ho.@lolWat type:function
14
+ ho spec/fixtures/test.coffee /^ ho : (x) ->$/;" f lineno:5 object:Wat type:function
@@ -13,14 +13,14 @@ describe 'CoffeeTags::Formatter' do
13
13
  end
14
14
 
15
15
  it "generates a line for method definition" do
16
- exp = [ 'constructor', 'test.coffee', "/constructor/;\"",
16
+ exp = [ 'constructor', 'test.coffee', "/^ constructor: (api_key, host) ->$/;\"",
17
17
  'f', 'lineno:8', 'object:Campfire', 'type:function'
18
18
  ].join("\t")
19
19
  @instance.parse_tree.first.should == exp
20
20
  end
21
21
 
22
22
  it "generates line for second class" do
23
- exp = [ 'bump', 'test.coffee', "/bump/;\"",
23
+ exp = [ 'bump', 'test.coffee', "/^ bump : ->$/;\"",
24
24
  'f', 'lineno:46', 'object:Test', 'type:function'
25
25
  ].join "\t"
26
26
  @instance.parse_tree.last.should == exp
data/spec/parser_spec.rb CHANGED
@@ -3,6 +3,7 @@ describe 'CoffeeTags::Parser' do
3
3
  before :all do
4
4
  @campfire_class = File.read File.expand_path('./spec/fixtures/campfire.coffee')
5
5
  @class_with_dot = File.read File.expand_path('./spec/fixtures/class_with_dot.coffee')
6
+ @class_with_at = File.read File.expand_path('./spec/fixtures/class_with_at.coffee')
6
7
  @test_file = File.read File.expand_path('./spec/fixtures/test.coffee')
7
8
 
8
9
  @cf_tree = YAML::load_file File.expand_path('./spec/fixtures/tree.yaml')
@@ -85,6 +86,14 @@ describe 'CoffeeTags::Parser' do
85
86
  c.should == @cf_tree.find {|i| i[:name] == 'App.Campfire'}
86
87
  end
87
88
 
89
+ it "parses the class with @ in name" do
90
+ @coffee_parser = Coffeetags::Parser.new @class_with_at, true
91
+ @coffee_parser.execute!
92
+
93
+ c = @coffee_parser.tree.find { |i| i[:name] == 'Campfire'}
94
+ c.should == @cf_tree.find {|i| i[:name] == 'Campfire'}
95
+ end
96
+
88
97
  it "parses the instance variable" do
89
98
  c =@coffee_parser.tree.find { |i| i[:name] == '@url'}
90
99
  c.should == @cf_tree.find {|i| i[:name] == '@url'}
metadata CHANGED
@@ -1,35 +1,24 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: CoffeeTags
3
- version: !ruby/object:Gem::Version
4
- hash: 67
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 0
9
- - 3
10
- - 0
11
- version: 0.0.3.0
12
6
  platform: ruby
13
- authors:
14
- - "\xC5\x81ukasz Korecki"
7
+ authors:
8
+ - Łukasz Korecki
15
9
  autorequire:
16
10
  bindir: bin
17
11
  cert_chain: []
18
-
19
- date: 2013-02-02 00:00:00 +00:00
20
- default_executable:
12
+ date: 2013-07-14 00:00:00.000000000 Z
21
13
  dependencies: []
22
-
23
14
  description: CoffeeTags generates ctags compatibile tags for CoffeeScript.
24
- email:
15
+ email:
25
16
  - lukasz@coffeesounds.com
26
- executables:
17
+ executables:
27
18
  - coffeetags
28
19
  extensions: []
29
-
30
20
  extra_rdoc_files: []
31
-
32
- files:
21
+ files:
33
22
  - .gitignore
34
23
  - .rspec
35
24
  - .rvmrc
@@ -50,6 +39,7 @@ files:
50
39
  - spec/fixtures/campfire.coffee
51
40
  - spec/fixtures/campfire.js
52
41
  - spec/fixtures/campfire.js.tags
42
+ - spec/fixtures/class_with_at.coffee
53
43
  - spec/fixtures/class_with_dot.coffee
54
44
  - spec/fixtures/exported_class.coffee
55
45
  - spec/fixtures/out.test-two.ctags
@@ -63,47 +53,38 @@ files:
63
53
  - tagbar-info.markdown
64
54
  - test.rb
65
55
  - vim/tagbar-coffee.vim.erb
66
- has_rdoc: true
67
56
  homepage: http://github.com/lukaszkorecki/CoffeeTags
68
57
  licenses: []
69
-
70
58
  post_install_message:
71
59
  rdoc_options: []
72
-
73
- require_paths:
60
+ require_paths:
74
61
  - lib
75
- required_ruby_version: !ruby/object:Gem::Requirement
62
+ required_ruby_version: !ruby/object:Gem::Requirement
76
63
  none: false
77
- requirements:
78
- - - ">="
79
- - !ruby/object:Gem::Version
80
- hash: 3
81
- segments:
82
- - 0
83
- version: "0"
84
- required_rubygems_version: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: '0'
68
+ required_rubygems_version: !ruby/object:Gem::Requirement
85
69
  none: false
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- hash: 3
90
- segments:
91
- - 0
92
- version: "0"
70
+ requirements:
71
+ - - ! '>='
72
+ - !ruby/object:Gem::Version
73
+ version: '0'
93
74
  requirements: []
94
-
95
75
  rubyforge_project: CoffeeTags
96
- rubygems_version: 1.5.0
76
+ rubygems_version: 1.8.24
97
77
  signing_key:
98
78
  specification_version: 3
99
79
  summary: tags generator for CoffeeScript
100
- test_files:
80
+ test_files:
101
81
  - spec/coffeetags_spec.rb
102
82
  - spec/fixtures/blockcomment.coffee
103
83
  - spec/fixtures/blockcomment.ctags
104
84
  - spec/fixtures/campfire.coffee
105
85
  - spec/fixtures/campfire.js
106
86
  - spec/fixtures/campfire.js.tags
87
+ - spec/fixtures/class_with_at.coffee
107
88
  - spec/fixtures/class_with_dot.coffee
108
89
  - spec/fixtures/exported_class.coffee
109
90
  - spec/fixtures/out.test-two.ctags