guard-ctags-bundler 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
data/lib/guard/ctags-bundler.rb
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
require "guard/ctags-bundler/version"
|
2
2
|
require 'guard'
|
3
3
|
require 'guard/guard'
|
4
|
-
require '
|
4
|
+
require 'bundler'
|
5
|
+
require 'bundler/runtime'
|
5
6
|
|
6
7
|
module Guard
|
7
8
|
class CtagsBundler < Guard
|
8
|
-
BUNDLER = "__bundler__"
|
9
|
-
|
10
9
|
def initialize(watchers = [], options = {})
|
11
10
|
super(watchers, options)
|
12
11
|
end
|
@@ -16,28 +15,27 @@ module Guard
|
|
16
15
|
end
|
17
16
|
|
18
17
|
def run_on_change(paths)
|
19
|
-
if paths
|
18
|
+
if paths.include?('Gemfile.lock')
|
20
19
|
UI.info "regenerating bundler tags..."
|
21
20
|
generate_bundler_tags
|
22
|
-
|
21
|
+
end
|
22
|
+
ruby_files = paths.reject {|f| f == 'Gemfile.lock'}
|
23
|
+
if ruby_files.any?
|
23
24
|
UI.info "regenerating project tags..."
|
24
|
-
generate_project_tags(
|
25
|
+
generate_project_tags(ruby_files)
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
28
29
|
private
|
29
30
|
|
30
31
|
def generate_project_tags(paths)
|
31
|
-
|
32
|
-
system("find #{paths.join(' ')} -type f -name \\*.rb | ctags -f tags -L -")
|
33
|
-
end
|
32
|
+
system("ctags -f tags #{paths.join(' ')}")
|
34
33
|
end
|
35
34
|
|
36
35
|
def generate_bundler_tags
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
end
|
36
|
+
runtime = Bundler::Runtime.new Dir.pwd, Bundler.definition(true)
|
37
|
+
paths = runtime.specs.map(&:full_gem_path).join(' ')
|
38
|
+
system("find #{paths.strip} -type f -name \\*.rb | ctags -f gems.tags -L -")
|
41
39
|
end
|
42
40
|
end
|
43
41
|
end
|
metadata
CHANGED
@@ -1,47 +1,36 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-ctags-bundler
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
version: 0.0.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Ivan Tkalin
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-11-22 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: guard
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &16423180 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
26
|
-
- -
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 0
|
30
|
-
- 4
|
31
|
-
- 0
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
32
21
|
version: 0.4.0
|
33
22
|
type: :runtime
|
34
|
-
|
35
|
-
|
36
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *16423180
|
25
|
+
description: ! 'Guard::CtagsBundler uses ctags utility and generates 2 files: tags
|
26
|
+
-- with tags generated from project''s source tree and gems.tags -- with tags generated
|
27
|
+
from rubygems from project''s bundle.'
|
28
|
+
email:
|
37
29
|
- itkalin@gmail.com
|
38
30
|
executables: []
|
39
|
-
|
40
31
|
extensions: []
|
41
|
-
|
42
32
|
extra_rdoc_files: []
|
43
|
-
|
44
|
-
files:
|
33
|
+
files:
|
45
34
|
- .gitignore
|
46
35
|
- Gemfile
|
47
36
|
- LICENSE
|
@@ -51,37 +40,29 @@ files:
|
|
51
40
|
- lib/guard/ctags-bundler.rb
|
52
41
|
- lib/guard/ctags-bundler/templates/Guardfile
|
53
42
|
- lib/guard/ctags-bundler/version.rb
|
54
|
-
has_rdoc: true
|
55
43
|
homepage: https://github.com/ivalkeen/guard-ctags-bundler
|
56
44
|
licenses: []
|
57
|
-
|
58
45
|
post_install_message:
|
59
46
|
rdoc_options: []
|
60
|
-
|
61
|
-
require_paths:
|
47
|
+
require_paths:
|
62
48
|
- lib
|
63
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
50
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
|
69
|
-
|
70
|
-
version: "0"
|
71
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
56
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
- 0
|
78
|
-
version: "0"
|
57
|
+
requirements:
|
58
|
+
- - ! '>='
|
59
|
+
- !ruby/object:Gem::Version
|
60
|
+
version: '0'
|
79
61
|
requirements: []
|
80
|
-
|
81
62
|
rubyforge_project: guard-ctags-bundler
|
82
|
-
rubygems_version: 1.
|
63
|
+
rubygems_version: 1.8.10
|
83
64
|
signing_key:
|
84
65
|
specification_version: 3
|
85
|
-
summary: Guard gem for generating ctags for project files and gems from project's
|
66
|
+
summary: Guard gem for generating ctags for project files and gems from project's
|
67
|
+
bundle.
|
86
68
|
test_files: []
|
87
|
-
|