CoffeeTags 0.0.2.6 → 0.0.3.0

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/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # CoffeeTags
2
2
 
3
+ ### Latest version: `0.0.3`
4
+
3
5
  A simple tool for generating CoffeeScript tags (Ctags compatible).
4
6
 
5
7
  [![Build Status](https://secure.travis-ci.org/lukaszkorecki/CoffeeTags.png?branch=master)](http://travis-ci.org/lukaszkorecki/CoffeeTags)
@@ -25,11 +27,12 @@ will generate standard TAGS file which later can be used with Vim (standard `:ta
25
27
  # Requirements
26
28
 
27
29
  * ruby (either 1.8.7 or 1.9.2)
28
- * Vim
30
+ * Vim or [Sublime Text](http://www.sublimetext.com/) and [CTags plugin](https://github.com/SublimeText/CTags)
29
31
 
30
32
  ### optional
31
33
 
32
- * [TagBar](https://github.com/majutsushi/tagbar)
34
+ * Vim
35
+ * [TagBar](https://github.com/majutsushi/tagbar)
33
36
 
34
37
  # Halp!
35
38
 
@@ -42,10 +45,15 @@ Just use `coffeetags --help`
42
45
  `gem install CoffeeTags`
43
46
 
44
47
 
48
+ ## Vim installation
45
49
  * add TagBar config to your .vimrc
46
50
 
47
51
  `coffeetags --vim-conf >> ~/.vimrc`
48
52
 
53
+ ## Sublime Text
54
+
55
+ *TODO* - I don't use ST myself, but PRs with HOWTO are welcome
56
+
49
57
 
50
58
  ## Config types
51
59
 
@@ -34,7 +34,7 @@ module Coffeetags
34
34
 
35
35
  # Helper function for formatting a source line into regex
36
36
  def regex_line line
37
- "/#{line}/;\""
37
+ "/^#{line.gsub(/([\\^$])/, '\\\\\1')}$/;\""
38
38
  end
39
39
 
40
40
  def line_to_string entry
@@ -44,7 +44,7 @@ module Coffeetags
44
44
  [
45
45
  entry[:name],
46
46
  @file,
47
- regex_line(entry[:name]),
47
+ regex_line(entry[:source]),
48
48
  entry[:kind],
49
49
  "lineno:#{entry[:line]}",
50
50
  namespace,
@@ -64,5 +64,9 @@ module Coffeetags
64
64
  @lines.map { |l| "#{l}\n"}.join ''
65
65
  end
66
66
 
67
+ def lines
68
+ @lines
69
+ end
70
+
67
71
  end
68
72
  end
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Coffeetags
3
- VERSION = "0.0.2.6"
3
+ VERSION = "0.0.3.0"
4
4
  end
data/lib/CoffeeTags.rb CHANGED
@@ -103,6 +103,8 @@ module Coffeetags
103
103
 
104
104
  files = [ files] if files.is_a? String
105
105
 
106
+ lines = []
107
+
106
108
  files.reject { |f| f =~ /^-/}.each do |file|
107
109
  sc = File.read file
108
110
  parser = Coffeetags::Parser.new sc, include_vars
@@ -112,8 +114,12 @@ module Coffeetags
112
114
 
113
115
  formatter.parse_tree
114
116
 
115
- __out << formatter.tags
117
+ lines.concat(formatter.lines)
116
118
  end
119
+
120
+ lines.sort!
121
+ __out << lines.map { |l| "#{l}\n"}.join('')
122
+
117
123
  __out.close if __out.respond_to? :close
118
124
 
119
125
  __out.join("\n") if __out.is_a? Array
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: 75
4
+ hash: 67
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- - 6
11
- version: 0.0.2.6
9
+ - 3
10
+ - 0
11
+ version: 0.0.3.0
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: 2012-04-02 00:00:00 +01:00
19
+ date: 2013-02-02 00:00:00 +00:00
20
20
  default_executable:
21
21
  dependencies: []
22
22