guard-ctags-bundler 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/guard/ctags-bundler/ctags_generator.rb +2 -2
- data/lib/guard/ctags-bundler/version.rb +1 -1
- data/lib/guard/ctags-bundler.rb +8 -0
- data/test/ctags-bundler/ctags_generator_test.rb +9 -2
- data/test/ctags-bundler_test.rb +37 -0
- data/test/test_project/app/.#class2.rb +4 -0
- metadata +19 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cebddc2affb68671b7f6a5c5944de62a395525d
|
4
|
+
data.tar.gz: 0ad9f5ae57fb6b3e76c8095ed8d76f0075e170c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 928f632aca019ce9c1ac8496eaa033b5b25bf9d3d01cb89492edd4b50dbce28a90996df7b87af8ce2e47a4e15612e42576f4440ff6bc19bccb397b7d4ac65ebe
|
7
|
+
data.tar.gz: 00221c8fa6293a073d87e4f7a4628dfa3b66ec94ebe73591901e1b347abeca9e6af07351a242fee8b07e929b6f3302661b4ccc8b27ae3c0fc4caad36eab2fea8
|
@@ -3,7 +3,7 @@ require 'rbconfig'
|
|
3
3
|
#require 'bundler/runtime'
|
4
4
|
|
5
5
|
module Guard
|
6
|
-
class CtagsBundler
|
6
|
+
class CtagsBundler < Plugin
|
7
7
|
class CtagsGenerator
|
8
8
|
def initialize(opts = {})
|
9
9
|
@opts = opts
|
@@ -46,7 +46,7 @@ module Guard
|
|
46
46
|
path = path.join(' ').strip
|
47
47
|
end
|
48
48
|
system("mkdir -p ./#{@opts[:custom_path]}") if @opts[:custom_path]
|
49
|
-
cmd = "#{@opts[:binary] || 'ctags'} -f #{tag_file} #{@opts[:arguments] || '-R --languages=ruby'}"
|
49
|
+
cmd = "#{@opts[:binary] || 'ctags'} -f #{tag_file} #{@opts[:arguments] || '-R --languages=ruby'} --exclude='.#*'"
|
50
50
|
cmd << " -e" if @opts[:emacs]
|
51
51
|
cmd << " #{path}"
|
52
52
|
system(cmd)
|
data/lib/guard/ctags-bundler.rb
CHANGED
@@ -36,5 +36,13 @@ module Guard
|
|
36
36
|
def self.add_callback(*args)
|
37
37
|
::Guard::Plugin::Hooker.add_callback(*args)
|
38
38
|
end
|
39
|
+
|
40
|
+
def self.template(plugin_location)
|
41
|
+
File.read(template_path(plugin_location))
|
42
|
+
end
|
43
|
+
|
44
|
+
def self.template_path(plugin_location)
|
45
|
+
File.join(plugin_location, 'lib', 'guard', 'ctags-bundler', 'templates', 'Guardfile')
|
46
|
+
end
|
39
47
|
end
|
40
48
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
-
require 'guard/ctags-bundler
|
3
|
+
require 'guard/ctags-bundler'
|
4
4
|
|
5
5
|
class CtagsGeneratorTest < MiniTest::Unit::TestCase
|
6
6
|
def setup
|
@@ -74,9 +74,16 @@ class CtagsGeneratorTest < MiniTest::Unit::TestCase
|
|
74
74
|
refute_match("javaMethod", result)
|
75
75
|
end
|
76
76
|
|
77
|
+
def test_ignore_emacs_temporary_files
|
78
|
+
generator(:src_path => ["app", "lib"]).generate_project_tags
|
79
|
+
result = File.read(test_tags_file)
|
80
|
+
refute_match(".#class2", result)
|
81
|
+
end
|
82
|
+
|
77
83
|
private
|
78
84
|
|
79
85
|
def generator(opts = {})
|
80
|
-
|
86
|
+
binary = ENV['CTAGS_BINARY'] || 'ctags'
|
87
|
+
::Guard::CtagsBundler::CtagsGenerator.new({ binary: binary}.merge(opts))
|
81
88
|
end
|
82
89
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
require 'guard/ctags-bundler'
|
4
|
+
|
5
|
+
class CtagsBundlerTest < MiniTest::Unit::TestCase
|
6
|
+
def setup
|
7
|
+
@plugin = Guard::CtagsBundler.new
|
8
|
+
@gem_root_path = File.expand_path(File.join('..', '..'), __FILE__)
|
9
|
+
template_path = File.join('..', '..', 'lib', 'guard', 'ctags-bundler', 'templates', 'Guardfile')
|
10
|
+
@template_path = File.expand_path(template_path, __FILE__)
|
11
|
+
end
|
12
|
+
|
13
|
+
def test_template_path
|
14
|
+
assert_equal @template_path, @plugin.class.template_path(@gem_root_path)
|
15
|
+
end
|
16
|
+
|
17
|
+
def test_template
|
18
|
+
template = File.read(@template_path)
|
19
|
+
assert_equal template, @plugin.class.template(@gem_root_path)
|
20
|
+
end
|
21
|
+
|
22
|
+
def test_non_namespaced_classname
|
23
|
+
assert_equal 'CtagsBundler', @plugin.class.non_namespaced_classname
|
24
|
+
end
|
25
|
+
|
26
|
+
def test_non_namespaced_name
|
27
|
+
assert_equal 'ctagsbundler', @plugin.class.non_namespaced_name
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_name
|
31
|
+
assert_equal 'ctagsbundler', @plugin.name
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_title
|
35
|
+
assert_equal 'CtagsBundler', @plugin.title
|
36
|
+
end
|
37
|
+
end
|
metadata
CHANGED
@@ -1,83 +1,83 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-ctags-bundler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Tkalin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: purdytest
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '0'
|
83
83
|
description: 'Guard::CtagsBundler uses ctags utility and generates 2 files: tags --
|
@@ -89,8 +89,8 @@ executables: []
|
|
89
89
|
extensions: []
|
90
90
|
extra_rdoc_files: []
|
91
91
|
files:
|
92
|
-
- .gitignore
|
93
|
-
- .travis.yml
|
92
|
+
- ".gitignore"
|
93
|
+
- ".travis.yml"
|
94
94
|
- Gemfile
|
95
95
|
- LICENSE
|
96
96
|
- README.md
|
@@ -101,8 +101,10 @@ files:
|
|
101
101
|
- lib/guard/ctags-bundler/templates/Guardfile
|
102
102
|
- lib/guard/ctags-bundler/version.rb
|
103
103
|
- test/ctags-bundler/ctags_generator_test.rb
|
104
|
+
- test/ctags-bundler_test.rb
|
104
105
|
- test/test_helper.rb
|
105
106
|
- test/test_project/Gemfile
|
107
|
+
- test/test_project/app/.#class2.rb
|
106
108
|
- test/test_project/app/class1.java
|
107
109
|
- test/test_project/app/class1.rb
|
108
110
|
- test/test_project/lib/class2.rb
|
@@ -116,17 +118,17 @@ require_paths:
|
|
116
118
|
- lib
|
117
119
|
required_ruby_version: !ruby/object:Gem::Requirement
|
118
120
|
requirements:
|
119
|
-
- -
|
121
|
+
- - ">="
|
120
122
|
- !ruby/object:Gem::Version
|
121
123
|
version: '0'
|
122
124
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
123
125
|
requirements:
|
124
|
-
- -
|
126
|
+
- - ">="
|
125
127
|
- !ruby/object:Gem::Version
|
126
128
|
version: '0'
|
127
129
|
requirements: []
|
128
130
|
rubyforge_project: guard-ctags-bundler
|
129
|
-
rubygems_version: 2.
|
131
|
+
rubygems_version: 2.2.2
|
130
132
|
signing_key:
|
131
133
|
specification_version: 4
|
132
134
|
summary: Guard gem for generating ctags for project files and gems from project's
|