ripper-tags 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ripper-tags.rb +1 -1
- data/lib/ripper-tags/data_reader.rb +20 -6
- data/lib/ripper-tags/parser.rb +7 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54fc8600d2da0bacfa7f9f1e04e85547c94646e6
|
4
|
+
data.tar.gz: f451435d8e4441258ebe6c7faf5fc56ad6962ff8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1d73c98cdc6100d4417c333ae4f28e64a4c350f459e5d7cedb72590d2ca8bcda48b08f6b2d86053de818cd5712e930b788c5d210e803116ce414f640f5d781a
|
7
|
+
data.tar.gz: ad28b8938a2823ec8e6ff82c3ef076ef885d90b510815ec04fd9d9c36ef61add937f41f01be7fbc6f346cdf6869b3b7c61b31c9b9f0ad060453b8fa5f4c4da9b
|
data/lib/ripper-tags.rb
CHANGED
@@ -56,12 +56,9 @@ module RipperTags
|
|
56
56
|
def resolve_file(file, depth = 0, &block)
|
57
57
|
if File.directory?(file)
|
58
58
|
if options.recursive && !exclude_file?(file)
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
subfile = clean_path(subfile) if depth == 0
|
63
|
-
resolve_file(subfile, depth + 1, &block)
|
64
|
-
end
|
59
|
+
each_in_directory(file) do |subfile|
|
60
|
+
subfile = clean_path(subfile) if depth == 0
|
61
|
+
resolve_file(subfile, depth + 1, &block)
|
65
62
|
end
|
66
63
|
end
|
67
64
|
elsif depth > 0 || File.exist?(file)
|
@@ -75,6 +72,23 @@ module RipperTags
|
|
75
72
|
end
|
76
73
|
end
|
77
74
|
|
75
|
+
def each_in_directory(directory)
|
76
|
+
begin
|
77
|
+
entries = Dir.entries(directory)
|
78
|
+
rescue Errno::EACCES
|
79
|
+
$stderr.puts "%s: skipping unreadable directory `%s'" % [
|
80
|
+
File.basename($0),
|
81
|
+
directory
|
82
|
+
]
|
83
|
+
else
|
84
|
+
entries.each do |name|
|
85
|
+
if name != DIR_CURRENT && name != DIR_PARENT
|
86
|
+
yield File.join(directory, name)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
78
92
|
def clean_path(file)
|
79
93
|
Pathname.new(file).cleanpath.to_s
|
80
94
|
end
|
data/lib/ripper-tags/parser.rb
CHANGED
@@ -192,7 +192,7 @@ class Parser < Ripper
|
|
192
192
|
when /^[mc]?attr_(accessor|reader|writer)$/
|
193
193
|
gen_reader = $1 != 'writer'
|
194
194
|
gen_writer = $1 != 'reader'
|
195
|
-
args[1..-1].inject([]) do |gen, arg|
|
195
|
+
args[1..-1].compact.inject([]) do |gen, arg|
|
196
196
|
gen << [:def, arg[0], line] if gen_reader
|
197
197
|
gen << [:def, "#{arg[0]}=", line] if gen_writer
|
198
198
|
gen
|
@@ -302,8 +302,12 @@ class Parser < Ripper
|
|
302
302
|
|
303
303
|
def on_def_delegators(*args)
|
304
304
|
_target, *names = args
|
305
|
-
names.map do |name, lineno|
|
306
|
-
|
305
|
+
names.map do |name, lineno, *args|
|
306
|
+
if lineno.is_a?(Numeric)
|
307
|
+
[:def, name, lineno] if lineno
|
308
|
+
elsif name.is_a?(Symbol)
|
309
|
+
[name, lineno, *args]
|
310
|
+
end
|
307
311
|
end
|
308
312
|
end
|
309
313
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ripper-tags
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aman Gupta
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: fast, accurate ctags generator for ruby source code using Ripper
|
14
14
|
email:
|