ripper-tags 0.8.0 → 0.9.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
  SHA256:
3
- metadata.gz: af186884f47d60d67bc23e0bc85ceee5109a89c6bd60cb92024003803e11f87f
4
- data.tar.gz: 6dbdd9ad152c076acb592533704df108ba38c582f75287e396fc57e439a2c525
3
+ metadata.gz: 19f8795f33f82e90834ecd447a2e2b2e131fee20d84bce8eefafd3dab2e895cb
4
+ data.tar.gz: 7b82c2d73bab29c600db4c8d4ee181ee6fb4885b38f015ee1a8aeddeec5e896e
5
5
  SHA512:
6
- metadata.gz: 44316dc2bf8a70f9b00a9da621533f41b63b83ad91da0cfa768db558c920d222cdf7656e4454099a4e29ca4cb0ff82086f613eb491160f697d52d1174d4f142d
7
- data.tar.gz: e209fcd4873a3a98bf69d03d0205506ad9ed4615e0fa4017476fe54e3b66df7aa2548b41dc7bc63b83e3ce2b2863f36150c6f97985a739db0a767c6d82c6372f
6
+ metadata.gz: 7433ae47b7c0d9cd2f1621ead9ad63d5af2b82350428abe5c52b614b2bf2f77c698aaa2edd049655db940b6fa1c5703dfefd9ac563c1a8dde1ac00b7825a0d01
7
+ data.tar.gz: 344aa2dd31ac888b514b66dfff279c2dcaa8a163339e1899074eeafe5a4937caa5a59f82e5880cce8816a522d3fd02abae2a54ad5903fb3af9f5ec4ad372d89e
@@ -38,6 +38,8 @@ module RipperTags
38
38
  end
39
39
  end
40
40
  section_map
41
+ rescue Errno::ENOENT
42
+ {}
41
43
  end
42
44
  end
43
45
  end
@@ -88,6 +88,14 @@ class Parser < Ripper
88
88
  on_def_delegator(*args[0][1..-1])
89
89
  when "def_delegators", "def_instance_delegators"
90
90
  on_def_delegators(*args[0][1..-1])
91
+ else
92
+ if args[0].respond_to?(:[])
93
+ # Handle decorators: if what follows is a method def, pass it on
94
+ inner = args[0][1]
95
+ if inner.respond_to?(:[]) && inner[0] == :def
96
+ on_def(inner[1..-1], nil, nil)
97
+ end
98
+ end
91
99
  end
92
100
  end
93
101
  def on_bodystmt(*args)
@@ -185,17 +193,21 @@ class Parser < Ripper
185
193
  klass = name == access ? nil : 'self'
186
194
  procedure = :def_with_access
187
195
 
188
- if args[1][0].is_a?(String)
189
- procedure = :redefine_access
190
- method_name = args[1][0]
196
+ if args[1][0].is_a?(Array)
197
+ args[1].inject([]) do |gen, def_args|
198
+ if def_args[1].is_a?(String)
199
+ gen << [procedure, klass, def_args[1], access, line]
200
+ else
201
+ gen
202
+ end
203
+ end
204
+ elsif args[1][0].is_a?(String)
205
+ [:redefine_access, klass, args[1][0], access, line]
191
206
  elsif args[1][1] == 'self'
192
- method_name = args[1][2]
207
+ [procedure, klass, args[1][2], access, line]
193
208
  else
194
- klass = nil
195
- method_name = args[1][1]
209
+ [procedure, nil, args[1][1], access, line]
196
210
  end
197
-
198
- [procedure, klass, method_name, access, line]
199
211
  when "module_function"
200
212
  access = "public"
201
213
  klass = "self"
@@ -215,11 +227,13 @@ class Parser < Ripper
215
227
  when /^[mc]?attr_(accessor|reader|writer)$/
216
228
  gen_reader = $1 != 'writer'
217
229
  gen_writer = $1 != 'reader'
218
- args[1..-1].compact.inject([]) do |gen, arg|
230
+ gen = []
231
+ args[1..-1].compact.each do |arg|
232
+ next unless arg[0].is_a?(String)
219
233
  gen << [:def, arg[0], line] if gen_reader
220
234
  gen << [:def, "#{arg[0]}=", line] if gen_writer
221
- gen
222
235
  end
236
+ gen
223
237
  when "has_many", "has_and_belongs_to_many"
224
238
  a = args[1][0]
225
239
  kind = name.to_sym
@@ -9,7 +9,11 @@ module RipperTags
9
9
  end
10
10
 
11
11
  def with_output
12
- orig_lines = File.readlines(@formatter.options.tag_file_name)
12
+ orig_lines = begin
13
+ File.readlines(@formatter.options.tag_file_name)
14
+ rescue Errno::ENOENT
15
+ []
16
+ end
13
17
  @seen_filenames = Set.new
14
18
 
15
19
  @formatter.with_output do |out|
data/lib/ripper-tags.rb CHANGED
@@ -11,7 +11,7 @@ require 'ripper-tags/vim_append_formatter'
11
11
  require 'ripper-tags/json_formatter'
12
12
 
13
13
  module RipperTags
14
- def self.version() "0.8.0" end
14
+ def self.version() "0.9.1" end
15
15
 
16
16
  FatalError = Class.new(RuntimeError)
17
17
 
@@ -97,12 +97,15 @@ module RipperTags
97
97
  opts.on("--tag-relative[=yes|no|always|never]", "Make file paths relative to the directory of the tag file") do |value|
98
98
  options.tag_relative = value || true
99
99
  end
100
- opts.on("-L", "--input-file=FILE", "File to read paths to process trom (use `-` for stdin)") do |file|
100
+ opts.on("-L", "--input-file=FILE", "File to read paths to process from (use `-` for stdin)") do |file|
101
101
  options.input_file = file
102
102
  end
103
103
  opts.on("-R", "--recursive", "Descend recursively into subdirectories") do
104
104
  options.recursive = true
105
105
  end
106
+ opts.on("--recurse=[yes|no]", "Alias for --recursive") do |value|
107
+ options.recursive = value != 'no'
108
+ end
106
109
  opts.on("--exclude PATTERN", "Exclude a file, directory or pattern") do |pattern|
107
110
  if pattern.empty?
108
111
  options.exclude.clear
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ripper-tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mislav Marohnić
8
8
  - Aman Gupta
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-11-26 00:00:00.000000000 Z
12
+ date: 2022-05-24 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: fast, accurate ctags generator for ruby source code using Ripper
15
15
  email:
@@ -36,7 +36,7 @@ homepage: https://github.com/tmm1/ripper-tags
36
36
  licenses:
37
37
  - MIT
38
38
  metadata: {}
39
- post_install_message:
39
+ post_install_message:
40
40
  rdoc_options: []
41
41
  require_paths:
42
42
  - lib
@@ -51,8 +51,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
51
51
  - !ruby/object:Gem::Version
52
52
  version: '0'
53
53
  requirements: []
54
- rubygems_version: 3.0.3
55
- signing_key:
54
+ rubygems_version: 3.3.3
55
+ signing_key:
56
56
  specification_version: 4
57
57
  summary: ctags generator for ruby code
58
58
  test_files: []