guard-ctags-bundler 0.0.4 → 0.0.5
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/.gitignore +1 -0
- data/README.md +10 -0
- data/lib/guard/ctags-bundler.rb +10 -3
- data/lib/guard/ctags-bundler/version.rb +1 -1
- metadata +5 -5
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -43,3 +43,13 @@ Vim supports ctags by default. All you need to do is add your `gems.tags` file t
|
|
43
43
|
set tags+=gems.tags
|
44
44
|
|
45
45
|
|
46
|
+
## Emacs
|
47
|
+
|
48
|
+
Ctags can be used with emacs too. Add `:emacs => true` option to your Guardfile and ctags will be generated with `-e` option:
|
49
|
+
|
50
|
+
guard 'ctags-bundler', :emacs => true do
|
51
|
+
watch(%r{^(app|lib|spec/support)/.*\.rb$}) { ["app", "lib", "spec/support"] }
|
52
|
+
watch('Gemfile.lock')
|
53
|
+
end
|
54
|
+
|
55
|
+
Thanks to [Jorge Dias](https://github.com/diasjorge) for this patch.
|
data/lib/guard/ctags-bundler.rb
CHANGED
@@ -29,13 +29,20 @@ module Guard
|
|
29
29
|
private
|
30
30
|
|
31
31
|
def generate_project_tags(paths)
|
32
|
-
|
32
|
+
generate_tags(paths, "tags")
|
33
33
|
end
|
34
34
|
|
35
35
|
def generate_bundler_tags
|
36
36
|
runtime = ::Bundler::Runtime.new Dir.pwd, ::Bundler.definition
|
37
|
-
paths = runtime.specs.map(&:full_gem_path)
|
38
|
-
|
37
|
+
paths = runtime.specs.map(&:full_gem_path)
|
38
|
+
generate_tags(paths, "gems.tags")
|
39
|
+
end
|
40
|
+
|
41
|
+
def generate_tags(paths, tag_file)
|
42
|
+
paths = paths.join(' ').strip
|
43
|
+
cmd = "find #{paths} -type f -name \\*.rb | ctags -f #{tag_file} -L -"
|
44
|
+
cmd << " -e" if options[:emacs]
|
45
|
+
system(cmd)
|
39
46
|
end
|
40
47
|
end
|
41
48
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-ctags-bundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-03-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: guard
|
16
|
-
requirement: &
|
16
|
+
requirement: &7474100 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 0.4.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *7474100
|
25
25
|
description: ! 'Guard::CtagsBundler uses ctags utility and generates 2 files: tags
|
26
26
|
-- with tags generated from project''s source tree and gems.tags -- with tags generated
|
27
27
|
from rubygems from project''s bundle.'
|
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
60
|
version: '0'
|
61
61
|
requirements: []
|
62
62
|
rubyforge_project: guard-ctags-bundler
|
63
|
-
rubygems_version: 1.8.
|
63
|
+
rubygems_version: 1.8.17
|
64
64
|
signing_key:
|
65
65
|
specification_version: 3
|
66
66
|
summary: Guard gem for generating ctags for project files and gems from project's
|