guard-ctags-composer 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,7 +1 @@
1
1
  *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
5
- /vendor/ruby
6
- /test/test_project/tags
7
- /test/test_project/gems.tags
data/README.md CHANGED
@@ -24,17 +24,20 @@ Add a basic setup to your `Guardfile`:
24
24
 
25
25
  ## Usage
26
26
 
27
- Please, read [Guard usage doc](https://github.com/guard/guard#readme)
27
+ $ guard
28
+
29
+ For more info, read [Guard usage doc](https://github.com/guard/guard#readme)
28
30
 
29
31
  ## Guardfile Options
30
32
 
31
33
  ``` ruby
32
34
  :src_path => ".", # source path to be scanned for tags (default `src`)
33
35
  :vendor_path => ".", # source path to be scanned for vendor tags (default `vendor`)
34
- :emacs => false, # run ctags in emacs mode and merge tags and gems.tags into TAGS file
36
+ :name_patterns => ["\\*.php", "\\*.yml"], # name patterns to search for (default `["\\*.php"]`)
37
+ :emacs => false, # run ctags in emacs mode and merge `tags` and `vendor.tags` into `TAGS` file
35
38
  ```
36
39
 
37
- For a typical Rails application, `Guardfile` can look like this (default):
40
+ For a typical [Symfony2](http://symfony.com/) application, `Guardfile` can look like this (default):
38
41
 
39
42
  guard 'ctags-composer', :src_path => ["src"], :vendor_path => ["vendor"] do
40
43
  watch(/^(src)\/.*\.php/)
@@ -54,7 +57,7 @@ In ubuntu you can install ctags by running
54
57
 
55
58
  ## Vim
56
59
 
57
- Vim supports ctags by default. All you need to do is add your `gems.tags` file to the Vim's tag stack.
60
+ Vim supports ctags by default. All you need to do is add your `vendor.tags` file to the Vim's tag stack.
58
61
 
59
62
  set tags+=vendor.tags
60
63
 
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = "guard-ctags-composer"
3
- s.version = "0.0.1"
3
+ s.version = "0.0.2"
4
4
  s.authors = ["Konstantin Kudryashov"]
5
5
  s.email = ["ever.zet@gmail.com"]
6
6
  s.homepage = "https://github.com/everzet/guard-ctags-composer"
@@ -4,6 +4,7 @@ module Guard
4
4
  class CtagsGenerator
5
5
  def initialize(opts = {})
6
6
  @opts = opts
7
+ @opts[:name_patterns] = @opts[:name_patterns] || ['\\*.php']
7
8
  end
8
9
 
9
10
  def generate_project_tags
@@ -21,8 +22,15 @@ module Guard
21
22
  path = path.join(' ').strip
22
23
  end
23
24
 
24
- cmd = "find #{path} -type f -name \\*.php | ctags -f #{tag_file} -L -"
25
+ name_patterns = ''
26
+ if @opts[:name_patterns].instance_of?(Array)
27
+ name_patterns = ' -name '
28
+ name_patterns << @opts[:name_patterns].join(' -or -name ').strip
29
+ end
30
+
31
+ cmd = "find #{path} -type f #{name_patterns} | ctags -f #{tag_file} -L -"
25
32
  cmd << " -e" if @opts[:emacs]
33
+
26
34
  system(cmd)
27
35
  system("cat tags vendor.tags > TAGS") if @opts[:emacs]
28
36
  end
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-ctags-composer
3
3
  version: !ruby/object:Gem::Version
4
- prerelease: false
4
+ hash: 27
5
+ prerelease:
5
6
  segments:
6
7
  - 0
7
8
  - 0
8
- - 1
9
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
10
11
  platform: ruby
11
12
  authors:
12
13
  - Konstantin Kudryashov
@@ -14,16 +15,17 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2012-07-06 00:00:00 +02:00
18
- default_executable:
18
+ date: 2013-02-19 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: guard
22
22
  prerelease: false
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
24
25
  requirements:
25
26
  - - ">="
26
27
  - !ruby/object:Gem::Version
28
+ hash: 23
27
29
  segments:
28
30
  - 1
29
31
  - 0
@@ -35,9 +37,11 @@ dependencies:
35
37
  name: minitest
36
38
  prerelease: false
37
39
  requirement: &id002 !ruby/object:Gem::Requirement
40
+ none: false
38
41
  requirements:
39
42
  - - ">="
40
43
  - !ruby/object:Gem::Version
44
+ hash: 3
41
45
  segments:
42
46
  - 0
43
47
  version: "0"
@@ -47,9 +51,11 @@ dependencies:
47
51
  name: purdytest
48
52
  prerelease: false
49
53
  requirement: &id003 !ruby/object:Gem::Requirement
54
+ none: false
50
55
  requirements:
51
56
  - - ">="
52
57
  - !ruby/object:Gem::Version
58
+ hash: 3
53
59
  segments:
54
60
  - 0
55
61
  version: "0"
@@ -72,7 +78,6 @@ files:
72
78
  - lib/guard/ctags-composer.rb
73
79
  - lib/guard/ctags-composer/ctags_generator.rb
74
80
  - lib/guard/ctags-composer/templates/Guardfile
75
- has_rdoc: true
76
81
  homepage: https://github.com/everzet/guard-ctags-composer
77
82
  licenses: []
78
83
 
@@ -82,23 +87,27 @@ rdoc_options: []
82
87
  require_paths:
83
88
  - lib
84
89
  required_ruby_version: !ruby/object:Gem::Requirement
90
+ none: false
85
91
  requirements:
86
92
  - - ">="
87
93
  - !ruby/object:Gem::Version
94
+ hash: 3
88
95
  segments:
89
96
  - 0
90
97
  version: "0"
91
98
  required_rubygems_version: !ruby/object:Gem::Requirement
99
+ none: false
92
100
  requirements:
93
101
  - - ">="
94
102
  - !ruby/object:Gem::Version
103
+ hash: 3
95
104
  segments:
96
105
  - 0
97
106
  version: "0"
98
107
  requirements: []
99
108
 
100
109
  rubyforge_project:
101
- rubygems_version: 1.3.6
110
+ rubygems_version: 1.8.24
102
111
  signing_key:
103
112
  specification_version: 3
104
113
  summary: Guard gem for generating ctags for project files and vendor libraries.