guard-ctags-bundler 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4cebddc2affb68671b7f6a5c5944de62a395525d
4
- data.tar.gz: 0ad9f5ae57fb6b3e76c8095ed8d76f0075e170c8
3
+ metadata.gz: 543fcbf4ca78a73238f73d0756ae958330960087
4
+ data.tar.gz: aecd5a60f59b2d428c283a4f9c06445c36239535
5
5
  SHA512:
6
- metadata.gz: 928f632aca019ce9c1ac8496eaa033b5b25bf9d3d01cb89492edd4b50dbce28a90996df7b87af8ce2e47a4e15612e42576f4440ff6bc19bccb397b7d4ac65ebe
7
- data.tar.gz: 00221c8fa6293a073d87e4f7a4628dfa3b66ec94ebe73591901e1b347abeca9e6af07351a242fee8b07e929b6f3302661b4ccc8b27ae3c0fc4caad36eab2fea8
6
+ metadata.gz: 267c89c4a094ca009bb596f0a7179e957d3b6c557977ea4cb90a0865ff0e1b4d745a54275f5739dc004ad4eb9b30c4c51d0783f90f6c6afbdad3e56fe6857ddb
7
+ data.tar.gz: 291f7853b2b18aa26902fe0cde9f7ee7752e67a0c67549ac13128468788c90e8fa3e77dd636c622fd49c709d2bc920917719c28a0e435c2bda712f15499c33c6
data/.travis.yml CHANGED
@@ -2,8 +2,8 @@ before_install:
2
2
  - gem install bundler
3
3
  - sudo apt-get install exuberant-ctags
4
4
  rvm:
5
- - 1.9.3
5
+ - 2.1.2
6
6
  - jruby
7
- - rbx-19mode
7
+ - rbx-2
8
8
  notifications:
9
9
  email: itkalin@gmail.com
data/README.md CHANGED
@@ -40,6 +40,9 @@ Please, read [Guard usage doc](https://github.com/guard/guard#readme)
40
40
  :stdlib => true, # run ctags for core and stdlib, generating stdlib.tags (default false)
41
41
  :binary => 'ctags-exuberant' # name of the ctags binary (default ctags)
42
42
  :arguments => '-R --languages=ruby --fields=+l' # change the arguments passed to ctags (default '-R --languages=ruby')
43
+ :stdlib_file => "stdlib.tags" # name of tags file for stdlib references (default stdlib.tags)
44
+ :bundler_tags_file => "gems.tags" # name of tags file for bundler gems references (default gems.tags)
45
+ :project_file => "tags" # name of tags file for project references (default tags)
43
46
  ```
44
47
 
45
48
  For a typical Rails application, `Guardfile` can look like this (default):
@@ -10,7 +10,7 @@ module Guard
10
10
  end
11
11
 
12
12
  def generate_project_tags
13
- generate_tags(@opts[:src_path] || ".", custom_path_for("tags"))
13
+ generate_tags(@opts[:src_path] || ".", custom_path_for(@opts.fetch(:project_file, "tags")))
14
14
  end
15
15
 
16
16
  def generate_bundler_tags
@@ -32,11 +32,11 @@ module Guard
32
32
  CMD
33
33
  paths = `ruby -e "#{cmd}"`
34
34
 
35
- generate_tags(paths.strip, custom_path_for("gems.tags"))
35
+ generate_tags(paths.strip, custom_path_for(@opts.fetch(:bundler_tags_file, "gems.tags")))
36
36
  end
37
37
 
38
38
  def generate_stdlib_tags
39
- generate_tags(stdlib_path, custom_path_for("stdlib.tags"))
39
+ generate_tags(stdlib_path, custom_path_for(@opts.fetch(:stdlib_file, "stdlib.tags")))
40
40
  end
41
41
 
42
42
  private
@@ -1,7 +1,7 @@
1
1
  module Guard
2
2
  module Ctags
3
3
  module Bundler
4
- VERSION = "1.0.2"
4
+ VERSION = "1.1.0"
5
5
  end
6
6
  end
7
7
  end
@@ -37,18 +37,46 @@ class CtagsGeneratorTest < MiniTest::Unit::TestCase
37
37
  refute_match("method_of_class_3", result)
38
38
  end
39
39
 
40
- def test_generate_stdlib_tags
41
- generator.generate_stdlib_tags
42
- assert File.exists?(test_stdlib_tags_file)
43
- result = File.read(test_stdlib_tags_file)
44
- assert_match("DateTime", result)
45
- assert_match("YAML", result)
46
- refute_match(/\bGuardfile\b/, result)
40
+ def test_generate_bundler_tags_for_gems_file
41
+ generator(:bundler_tags_file => 'override.tags').generate_bundler_tags
42
+ assert File.exists?(test_override_tags_file)
43
+ result = File.read(test_override_tags_file)
44
+ assert_match(/\bGuardfile\b/, result)
47
45
  refute_match("method_of_class_1", result)
48
46
  refute_match("method_of_class_2", result)
49
47
  refute_match("method_of_class_3", result)
50
48
  end
51
49
 
50
+ def test_generate_stdlib_tags
51
+ # rubinius standard library is packaged in gems
52
+ if defined?(RUBY_ENGINE) && RUBY_ENGINE != "rbx"
53
+ generator.generate_stdlib_tags
54
+ assert File.exists?(test_stdlib_tags_file)
55
+ result = File.read(test_stdlib_tags_file)
56
+ assert_match("DateTime", result)
57
+ assert_match("YAML", result)
58
+ refute_match(/\bGuardfile\b/, result)
59
+ refute_match("method_of_class_1", result)
60
+ refute_match("method_of_class_2", result)
61
+ refute_match("method_of_class_3", result)
62
+ end
63
+ end
64
+
65
+ def test_generate_stdlib_tags_for_stdlib_file
66
+ # rubinius standard library is packaged in gems
67
+ if defined?(RUBY_ENGINE) && RUBY_ENGINE != "rbx"
68
+ generator(:stdlib_file => "override.tags").generate_stdlib_tags
69
+ assert File.exists?(test_override_tags_file)
70
+ result = File.read(test_override_tags_file)
71
+ assert_match("DateTime", result)
72
+ assert_match("YAML", result)
73
+ refute_match(/\bGuardfile\b/, result)
74
+ refute_match("method_of_class_1", result)
75
+ refute_match("method_of_class_2", result)
76
+ refute_match("method_of_class_3", result)
77
+ end
78
+ end
79
+
52
80
  def test_generate_project_tags_for_custom_path
53
81
  generator(:custom_path => "custom").generate_project_tags
54
82
  result = File.read(custom_path_file)
@@ -58,6 +86,15 @@ class CtagsGeneratorTest < MiniTest::Unit::TestCase
58
86
  refute_match("Rake", result)
59
87
  end
60
88
 
89
+ def test_generate_project_tags_for_project_file
90
+ generator(:project_file => "override.tags").generate_project_tags
91
+ result = File.read(test_override_tags_file)
92
+ assert_match("method_of_class_1", result)
93
+ assert_match("method_of_class_2", result)
94
+ assert_match("method_of_class_3", result)
95
+ refute_match("Rake", result)
96
+ end
97
+
61
98
  def test_generate_tags_with_arguments
62
99
  generator(:src_path => ["app", "lib"], :arguments => '-R --languages=java').generate_project_tags
63
100
  result = File.read(test_tags_file)
data/test/test_helper.rb CHANGED
@@ -22,8 +22,12 @@ def test_stdlib_tags_file
22
22
  File.join(test_project_path, "stdlib.tags")
23
23
  end
24
24
 
25
+ def test_override_tags_file
26
+ File.join(test_project_path, "override.tags")
27
+ end
28
+
25
29
  def clean_tags
26
- [test_tags_file, test_gems_tags_file, test_stdlib_tags_file, custom_path_file].each do |file|
30
+ [test_tags_file, test_gems_tags_file, test_stdlib_tags_file, custom_path_file, test_override_tags_file].each do |file|
27
31
  File.delete(file) if File.exists?(file)
28
32
  end
29
33
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-ctags-bundler
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ivan Tkalin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-11 00:00:00.000000000 Z
11
+ date: 2014-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -133,4 +133,13 @@ signing_key:
133
133
  specification_version: 4
134
134
  summary: Guard gem for generating ctags for project files and gems from project's
135
135
  bundle.
136
- test_files: []
136
+ test_files:
137
+ - test/ctags-bundler/ctags_generator_test.rb
138
+ - test/ctags-bundler_test.rb
139
+ - test/test_helper.rb
140
+ - test/test_project/Gemfile
141
+ - test/test_project/app/.#class2.rb
142
+ - test/test_project/app/class1.java
143
+ - test/test_project/app/class1.rb
144
+ - test/test_project/lib/class2.rb
145
+ - test/test_project/vendor/class3.rb