guard-ctags-bundler 0.0.4 → 0.0.5

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/ruby
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.
@@ -29,13 +29,20 @@ module Guard
29
29
  private
30
30
 
31
31
  def generate_project_tags(paths)
32
- system("find #{paths.join(' ')} -type f -name \\*.rb | ctags -f tags -L -")
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).join(' ')
38
- system("find #{paths.strip} -type f -name \\*.rb | ctags -f gems.tags -L -")
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
@@ -1,7 +1,7 @@
1
1
  module Guard
2
2
  module Ctags
3
3
  module Bundler
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.5"
5
5
  end
6
6
  end
7
7
  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
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: 2011-12-12 00:00:00.000000000 Z
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: &17637840 !ruby/object:Gem::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: *17637840
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.10
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