gem-ctags 1.0.8 → 1.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/gem-ctags.gemspec +1 -1
- data/lib/rubygems/commands/ctags_command.rb +31 -25
- data/lib/rubygems_plugin.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: df1621af79986d7c9a035e1fe95e3648c9b951a357907c15272e65cf411d2e81
|
4
|
+
data.tar.gz: 98227b8b61bf9c0ba8f2aeab90f9843ff4b6a27813f7dcb2aa288bd9f6045dd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f401b6ceb5c919554e2de6d7b54e47bbac53796ee435418365ca26cc9910c5130e0f63e063ba8b73fceb770172ed6a9951c59f67364825103d12847e846e9dcc
|
7
|
+
data.tar.gz: fec15f783bc72380b56e75aebeed0d0f8627b54194e3f463bd50901ff14b6d5ac225b36cfdc01b30320bc315b3d41298ceb155fe72fe34ed0efe1afbbad5f6e5
|
data/gem-ctags.gemspec
CHANGED
@@ -12,40 +12,46 @@ class Gem::Commands::CtagsCommand < Gem::Command
|
|
12
12
|
else
|
13
13
|
Gem.source_index.gems.values
|
14
14
|
end.each do |spec|
|
15
|
-
self.class.index(spec)
|
16
|
-
say message
|
17
|
-
end
|
15
|
+
self.class.index(spec, ui)
|
18
16
|
end
|
19
17
|
end
|
20
18
|
|
21
|
-
def self.
|
22
|
-
|
19
|
+
def self.invoke(languages, tag_file, *paths)
|
20
|
+
system(
|
21
|
+
'ctags',
|
22
|
+
"--languages=#{languages}",
|
23
|
+
'-R',
|
24
|
+
'--tag-relative=yes',
|
25
|
+
'-f',
|
26
|
+
tag_file.to_s,
|
27
|
+
*paths.map { |p| Pathname.new(p).relative_path_from(Pathname.pwd).to_s }
|
28
|
+
)
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.can_write?(path)
|
32
|
+
path.dirname.directory? && !path.directory? &&
|
33
|
+
!(path.file? && path.read(1) == '!')
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.index(spec, ui = nil)
|
37
|
+
gem_path = Pathname.new(spec.full_gem_path)
|
23
38
|
|
24
|
-
tag_file =
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
Pathname.new(File.join(spec.full_gem_path, p)).
|
30
|
-
relative_path_from(Pathname.pwd).to_s
|
31
|
-
}.
|
32
|
-
select { |p| File.directory?(p) }
|
33
|
-
paths = [spec.full_gem_path] if paths.empty?
|
34
|
-
system(
|
35
|
-
'ctags', '--languages=Ruby', '-R', '--tag-relative=yes', '-f', tag_file,
|
36
|
-
*paths
|
37
|
-
)
|
39
|
+
tag_file = gem_path.join('tags')
|
40
|
+
paths = spec.require_paths.map { |p| gem_path.join(p) }
|
41
|
+
if paths.any? && can_write?(tag_file)
|
42
|
+
ui.say "Generating ctags for #{spec.full_name}" if ui
|
43
|
+
invoke('Ruby', tag_file, *paths)
|
38
44
|
end
|
39
45
|
|
40
|
-
target =
|
41
|
-
if
|
42
|
-
|
43
|
-
|
46
|
+
target = gem_path.join('lib/bundler/cli.rb')
|
47
|
+
if target.writable? && !target.read.include?('load_plugins')
|
48
|
+
ui.say "Injecting gem-ctags into #{spec.full_name}" if ui
|
49
|
+
target.open('a') do |f|
|
44
50
|
f.write "\nGem.load_plugins rescue nil\n"
|
45
51
|
end
|
46
52
|
end
|
47
53
|
rescue => e
|
48
|
-
raise unless
|
49
|
-
|
54
|
+
raise unless ui
|
55
|
+
ui.say "Failed processing ctags for #{spec.full_name}:\n (#{e.class}) #{e}"
|
50
56
|
end
|
51
57
|
end
|
data/lib/rubygems_plugin.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gem-ctags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Pope
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-05-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -59,7 +59,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
59
59
|
version: '0'
|
60
60
|
requirements: []
|
61
61
|
rubyforge_project:
|
62
|
-
rubygems_version: 2.
|
62
|
+
rubygems_version: 2.7.3
|
63
63
|
signing_key:
|
64
64
|
specification_version: 4
|
65
65
|
summary: Automatic ctags generation on gem install
|