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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c01afeab62bc05b48461054c69302ea2c6df300
4
- data.tar.gz: 15381e892cf46a2c712059e9ec1a5cc1275fb17a
3
+ metadata.gz: 54fc8600d2da0bacfa7f9f1e04e85547c94646e6
4
+ data.tar.gz: f451435d8e4441258ebe6c7faf5fc56ad6962ff8
5
5
  SHA512:
6
- metadata.gz: 855d584aca0e552f9bd6cefd849255dad0a7119beeccd38465bfc62310f0c0ddad586721e3e4adf1ad27911764d50d6dc96103210e00837163aa5203693173f1
7
- data.tar.gz: 47f730f13d9ff65c9ceeda5361b153f6117459546d2a5ddd4954cc06ba8d4fcb046f4ac4d3743abb0e83268ca19a14e828f96129e9dd86202dc51990ba1de2d6
6
+ metadata.gz: b1d73c98cdc6100d4417c333ae4f28e64a4c350f459e5d7cedb72590d2ca8bcda48b08f6b2d86053de818cd5712e930b788c5d210e803116ce414f640f5d781a
7
+ data.tar.gz: ad28b8938a2823ec8e6ff82c3ef076ef885d90b510815ec04fd9d9c36ef61add937f41f01be7fbc6f346cdf6869b3b7c61b31c9b9f0ad060453b8fa5f4c4da9b
@@ -9,7 +9,7 @@ require 'ripper-tags/vim_formatter'
9
9
  require 'ripper-tags/json_formatter'
10
10
 
11
11
  module RipperTags
12
- def self.version() "0.6.0" end
12
+ def self.version() "0.6.1" end
13
13
 
14
14
  FatalError = Class.new(RuntimeError)
15
15
 
@@ -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
- Dir.entries(file).each do |name|
60
- if name != DIR_CURRENT && name != DIR_PARENT
61
- subfile = File.join(file, name)
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
@@ -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
- [:def, name, lineno] if lineno
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.0
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-05-25 00:00:00.000000000 Z
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: