guard-ctags-bundler 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +4 -0
- data/LICENSE +9 -0
- data/README.md +45 -0
- data/Rakefile +1 -0
- data/guard-ctags-bundler.gemspec +26 -0
- data/lib/guard/ctags-bundler/templates/Guardfile +5 -0
- data/lib/guard/ctags-bundler/version.rb +7 -0
- data/lib/guard/ctags-bundler.rb +43 -0
- metadata +87 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2011 Ivan Tkalin
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
6
|
+
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
8
|
+
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
Guard-CTags-Bundler
|
2
|
+
=
|
3
|
+
|
4
|
+
Guard-CTags-Bundler generates [ctags](http://ctags.sourceforge.net) for your project and for gems in your bundle. For project tags file `tags` is generated, for gems tags file `gems.tags` is generated.
|
5
|
+
|
6
|
+
Features
|
7
|
+
-
|
8
|
+
|
9
|
+
* Initially developed for Rails projects, but theoretically can be used with any ruby project, that uses Bundler, with minimal configuration changes.
|
10
|
+
* When you run `bundle install` in your project, `gems.tags` file is automatically is generated or updated.
|
11
|
+
* When you save one of you project's ruby files, `tags` file is automatically generated or updated.
|
12
|
+
* Only Linux is tested, but probably will work on Mac
|
13
|
+
|
14
|
+
## Install
|
15
|
+
|
16
|
+
Make sure you have [Guard](http://github.com/guard/guard) installed.
|
17
|
+
|
18
|
+
Install the gem:
|
19
|
+
|
20
|
+
$ gem install guard-ctags-bundler
|
21
|
+
|
22
|
+
Add it to your `Gemfile` (inside development group):
|
23
|
+
|
24
|
+
gem 'guard-ctags-bundler'
|
25
|
+
|
26
|
+
And then add a basic setup to your `Guardfile`:
|
27
|
+
|
28
|
+
$ guard init ctags-bundler
|
29
|
+
|
30
|
+
|
31
|
+
## CTags
|
32
|
+
|
33
|
+
[Ctags](http://ctags.sourceforge.net) generates an index (or tag) file of language objects found in source files that allows these items to be quickly and easily located by a text editor or other utility. A tag signifies a language object for which an index entry is available (or, alternatively, the index entry created for that object).
|
34
|
+
|
35
|
+
In ubuntu you can install ctags by running
|
36
|
+
|
37
|
+
$ sudo apt-get install exuberant-ctags
|
38
|
+
|
39
|
+
## Vim
|
40
|
+
|
41
|
+
Vim supports ctags by default. All you need to do is add your `gems.tags` file to the Vim's tag stack.
|
42
|
+
|
43
|
+
set tags+=gems.tags
|
44
|
+
|
45
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "guard/ctags-bundler/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |s|
|
6
|
+
s.name = "guard-ctags-bundler"
|
7
|
+
s.version = Guard::Ctags::Bundler::VERSION
|
8
|
+
s.authors = ["Ivan Tkalin"]
|
9
|
+
s.email = ["itkalin@gmail.com"]
|
10
|
+
s.homepage = "https://github.com/ivalkeen/guard-ctags-bundler"
|
11
|
+
s.summary = %q{Guard gem for generating ctags for project files and gems from project's bundle.}
|
12
|
+
s.description = %q{Guard::CtagsBundler uses ctags utility and generates 2 files: tags -- with tags generated from project's source tree and gems.tags -- with tags generated from rubygems from project's bundle.}
|
13
|
+
|
14
|
+
s.rubyforge_project = "guard-ctags-bundler"
|
15
|
+
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
20
|
+
|
21
|
+
# specify any dependencies here; for example:
|
22
|
+
s.add_dependency 'guard', '>= 0.4.0'
|
23
|
+
|
24
|
+
# s.add_development_dependency "rspec"
|
25
|
+
# s.add_runtime_dependency "rest-client"
|
26
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require "guard/ctags-bundler/version"
|
2
|
+
require 'guard'
|
3
|
+
require 'guard/guard'
|
4
|
+
require 'rubygems'
|
5
|
+
|
6
|
+
module Guard
|
7
|
+
class CtagsBundler < Guard
|
8
|
+
BUNDLER = "__bundler__"
|
9
|
+
|
10
|
+
def initialize(watchers = [], options = {})
|
11
|
+
super(watchers, options)
|
12
|
+
end
|
13
|
+
|
14
|
+
def start
|
15
|
+
UI.info 'Guard::CtagsBundler is running!'
|
16
|
+
end
|
17
|
+
|
18
|
+
def run_on_change(paths)
|
19
|
+
if paths == [BUNDLER]
|
20
|
+
UI.info "regenerating bundler tags..."
|
21
|
+
generate_bundler_tags
|
22
|
+
else
|
23
|
+
UI.info "regenerating project tags..."
|
24
|
+
generate_project_tags(paths)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
private
|
29
|
+
|
30
|
+
def generate_project_tags(paths)
|
31
|
+
Thread.new do
|
32
|
+
system("find #{paths.join(' ')} -type f -name \\*.rb | ctags -f tags -L -")
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def generate_bundler_tags
|
37
|
+
Thread.new do
|
38
|
+
paths = `ruby -e "require('bundler'); puts(Bundler.load.specs.map(&:full_gem_path).join(' '))"`
|
39
|
+
system("find #{paths.strip} -type f -name \\*.rb | ctags -f gems.tags -L -")
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: guard-ctags-bundler
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
version: 0.0.1
|
10
|
+
platform: ruby
|
11
|
+
authors:
|
12
|
+
- Ivan Tkalin
|
13
|
+
autorequire:
|
14
|
+
bindir: bin
|
15
|
+
cert_chain: []
|
16
|
+
|
17
|
+
date: 2011-10-02 00:00:00 +04:00
|
18
|
+
default_executable:
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: guard
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 0
|
30
|
+
- 4
|
31
|
+
- 0
|
32
|
+
version: 0.4.0
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
description: "Guard::CtagsBundler uses ctags utility and generates 2 files: tags -- with tags generated from project's source tree and gems.tags -- with tags generated from rubygems from project's bundle."
|
36
|
+
email:
|
37
|
+
- itkalin@gmail.com
|
38
|
+
executables: []
|
39
|
+
|
40
|
+
extensions: []
|
41
|
+
|
42
|
+
extra_rdoc_files: []
|
43
|
+
|
44
|
+
files:
|
45
|
+
- .gitignore
|
46
|
+
- Gemfile
|
47
|
+
- LICENSE
|
48
|
+
- README.md
|
49
|
+
- Rakefile
|
50
|
+
- guard-ctags-bundler.gemspec
|
51
|
+
- lib/guard/ctags-bundler.rb
|
52
|
+
- lib/guard/ctags-bundler/templates/Guardfile
|
53
|
+
- lib/guard/ctags-bundler/version.rb
|
54
|
+
has_rdoc: true
|
55
|
+
homepage: https://github.com/ivalkeen/guard-ctags-bundler
|
56
|
+
licenses: []
|
57
|
+
|
58
|
+
post_install_message:
|
59
|
+
rdoc_options: []
|
60
|
+
|
61
|
+
require_paths:
|
62
|
+
- lib
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
segments:
|
69
|
+
- 0
|
70
|
+
version: "0"
|
71
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
|
+
none: false
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
segments:
|
77
|
+
- 0
|
78
|
+
version: "0"
|
79
|
+
requirements: []
|
80
|
+
|
81
|
+
rubyforge_project: guard-ctags-bundler
|
82
|
+
rubygems_version: 1.3.7
|
83
|
+
signing_key:
|
84
|
+
specification_version: 3
|
85
|
+
summary: Guard gem for generating ctags for project files and gems from project's bundle.
|
86
|
+
test_files: []
|
87
|
+
|