guard-ctags-bundler 0.1.2 → 0.1.3

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.
@@ -1,4 +1,3 @@
1
- require "guard/ctags-bundler/ctags_generator"
2
1
  require 'guard'
3
2
  require 'guard/guard'
4
3
  require 'bundler'
@@ -6,9 +5,11 @@ require 'bundler/runtime'
6
5
 
7
6
  module Guard
8
7
  class CtagsBundler < Guard
8
+ autoload 'CtagsGenerator', 'guard/ctags-bundler/ctags_generator'
9
+
9
10
  def initialize(watchers = [], options = {})
10
11
  super(watchers, options)
11
- @ctags_generator = ::Guard::Ctags::Bundler::CtagsGenerator.new(options)
12
+ @ctags_generator = ::Guard::CtagsBundler::CtagsGenerator.new(options)
12
13
  end
13
14
 
14
15
  def start
@@ -1,29 +1,33 @@
1
- class Guard::Ctags::Bundler::CtagsGenerator
2
- def initialize(opts = {})
3
- @opts = opts
4
- end
1
+ module Guard
2
+ class CtagsBundler
3
+ class CtagsGenerator
4
+ def initialize(opts = {})
5
+ @opts = opts
6
+ end
5
7
 
6
- def generate_project_tags
7
- generate_tags(@opts[:src_path] || ".", "tags")
8
- end
8
+ def generate_project_tags
9
+ generate_tags(@opts[:src_path] || ".", "tags")
10
+ end
9
11
 
10
- def generate_bundler_tags
11
- definition = Bundler::Definition.build("Gemfile", "Gemfile.lock", nil)
12
- runtime = Bundler::Runtime.new(Dir.pwd, definition)
13
- paths = runtime.requested_specs.map(&:full_gem_path)
14
- generate_tags(paths, "gems.tags")
15
- end
12
+ def generate_bundler_tags
13
+ definition = Bundler::Definition.build("Gemfile", "Gemfile.lock", nil)
14
+ runtime = Bundler::Runtime.new(Dir.pwd, definition)
15
+ paths = runtime.requested_specs.map(&:full_gem_path)
16
+ generate_tags(paths, "gems.tags")
17
+ end
16
18
 
17
- private
19
+ private
18
20
 
19
- def generate_tags(path, tag_file)
20
- if path.instance_of?(Array)
21
- path = path.join(' ').strip
22
- end
21
+ def generate_tags(path, tag_file)
22
+ if path.instance_of?(Array)
23
+ path = path.join(' ').strip
24
+ end
23
25
 
24
- cmd = "find #{path} -type f -name \\*.rb | ctags -f #{tag_file} -L -"
25
- cmd << " -e" if @opts[:emacs]
26
- system(cmd)
27
- system("cat tags gems.tags > TAGS") if @opts[:emacs]
26
+ cmd = "find #{path} -type f -name \\*.rb | ctags -f #{tag_file} -L -"
27
+ cmd << " -e" if @opts[:emacs]
28
+ system(cmd)
29
+ system("cat tags gems.tags > TAGS") if @opts[:emacs]
30
+ end
31
+ end
28
32
  end
29
33
  end
@@ -1,7 +1,7 @@
1
1
  module Guard
2
2
  module Ctags
3
3
  module Bundler
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
6
6
  end
7
7
  end
@@ -35,6 +35,6 @@ class CtagsGeneratorTest < MiniTest::Unit::TestCase
35
35
  private
36
36
 
37
37
  def generator(opts = {})
38
- Guard::Ctags::Bundler::CtagsGenerator.new(opts)
38
+ ::Guard::CtagsBundler::CtagsGenerator.new(opts)
39
39
  end
40
40
  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.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -130,7 +130,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  segments:
132
132
  - 0
133
- hash: 130018251819742036
133
+ hash: -1101205821171756912
134
134
  required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  none: false
136
136
  requirements:
@@ -139,7 +139,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
139
  version: '0'
140
140
  segments:
141
141
  - 0
142
- hash: 130018251819742036
142
+ hash: -1101205821171756912
143
143
  requirements: []
144
144
  rubyforge_project: guard-ctags-bundler
145
145
  rubygems_version: 1.8.24