vim-tags 0.1.0

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.
Files changed (7) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +1735 -0
  3. data/Gemfile +10 -0
  4. data/Rakefile +4 -0
  5. data/plugins.rb +38 -0
  6. data/vim-tags.gemspec +21 -0
  7. metadata +62 -0
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in vim-tags.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "minitest", "~> 5.0"
data/Rakefile ADDED
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rake/testtask"
data/plugins.rb ADDED
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler"
4
+
5
+ class VimTagsCommand < Bundler::Plugin::API
6
+ command "vim-tags"
7
+
8
+ def exec(*)
9
+ cache_file = File.join(Bundler.app_config_path, ".tag_files")
10
+
11
+ puts "\nWriting tag cache to #{cache_file}"
12
+
13
+ File.open(cache_file, "w") do |f|
14
+ f.truncate(0)
15
+
16
+ f.write (gem_paths + ruby_paths).uniq.join("\n")
17
+ end
18
+ end
19
+
20
+ def gem_paths
21
+ Bundler.load.specs.filter_map do |spec|
22
+ path = File.join(spec.full_gem_path, "tags")
23
+
24
+ next if spec.name == "bundler" || !File.exist?(path)
25
+
26
+ path
27
+ end
28
+ end
29
+
30
+ def ruby_paths
31
+ $:.map { |path| File.join(path, "tags") }.
32
+ select { |path| File.exist?(path) }
33
+ end
34
+ end
35
+
36
+ Bundler::Plugin.add_hook("after-install-all") do |_dependencies|
37
+ VimTagsCommand.new.exec
38
+ end
data/vim-tags.gemspec ADDED
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ Gem::Specification.new do |spec|
4
+ spec.name = "vim-tags"
5
+ spec.version = "0.1.0"
6
+ spec.authors = ["Nick Pezza"]
7
+ spec.email = ["pezza@hey.com"]
8
+
9
+ spec.summary = "Generate cache file of all paths to tags files of dependencies"
10
+ spec.license = "MIT"
11
+ spec.required_ruby_version = ">= 2.7.0"
12
+
13
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
14
+ `git ls-files -z`.split("\x0").reject do |f|
15
+ (f == __FILE__) || f.match(%r{\A(?:(?:test|bin|lib)/|\.(?:git))}) ||
16
+ f.end_with?("md") || f.end_with?("txt")
17
+ end
18
+ end
19
+
20
+ spec.add_development_dependency "debug"
21
+ end
metadata ADDED
@@ -0,0 +1,62 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: vim-tags
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Nick Pezza
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-10-29 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: debug
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ description:
28
+ email:
29
+ - pezza@hey.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".rubocop.yml"
35
+ - Gemfile
36
+ - Rakefile
37
+ - plugins.rb
38
+ - vim-tags.gemspec
39
+ homepage:
40
+ licenses:
41
+ - MIT
42
+ metadata: {}
43
+ post_install_message:
44
+ rdoc_options: []
45
+ require_paths:
46
+ - lib
47
+ required_ruby_version: !ruby/object:Gem::Requirement
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ version: 2.7.0
52
+ required_rubygems_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: '0'
57
+ requirements: []
58
+ rubygems_version: 3.2.22
59
+ signing_key:
60
+ specification_version: 4
61
+ summary: Generate cache file of all paths to tags files of dependencies
62
+ test_files: []