gem-ripper-tags 1.0.6 → 1.2.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 8c6ea55c183755fb7695d49740bf0f226dfa250d2e3274afa89e6bdfc3b2ee66
4
+ data.tar.gz: 43aebe2e69d2df82481842bc36aa5e8bc86efd3359f5c3d646b22f0e1d7a7abb
5
+ SHA512:
6
+ metadata.gz: 94cddba3bfb31dd9844852d9e2093b1ca36f4a65fbdb58a61733a9db24365659e1016e819eed1aa2d1e7f496cb2393aa564de6778a8abf2a88b373885de65d3f
7
+ data.tar.gz: 28ac3c3e4c716f6c79ce800ca7dc7d2798d9a43931eb99a1e3294ebf5190eb4cabed951435a4c323ecfc30dc2edfa57c56807452e08c7a080a53454a103f4a06
data/README.markdown CHANGED
@@ -1,6 +1,8 @@
1
1
  RubyGems Automatic Ctags Generator
2
2
  ==================================
3
3
 
4
+ [![CI](https://github.com/lzap/gem-ripper-tags/actions/workflows/ci.yml/badge.svg)](https://github.com/lzap/gem-ripper-tags/actions/workflows/ci.yml)
5
+
4
6
  If you do like Vim and Ctags like I or [Tim Pope][] do, you maybe appreciate
5
7
  automatic generation of ctags for each installed gem. This small project is
6
8
  based on Tim's [gem-ctags][], but the main difference is it does *not* use
@@ -11,7 +13,7 @@ Upstream site is at: https://github.com/lzap/gem-ripper-tags
11
13
  Usage
12
14
  -----
13
15
 
14
- Install the thing (only Ruby 1.9+):
16
+ Install the gem (requires Ruby 2.0+, tested on Ruby 3.1-3.4):
15
17
 
16
18
  gem install gem-ripper-tags
17
19
 
@@ -27,9 +29,6 @@ If you're using RVM, I recommend extending your global gemset by adding
27
29
  `gem-ripper-tags` to `~/.rvm/gemsets/global.gems`. Put it at the top so the
28
30
  gems below it will be indexed.
29
31
 
30
- You can use the gem even with 1.8 gemsets, but since Ruby 1.8 is not
31
- supported, it will (silently) not register the gem hook.
32
-
33
32
  Motivation
34
33
  ----------
35
34
 
@@ -52,9 +51,23 @@ Regeneration
52
51
  ------------
53
52
 
54
53
  If you want to regenerate all tagfiles from scratch, use:
55
-
54
+
56
55
  gem ripper_tags --reindex
57
56
 
57
+ Testing
58
+ -------
59
+
60
+ To test the gem locally:
61
+
62
+ ./test.sh
63
+
64
+ To test with Emacs TAGS format:
65
+
66
+ RIPPER_TAGS_EMACS=1 ./test.sh
67
+
68
+ The test suite will build, install the gem, and verify that tags are generated
69
+ correctly for popular gems.
70
+
58
71
  Emacs support
59
72
  -------------
60
73
 
@@ -17,14 +17,8 @@ class Gem::Commands::RipperTagsCommand < Gem::Command
17
17
  end
18
18
 
19
19
  def execute
20
- if Gem::Specification.respond_to?(:each)
21
- Gem::Specification
22
- else
23
- Gem.source_index.gems.values
24
- end.each do |spec|
25
- self.class.index(spec, options[:reindex], options[:emacs]) do |message|
26
- say message
27
- end
20
+ Gem::Specification.each do |spec|
21
+ self.class.index(spec, ui, options[:reindex], options[:emacs], options[:debug])
28
22
  end
29
23
  rescue Exception => e
30
24
  if options[:debug] || ENV['RIPPER_TAGS_DEBUG']
@@ -34,9 +28,7 @@ class Gem::Commands::RipperTagsCommand < Gem::Command
34
28
  raise e
35
29
  end
36
30
 
37
- def self.index(spec, reindex, emacs)
38
- return unless File.directory?(spec.full_gem_path)
39
-
31
+ def self.index(spec, ui, reindex, emacs, debug)
40
32
  if emacs
41
33
  tag_filename = 'TAGS'
42
34
  format = "emacs"
@@ -45,25 +37,27 @@ class Gem::Commands::RipperTagsCommand < Gem::Command
45
37
  format = "vim"
46
38
  end
47
39
 
48
- Dir.chdir(spec.full_gem_path) do
49
- if (!File.directory?(tag_filename) && reindex) || (!File.file?(tag_filename) && !File.directory?(tag_filename))
50
- yield "Ripper is generating ctags for #{spec.full_name}" if block_given?
51
- riopt = RipperTags.default_options
52
- riopt.tag_file_name = "./#{tag_filename}"
53
- riopt.format = format
54
- riopt.recursive = true
55
- riopt.force = true
56
- RipperTags.run riopt
57
- end
58
-
59
- target = 'lib/bundler/cli.rb'
60
- if File.writable?(target) && !File.read(target).include?('load_plugins')
61
- yield "Injecting gem-ripper-tags into #{spec.full_name}" if block_given?
62
- File.open(target, 'a') do |f|
63
- f.write "\nGem.load_plugins rescue nil\n"
64
- end
65
- end
40
+ return unless File.directory?(spec.full_gem_path)
41
+ tag_file = File.join(spec.full_gem_path, tag_filename)
66
42
 
43
+ if (!File.directory?(tag_filename) && reindex) || (!File.file?(tag_filename) && !File.directory?(tag_filename))
44
+ ui.say "Ripper is generating ctags for #{spec.full_name}"
45
+ riopt = RipperTags.default_options
46
+ riopt.tag_relative = "always"
47
+ riopt.tag_file_name = tag_file
48
+ riopt.format = format
49
+ riopt.recursive = true
50
+ riopt.force = true
51
+ riopt.files = [spec.full_gem_path]
52
+ RipperTags.run riopt
53
+ end
54
+ rescue Errno::EACCES
55
+ ui.say "Ripper cannot write to #{tag_file}"
56
+ rescue => e
57
+ raise unless ui
58
+ ui.say "Failed processing ctags for #{spec.full_name} (#{e.class})"
59
+ if debug
60
+ ui.say e
67
61
  end
68
62
  end
69
63
  end
@@ -1,7 +1,7 @@
1
1
  require 'rubygems/command_manager'
2
2
  begin
3
3
  require 'rubygems/commands/ripper_tags_command'
4
- rescue LoadError => e
4
+ rescue LoadError
5
5
  old_ruby = true
6
6
  end
7
7
 
@@ -9,6 +9,6 @@ unless old_ruby
9
9
  Gem::CommandManager.instance.register_command :ripper_tags
10
10
 
11
11
  Gem.post_install do |installer|
12
- Gem::Commands::RipperTagsCommand.index(installer.spec, false, !ENV['RIPPER_TAGS_EMACS'].nil?)
12
+ Gem::Commands::RipperTagsCommand.index(installer.spec, installer.ui, false, !ENV['RIPPER_TAGS_EMACS'].nil?, false)
13
13
  end
14
14
  end
metadata CHANGED
@@ -1,50 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gem-ripper-tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
5
- prerelease:
4
+ version: 1.2.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Tim Pope
9
8
  - Lukas Zapletal
10
- autorequire:
11
9
  bindir: bin
12
10
  cert_chain: []
13
- date: 2013-08-19 00:00:00.000000000 Z
11
+ date: 1980-01-02 00:00:00.000000000 Z
14
12
  dependencies:
15
13
  - !ruby/object:Gem::Dependency
16
14
  name: ripper-tags
17
15
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
16
  requirements:
20
- - - ! '>='
17
+ - - ">="
21
18
  - !ruby/object:Gem::Version
22
19
  version: 0.1.2
23
20
  type: :runtime
24
21
  prerelease: false
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
23
  requirements:
28
- - - ! '>='
24
+ - - ">="
29
25
  - !ruby/object:Gem::Version
30
26
  version: 0.1.2
31
27
  - !ruby/object:Gem::Dependency
32
28
  name: rake
33
29
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
30
  requirements:
36
- - - ! '>='
31
+ - - ">="
37
32
  - !ruby/object:Gem::Version
38
33
  version: '0'
39
34
  type: :development
40
35
  prerelease: false
41
36
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
37
  requirements:
44
- - - ! '>='
38
+ - - ">="
45
39
  - !ruby/object:Gem::Version
46
40
  version: '0'
47
- description:
48
41
  email:
49
42
  - code@tpope.net
50
43
  - lzap+rpm@redhat.com
@@ -52,40 +45,30 @@ executables: []
52
45
  extensions: []
53
46
  extra_rdoc_files: []
54
47
  files:
55
- - .gitignore
56
- - Gemfile
57
48
  - MIT-LICENSE
58
49
  - README.markdown
59
50
  - Rakefile
60
- - gem-ripper-tags.gemspec
61
51
  - lib/rubygems/commands/ripper_tags_command.rb
62
52
  - lib/rubygems_plugin.rb
63
- - release.sh
64
- - test.sh
65
53
  homepage: https://github.com/lzap/gem-ripper-tags
66
54
  licenses:
67
55
  - MIT
68
- post_install_message:
56
+ metadata: {}
69
57
  rdoc_options: []
70
58
  require_paths:
71
59
  - lib
72
60
  required_ruby_version: !ruby/object:Gem::Requirement
73
- none: false
74
61
  requirements:
75
- - - ! '>='
62
+ - - ">="
76
63
  - !ruby/object:Gem::Version
77
- version: '0'
64
+ version: 2.0.0
78
65
  required_rubygems_version: !ruby/object:Gem::Requirement
79
- none: false
80
66
  requirements:
81
- - - ! '>='
67
+ - - ">="
82
68
  - !ruby/object:Gem::Version
83
69
  version: '0'
84
70
  requirements: []
85
- rubyforge_project:
86
- rubygems_version: 1.8.23
87
- signing_key:
88
- specification_version: 3
71
+ rubygems_version: 3.6.9
72
+ specification_version: 4
89
73
  summary: fast and accurate ctags generator on gem install
90
74
  test_files: []
91
- has_rdoc:
data/.gitignore DELETED
@@ -1,4 +0,0 @@
1
- *.gem
2
- .bundle
3
- Gemfile.lock
4
- pkg/*
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source "http://rubygems.org"
2
- gemspec
3
-
4
- gem 'ripper-tags'
@@ -1,20 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
-
4
- Gem::Specification.new do |s|
5
- s.name = "gem-ripper-tags"
6
- s.version = `git describe --abbrev=0 --tags`
7
- s.authors = ["Tim Pope", "Lukas Zapletal"]
8
- s.email = ["code@tpop"+'e.net', "lzap+rpm@red"+'hat.com']
9
- s.homepage = "https://github.com/lzap/gem-ripper-tags"
10
- s.summary = %q{fast and accurate ctags generator on gem install}
11
- s.license = 'MIT'
12
-
13
- s.files = `git ls-files`.split("\n")
14
- s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
15
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
16
- s.require_paths = ["lib"]
17
-
18
- s.add_dependency 'ripper-tags', '>= 0.1.2'
19
- s.add_development_dependency 'rake'
20
- end
data/release.sh DELETED
@@ -1,10 +0,0 @@
1
- #!/bin/bash
2
- #
3
- # Before running this make sure you tagged and pushed!
4
- #
5
-
6
- VERSION=$(git describe --abbrev=0 --tags)
7
- git checkout $VERSION && \
8
- gem build gem-ripper-tags.gemspec && \
9
- gem push gem-ripper-tags-$VERSION.gem && \
10
- git checkout master
data/test.sh DELETED
@@ -1,2 +0,0 @@
1
- #!/bin/bash
2
- rm gem-ripper-tags*.gem; gem build gem-ripper-tags.gemspec && gem uninstall gem-ripper-tags && gem install gem-ripper-tags-*.gem && gem ripper --debug