ctags_ruby 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/.rspec +2 -0
- data/.travis.yml +7 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +22 -0
- data/README.md +49 -0
- data/Rakefile +6 -0
- data/bin/ctags_ruby +5 -0
- data/ctags_ruby.gemspec +22 -0
- data/lib/ctags_ruby/gem_tags.rb +27 -0
- data/lib/ctags_ruby/tags.rb +15 -0
- data/lib/ctags_ruby/version.rb +3 -0
- data/lib/ctags_ruby.rb +22 -0
- data/spec/lib/ctags_ruby/gem_tags_spec.rb +5 -0
- data/spec/lib/ctags_ruby/tags_spec.rb +17 -0
- data/spec/spec_helper.rb +17 -0
- metadata +65 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8c92085b0083a581aee18ac4f0a16038827b9ed2
|
4
|
+
data.tar.gz: 85558aa8cca750f096c038b4992fc9c4e747ce89
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: ee3636a4559f0744c7b82993dcc172ab8b02082bffdd374baea799b6eb9732e7dd1f6cc747dfe11782abc884af0cc71f88cda970b7d61afc4ba9d59acd35601b
|
7
|
+
data.tar.gz: f09027202420ac4ad490d23aa4a1ce51003900c0f8c1c296ea7287a471d40093f97d66146673bbd004b4c0bea89935704862776b5ac47e83030834192ac3df64
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Kristian Rasmussen
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# CtagsRuby
|
2
|
+
|
3
|
+
Generate ctags files for your ruby project and your projects dependencies.
|
4
|
+
It will generate a ```.tags``` file for the project files and a ```.gemtags```
|
5
|
+
for the dependencies, based upon you ```Gemfile```
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Install it using
|
10
|
+
~~~shell
|
11
|
+
gem install ctags_ruby
|
12
|
+
~~~
|
13
|
+
|
14
|
+
## Requirements
|
15
|
+
|
16
|
+
The gem requires that you have
|
17
|
+
|
18
|
+
* ```find```
|
19
|
+
* ```ctags```
|
20
|
+
|
21
|
+
in your path.
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
Cd into your project and simply type
|
26
|
+
|
27
|
+
```shell
|
28
|
+
ctags_ruby
|
29
|
+
```
|
30
|
+
|
31
|
+
## Contributing
|
32
|
+
|
33
|
+
1. Fork it
|
34
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
35
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
36
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
37
|
+
5. Create new Pull Request
|
38
|
+
|
39
|
+
## Todo
|
40
|
+
|
41
|
+
* Make a verbose command line option
|
42
|
+
* Let it take ctags arguments
|
43
|
+
* Let it take file mask arguments
|
44
|
+
|
45
|
+
# Author
|
46
|
+
|
47
|
+
Kristian Rasmussen
|
48
|
+
|
49
|
+
License: MIT
|
data/Rakefile
ADDED
data/bin/ctags_ruby
ADDED
data/ctags_ruby.gemspec
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'ctags_ruby/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "ctags_ruby"
|
8
|
+
spec.version = CtagsRuby::VERSION
|
9
|
+
spec.authors = ["Kristian Rasmussen"]
|
10
|
+
spec.email = ["kristian@iamkristian.com"]
|
11
|
+
spec.description = %q{Threaded wrapper for ctags}
|
12
|
+
spec.summary = %q{WIll run ctags in multiple threads on your projec\
|
13
|
+
and dependent gems.}
|
14
|
+
spec.homepage = "http://github.com/iamkristian/ctags_ruby"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = `git ls-files`.split($/)
|
18
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
19
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
20
|
+
spec.require_paths = ["lib"]
|
21
|
+
|
22
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
class GemTags
|
2
|
+
|
3
|
+
def initialize
|
4
|
+
end
|
5
|
+
|
6
|
+
def generate
|
7
|
+
traverse_gemfile
|
8
|
+
system ctags_expression
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def ctags_expression
|
14
|
+
"ctags -R -f .gemtags #{@paths}"
|
15
|
+
end
|
16
|
+
|
17
|
+
def traverse_gemfile
|
18
|
+
if File.exist? gem_file
|
19
|
+
require 'bundler'
|
20
|
+
@paths = Bundler.load.specs.map(&:full_gem_path).join(' ')
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def gem_file
|
25
|
+
'./Gemfile'
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
class Tags
|
2
|
+
|
3
|
+
attr_reader :filename, :mask
|
4
|
+
def initialize(filename = ".tags", mask = '*.rb')
|
5
|
+
@filename, @mask = filename, mask
|
6
|
+
end
|
7
|
+
|
8
|
+
def generate
|
9
|
+
system find_expression
|
10
|
+
end
|
11
|
+
|
12
|
+
def find_expression
|
13
|
+
"find . -name '#{mask}' | ctags -f #{filename} -L -"
|
14
|
+
end
|
15
|
+
end
|
data/lib/ctags_ruby.rb
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
require "ctags_ruby/version"
|
2
|
+
require "ctags_ruby/gem_tags"
|
3
|
+
require "ctags_ruby/tags"
|
4
|
+
|
5
|
+
module CtagsRuby
|
6
|
+
def self.generate
|
7
|
+
do_tags
|
8
|
+
do_gem_tags
|
9
|
+
end
|
10
|
+
|
11
|
+
private
|
12
|
+
|
13
|
+
def self.do_tags
|
14
|
+
tags = Tags.new
|
15
|
+
tags.generate
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.do_gem_tags
|
19
|
+
gem_tags = GemTags.new
|
20
|
+
gem_tags.generate
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require 'ctags_ruby/tags'
|
3
|
+
|
4
|
+
describe Tags do
|
5
|
+
|
6
|
+
let(:filename) { ".fish" }
|
7
|
+
let(:mask) { "*.cod" }
|
8
|
+
let(:tags) { Tags.new(filename, mask) }
|
9
|
+
|
10
|
+
it "sets filename" do
|
11
|
+
tags.filename.should == filename
|
12
|
+
end
|
13
|
+
|
14
|
+
it "sets mask" do
|
15
|
+
tags.mask.should == mask
|
16
|
+
end
|
17
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
+
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
+
# Require this file using `require "spec_helper"` to ensure that it is only
|
4
|
+
# loaded once.
|
5
|
+
#
|
6
|
+
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
7
|
+
RSpec.configure do |config|
|
8
|
+
config.treat_symbols_as_metadata_keys_with_true_values = true
|
9
|
+
config.run_all_when_everything_filtered = true
|
10
|
+
config.filter_run :focus
|
11
|
+
|
12
|
+
# Run specs in random order to surface order dependencies. If you find an
|
13
|
+
# order dependency and want to debug it, you can fix the order by providing
|
14
|
+
# the seed, which is printed after each run.
|
15
|
+
# --seed 1234
|
16
|
+
config.order = 'random'
|
17
|
+
end
|
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: ctags_ruby
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Kristian Rasmussen
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2014-01-16 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Threaded wrapper for ctags
|
14
|
+
email:
|
15
|
+
- kristian@iamkristian.com
|
16
|
+
executables:
|
17
|
+
- ctags_ruby
|
18
|
+
extensions: []
|
19
|
+
extra_rdoc_files: []
|
20
|
+
files:
|
21
|
+
- .gitignore
|
22
|
+
- .rspec
|
23
|
+
- .travis.yml
|
24
|
+
- Gemfile
|
25
|
+
- LICENSE.txt
|
26
|
+
- README.md
|
27
|
+
- Rakefile
|
28
|
+
- bin/ctags_ruby
|
29
|
+
- ctags_ruby.gemspec
|
30
|
+
- lib/ctags_ruby.rb
|
31
|
+
- lib/ctags_ruby/gem_tags.rb
|
32
|
+
- lib/ctags_ruby/tags.rb
|
33
|
+
- lib/ctags_ruby/version.rb
|
34
|
+
- spec/lib/ctags_ruby/gem_tags_spec.rb
|
35
|
+
- spec/lib/ctags_ruby/tags_spec.rb
|
36
|
+
- spec/spec_helper.rb
|
37
|
+
homepage: http://github.com/iamkristian/ctags_ruby
|
38
|
+
licenses:
|
39
|
+
- MIT
|
40
|
+
metadata: {}
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options: []
|
43
|
+
require_paths:
|
44
|
+
- lib
|
45
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
46
|
+
requirements:
|
47
|
+
- - '>='
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '0'
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
requirements: []
|
56
|
+
rubyforge_project:
|
57
|
+
rubygems_version: 2.0.14
|
58
|
+
signing_key:
|
59
|
+
specification_version: 4
|
60
|
+
summary: WIll run ctags in multiple threads on your projec\ and dependent gems.
|
61
|
+
test_files:
|
62
|
+
- spec/lib/ctags_ruby/gem_tags_spec.rb
|
63
|
+
- spec/lib/ctags_ruby/tags_spec.rb
|
64
|
+
- spec/spec_helper.rb
|
65
|
+
has_rdoc:
|