vim-tags 0.3.0 → 1.0.0

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: 4bc33aff0be21dfcf28ac60662708d2c0a7605bd3afe07d111006058ea3414f2
4
- data.tar.gz: 8402bf3eaa4791579010a70cb5ced680114a0b32d3f36535fbfde52189eeec10
3
+ metadata.gz: 48c4e716807d49f46839e3cb7a64e9ed661819876e9f0a214c7fce30a6930937
4
+ data.tar.gz: 5caaa8ef16c3a112dca3ec7c725128780135d5847c09876f3a542489b26dc90c
5
5
  SHA512:
6
- metadata.gz: e4421652fb5563fe9ea28742d5db907477379f52be922b0fb040a7b128b1e808adbeb657743ca6cc0102b9c11b73e96ded702c7dcb1a90b7d4dade8f54d7e68d
7
- data.tar.gz: f04f668af0c693c8c6d4e4aebd0acf88e65c6921d1349d98a871689cb0476ca96f090cf7feaa511b10592121423e9f234122975ae935310164a6a9ceaa109c08
6
+ metadata.gz: b63343e18ea0abed7349342124da4c495f23e9a9cc06d8f7d79fa39504d2698ed861ca88ea48204f83e4334c75daea70a1c909324e8ed51934774796e47fd952
7
+ data.tar.gz: 225161e497e35f27c7e951f8a3e4b8b6445ef83e1e91808f3858a67eebd40bc1562445a1dff5a16c510208e5b8c36f7bfacbbb75008ca32a5bfa298d874a34e8
data/.rubocop.yml CHANGED
@@ -1,7 +1,6 @@
1
1
  require:
2
2
  - rubocop-minitest
3
3
  - rubocop-performance
4
- - rubocop-rails
5
4
  AllCops:
6
5
  NewCops: enable
7
6
  Exclude:
@@ -13,7 +12,7 @@ AllCops:
13
12
  - test/dummy/db/schema.rb
14
13
  - gemfiles/**/*
15
14
  - bin/**/*
16
- TargetRubyVersion: 2.7
15
+ TargetRubyVersion: 2.5
17
16
 
18
17
  # Department Bundler
19
18
  Bundler/DuplicatedGem:
@@ -1697,39 +1696,3 @@ Performance/Squeeze:
1697
1696
  Enabled: true
1698
1697
  Performance/StringInclude:
1699
1698
  Enabled: true
1700
- Rails/ActiveRecordCallbacksOrder:
1701
- Enabled: true
1702
- Rails/FindById:
1703
- Enabled: true
1704
- Rails/Inquiry:
1705
- Enabled: false
1706
- Rails/MailerName:
1707
- Enabled: true
1708
- Rails/MatchRoute:
1709
- Enabled: true
1710
- Rails/NegateInclude:
1711
- Enabled: true
1712
- Rails/Pluck:
1713
- Enabled: true
1714
- Rails/PluckInWhere:
1715
- Enabled: true
1716
- Rails/RenderInline:
1717
- Enabled: true
1718
- Rails/RenderPlainText:
1719
- Enabled: true
1720
- Rails/ShortI18n:
1721
- Enabled: true
1722
- Rails/WhereExists:
1723
- Enabled: true
1724
- Rails/SkipsModelValidations:
1725
- Enabled: false
1726
- Rails/UniqueValidationWithoutIndex:
1727
- Enabled: false
1728
- Rails/InverseOf:
1729
- Enabled: false
1730
- Rails/LexicallyScopedActionFilter:
1731
- Enabled: false
1732
- Minitest/MultipleAssertions:
1733
- Enabled: false
1734
- Rails/OutputSafety:
1735
- Enabled: false
data/plugin/vim-tags.vim CHANGED
@@ -1,24 +1,25 @@
1
1
  function! LoadRubyTags()
2
- let l:load_ruby_tags_dir = finddir('.git/..', expand('%:p:h').';')
2
+ let l:project_directory = finddir('.git/..', expand('%:p:h').';')
3
3
 
4
- if !empty(l:load_ruby_tags_dir)
5
- let l:load_ruby_tags_gem_tags_path = l:load_ruby_tags_dir . '/.bundle/.gem_tag_files'
4
+ if !empty(l:project_directory)
5
+ let l:gem_tag_files_path = l:project_directory . '/.bundle/.gem_tag_files'
6
6
 
7
- if !filereadable(l:load_ruby_tags_gem_tags_path)
7
+ if !filereadable(l:gem_tag_files_path)
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 g:gem_files = json_decode(readfile(l:load_ruby_tags_gem_tags_path))
13
- let l:gem_comma_tags = join(values(g:gem_files), "/tags,") . '/tags'
14
- let l:ruby_comma_tags = join(readfile(l:load_ruby_tags_dir . '/.bundle/.ruby_tag_files'), "/tags,") . '/tags'
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'))
15
14
 
16
- setlocal includeexpr=get(g:gem_files,v:fname,v:fname)
17
- setlocal suffixesadd=/
18
- cnoremap <buffer><expr> <Plug><cfile> get(g:gem_files,expand("<cfile>"),"\022\006")
19
-
20
- let &l:tags = &tags . ',' . l:gem_comma_tags . ',' . l:ruby_comma_tags
15
+ let &l:tags = &tags . ',' . l:gems['tags'] . ',' . l:ruby['tags']
16
+ let &l:path = &path . ',' . l:gems['paths'] . ',' . l:ruby['paths']
21
17
  endif
22
18
  endfunction
23
19
 
24
- autocmd FileType ruby :call LoadRubyTags()
20
+ augroup rubypath
21
+ autocmd!
22
+ autocmd FileType ruby setlocal suffixesadd+=.rb
23
+
24
+ autocmd FileType ruby :call LoadRubyTags()
25
+ augroup END
data/plugins.rb CHANGED
@@ -25,12 +25,12 @@ class VimTagsCommand < Bundler::Plugin::API
25
25
  write_to_file(
26
26
  File.join(Bundler.app_config_path, ".ruby_tag_files"),
27
27
  "Writing ruby tag cache to",
28
- { tags: ruby_tags, paths: $: }
28
+ { tags: ruby_tags, paths: $:.join(",") }
29
29
  )
30
30
  end
31
31
 
32
32
  def ruby_tags
33
- $:.select { |path| File.exist?(File.join(path, "tags")) }
33
+ $:.select { |path| File.exist?(File.join(path, "tags")) }.join(",")
34
34
  end
35
35
 
36
36
  def gem_tags
@@ -40,11 +40,11 @@ class VimTagsCommand < Bundler::Plugin::API
40
40
  next unless File.exist?(tag_path)
41
41
 
42
42
  tag_path
43
- end
43
+ end.sort.join(",")
44
44
  end
45
45
 
46
46
  def gem_paths
47
- gem_specs.to_h { |spec| [spec.name, spec.full_gem_path] }
47
+ gem_specs.map { |spec| File.join(spec.full_gem_path, "lib") }.sort.join(",")
48
48
  end
49
49
 
50
50
  def gem_specs
@@ -52,7 +52,7 @@ class VimTagsCommand < Bundler::Plugin::API
52
52
  end
53
53
 
54
54
  def write_to_file(file_path, description, payload)
55
- puts "#{description} to #{cache_file}"
55
+ puts "#{description} to #{file_path}"
56
56
 
57
57
  File.open(file_path, "w") do |f|
58
58
  f.truncate(0)
data/vim-tags.gemspec CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "vim-tags"
5
- spec.version = "0.3.0"
5
+ spec.version = "1.0.0"
6
6
  spec.authors = ["Nick Pezza"]
7
7
  spec.email = ["pezza@hey.com"]
8
8
 
9
9
  spec.summary =
10
10
  "Generate cache file of all paths to tags files of dependencies"
11
11
  spec.license = "MIT"
12
- spec.required_ruby_version = ">= 2.7.0"
12
+ spec.required_ruby_version = ">= 2.5.0"
13
13
 
14
14
  spec.files = Dir.chdir(File.expand_path(__dir__)) do
15
15
  `git ls-files -z`.split("\x0").reject do |f|
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vim-tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Pezza
@@ -49,7 +49,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
49
49
  requirements:
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 2.7.0
52
+ version: 2.5.0
53
53
  required_rubygems_version: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - ">="