gem-ctags 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.markdown CHANGED
@@ -1,31 +1,25 @@
1
1
  RubyGems Automatic Ctags Invoker
2
2
  ================================
3
3
 
4
- Nary a day of Ruby development goes by where I don't run `gem open`.
5
- And when I do, I want tags. As good as I've gotten at `ctags -R .`,
6
- I've grown weary of it. So I wrote a RubyGems plugin to automatically
7
- invoke Ctags every time a Gem is installed.
4
+ Nary a day of Ruby development goes by where I don't run `bundle open`
5
+ or `gem open`. And when I go rooting around in a gem, I want tags. As
6
+ good as I've gotten at `ctags -R .`, I've grown weary of it. So I wrote
7
+ a RubyGems plugin to automatically invoke Ctags on gems as they are
8
+ installed.
8
9
 
9
10
  Installation
10
11
  ------------
12
+ If you haven't already, install [Exuberant Ctags][] and make sure it
13
+ comes first in `$PATH`. With Homebrew, `brew install ctags`. Now all
14
+ that's left to do is install gem-ctags and perform a one-off indexing of
15
+ the gems that are already installed:
11
16
 
12
17
  gem install gem-ctags
18
+ gem ctags
13
19
 
14
- Now all that's left to do is install [Exuberant Ctags][] and make sure
15
- it comes first in `$PATH`. With Homebrew, `brew install ctags`.
16
-
17
- If you're using RVM, I recommend extending your global gemset:
18
-
19
- echo gem-ctags >> ~/.rvm/gemsets/global.gems
20
-
21
- To generate tags for all previously installed gems that don't already
22
- have a `tags` file, run `gem ctags`. (If it blows up, upgrade
23
- RubyGems.) Future gems will be handled automatically and silently, with
24
- the sad exception of those installed by Bundler (see
25
- [this issue](https://github.com/carlhuda/bundler/pull/1364)).
26
- Temporary workaround:
27
-
28
- echo Gem.load_plugins >> "$(gem which bundler/cli)"
20
+ If you're using RVM, I recommend extending your global gemset by adding
21
+ `gem-ctags` to `~/.rvm/gemsets/global.gems`. Put it at the top so the
22
+ gems below it will be indexed.
29
23
 
30
24
  Vim Tips
31
25
  --------
data/gem-ctags.gemspec CHANGED
@@ -3,7 +3,7 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "gem-ctags"
6
- s.version = "1.0.1"
6
+ s.version = "1.0.2"
7
7
  s.authors = ["Tim Pope"]
8
8
  s.email = ["ruby@tpop"+'e.org']
9
9
  s.homepage = "https://github.com/tpope/gem-ctags"
@@ -6,20 +6,34 @@ class Gem::Commands::CtagsCommand < Gem::Command
6
6
  end
7
7
 
8
8
  def execute
9
- Gem::Specification.each do |spec|
10
- self.class.index(spec) do
11
- say "Generating ctags for #{spec.full_name}"
9
+ if Gem::Specification.respond_to?(:each)
10
+ Gem::Specification
11
+ else
12
+ Gem.source_index.gems.values
13
+ end.each do |spec|
14
+ self.class.index(spec) do |message|
15
+ say message
12
16
  end
13
17
  end
14
18
  end
15
19
 
16
20
  def self.index(spec)
17
21
  Dir.chdir(spec.full_gem_path) do
22
+
18
23
  unless File.exist?('tags')
19
- yield if block_given?
24
+ yield "Generating ctags for #{spec.full_name}" if block_given?
20
25
  paths = spec.require_paths.select { |p| File.directory?(p) }
21
26
  system('ctags', '-R', '--languages=ruby', *paths)
22
27
  end
28
+
29
+ target = 'lib/bundler/cli.rb'
30
+ if File.exist?(target) && File.read(target) !~ /plugin/
31
+ yield "Injecting gem-ctags into #{spec.full_name}" if block_given?
32
+ File.open(target, 'a') do |f|
33
+ f.write "\nGem.load_plugins rescue nil\n"
34
+ end
35
+ end
36
+
23
37
  end
24
38
  end
25
39
  end
metadata CHANGED
@@ -1,39 +1,34 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: gem-ctags
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.2
4
5
  prerelease:
5
- version: 1.0.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Tim Pope
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-08-23 00:00:00 -04:00
14
- default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
12
+ date: 2011-08-23 00:00:00.000000000Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
17
15
  name: rake
18
- prerelease: false
19
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: &82709410 !ruby/object:Gem::Requirement
20
17
  none: false
21
- requirements:
22
- - - ">="
23
- - !ruby/object:Gem::Version
24
- version: "0"
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
25
22
  type: :development
26
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: *82709410
27
25
  description:
28
- email:
26
+ email:
29
27
  - ruby@tpope.org
30
28
  executables: []
31
-
32
29
  extensions: []
33
-
34
30
  extra_rdoc_files: []
35
-
36
- files:
31
+ files:
37
32
  - .gitignore
38
33
  - Gemfile
39
34
  - MIT-LICENSE
@@ -42,33 +37,28 @@ files:
42
37
  - gem-ctags.gemspec
43
38
  - lib/rubygems/commands/ctags_command.rb
44
39
  - lib/rubygems_plugin.rb
45
- has_rdoc: true
46
40
  homepage: https://github.com/tpope/gem-ctags
47
41
  licenses: []
48
-
49
42
  post_install_message:
50
43
  rdoc_options: []
51
-
52
- require_paths:
44
+ require_paths:
53
45
  - lib
54
- required_ruby_version: !ruby/object:Gem::Requirement
46
+ required_ruby_version: !ruby/object:Gem::Requirement
55
47
  none: false
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- version: "0"
60
- required_rubygems_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
61
53
  none: false
62
- requirements:
63
- - - ">="
64
- - !ruby/object:Gem::Version
65
- version: "0"
54
+ requirements:
55
+ - - ! '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
66
58
  requirements: []
67
-
68
59
  rubyforge_project:
69
- rubygems_version: 1.6.2
60
+ rubygems_version: 1.8.6
70
61
  signing_key:
71
62
  specification_version: 3
72
63
  summary: Automatic ctags generation on gem install
73
64
  test_files: []
74
-