vim-tags 1.0.1 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1f84f9510f5e5a4ffbed2eb9eed43c93d4772a36c2ce62789e381fedb61bf2a
4
- data.tar.gz: '085a471a04ced7960a5eb86c45fc790ff707347b381f6b99b406cfe1ad6ea962'
3
+ metadata.gz: 6ca213be5515220844966a74f4c5aa14f71517b7b003c1bedd3c5d96ad965165
4
+ data.tar.gz: 199e3f85f614fa9113b98ee3df5ea3b1a7f2f0b38529fc11c1587c0346aa436d
5
5
  SHA512:
6
- metadata.gz: 2e41f601fd32bb16db62c710e3978a7cf192045f7e7e74e8fd0b6acc81fa37e9377bd00073c8f5a17eddc872025c43797ae88cf2722b4fda56475e38c2740456
7
- data.tar.gz: 6c6a0ed5779ea0236d560aaa68cd5417e4c4a5b221095c85d605877989e2dc2ec08798020998a388958422ec522e5ab0e3a75bb4c8a9fa52ff5fd6943f873929
6
+ metadata.gz: ab6d3baacb13aae1f78a1736597547124ea4d1df0bdfe4d1a0b42627ae9f569deadc3a1b25062842923e3ecd0f8d88a7266015d6b716ce1ab0dc3503d8c30bc2
7
+ data.tar.gz: 47b1fce292ee835e3e69ee87f5f58d6897b805be0df3d0876c476145b703d971c05dac078d21ac201b3234c6fee3e88ab5644d0f39d2ac7a1025eb0195b5bbf4
data/plugin/vim-tags.vim CHANGED
@@ -1,19 +1,21 @@
1
1
  function! LoadRubyTags()
2
2
  let l:project_directory = finddir('.git/..', expand('%:p:h').';')
3
3
 
4
- if !empty(l:project_directory)
4
+ if !empty(l:project_directory) && filereadable(l:project_directory . '/Gemfile')
5
5
  let l:gem_tag_files_path = l:project_directory . '/.bundle/.gem_tag_files'
6
6
 
7
- if !filereadable(l:gem_tag_files_path)
7
+ if !filereadable(l:gem_tag_files_path) && !get(g:, 'vim_tags_skip_bundle', 0)
8
8
  let l:install_response = system('bundler plugin install vim-tags')
9
9
  let l:command_response = system('bundler vim-tags')
10
10
  endif
11
11
 
12
- let l:gems = json_decode(readfile(l:gem_tag_files_path))
13
- let l:ruby = json_decode(readfile(l:project_directory . '/.bundle/.ruby_tag_files'))
12
+ if filereadable(l:gem_tag_files_path)
13
+ let l:gems = json_decode(readfile(l:gem_tag_files_path))
14
+ let l:ruby = json_decode(readfile(l:project_directory . '/.bundle/.ruby_tag_files'))
14
15
 
15
- let &l:tags = &tags . ',' . l:gems['tags'] . ',' . l:ruby['tags']
16
- let &l:path = &path . ',' . l:gems['paths'] . ',' . l:ruby['paths']
16
+ let &l:tags = &tags . ',' . l:gems['tags'] . ',' . l:ruby['tags']
17
+ let &l:path = &path . ',' . l:gems['paths'] . ',' . l:ruby['paths']
18
+ endif
17
19
  endif
18
20
  endfunction
19
21
 
data/plugins.rb CHANGED
@@ -9,6 +9,7 @@ class VimTagsCommand < Bundler::Plugin::API
9
9
  def exec(*)
10
10
  write_gem_file
11
11
  write_ruby_file
12
+ write_gem_paths_file
12
13
  end
13
14
 
14
15
  private
@@ -21,6 +22,14 @@ class VimTagsCommand < Bundler::Plugin::API
21
22
  )
22
23
  end
23
24
 
25
+ def write_gem_paths_file
26
+ write_to_file(
27
+ File.join(Bundler.app_config_path, ".gem_paths"),
28
+ "\nWriting gem paths cache",
29
+ gem_specs.map { |spec| [spec.name, spec.full_gem_path] }.to_h.to_json
30
+ )
31
+ end
32
+
24
33
  def write_ruby_file
25
34
  write_to_file(
26
35
  File.join(Bundler.app_config_path, ".ruby_tag_files"),
@@ -54,6 +63,9 @@ class VimTagsCommand < Bundler::Plugin::API
54
63
  def write_to_file(file_path, description, payload)
55
64
  puts "#{description} to #{file_path}"
56
65
 
66
+ dirname = File.dirname(file_path)
67
+ FileUtils.mkdir_p(dirname) unless File.directory?(dirname)
68
+
57
69
  File.open(file_path, "w") do |f|
58
70
  f.truncate(0)
59
71
 
data/vim-tags.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "vim-tags"
5
- spec.version = "1.0.1"
5
+ spec.version = "1.0.3"
6
6
  spec.authors = ["Nick Pezza"]
7
7
  spec.email = ["pezza@hey.com"]
8
8
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vim-tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Pezza
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-06 00:00:00.000000000 Z
11
+ date: 2024-12-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debug
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
56
56
  - !ruby/object:Gem::Version
57
57
  version: '0'
58
58
  requirements: []
59
- rubygems_version: 3.2.22
59
+ rubygems_version: 3.5.13
60
60
  signing_key:
61
61
  specification_version: 4
62
62
  summary: Generate cache file of all paths to tags files of dependencies