ripper-tags 0.9.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: 7d51d196b3dc72f1408638201f87a26a82ed43a61968f58d33b02d8fa07c7323
4
- data.tar.gz: 9c8d508fc88b23397d2ce35dfb01076351e20ff3f7dd8af1f7b1f06bd2d4d3cb
3
+ metadata.gz: 49763a523894bbbefd2b30cb86634ee63576c2109e9954a0f0b2e9b57f799585
4
+ data.tar.gz: 9ceda5050f002211a6c61f2dea6f65eb1e1978e2e689d73e2d6740045ae62c8d
5
5
  SHA512:
6
- metadata.gz: a0243919f85a7caf4ff08bf3a56ecc0be0c91f612ba08d6cec20fc3d6628ccd0f3fc0aa75288141eab99309fe868b63ac48f0de808f68f90395163ed0aca4df0
7
- data.tar.gz: 4dceff529b936be646799dafc349b6ba51fcb65428804079c99984f41d2eae86d08542eebd61b9f402e841de93b31eb016f1d38cee45cd1ce203802ddbf16399
6
+ metadata.gz: 37450f44bd80a4e79aeb3a025e703ef4c186ab1fcd92b44dfb064d9168808322a369ff90ee97b7289170252b4ff749fd4c8d0a7377d7a81e46c1f5e255e693a4
7
+ data.tar.gz: e29983e918577f41e485ee4576355db5d683d5c01ba80a99a9e9c85d653573b5d9bab8c65d91b891e0978ae9310319abfb5da9ef1e3902f188a319c45187718f
@@ -136,7 +136,7 @@ class Parser < Ripper
136
136
  end
137
137
 
138
138
  def on_string_add(*args)
139
- [args[1], lineno]
139
+ [args[1], lineno] unless args[0].is_a?(Array) && args[0].include?(:string_embexpr)
140
140
  end
141
141
 
142
142
  def on_string_embexpr(*)
@@ -193,17 +193,21 @@ class Parser < Ripper
193
193
  klass = name == access ? nil : 'self'
194
194
  procedure = :def_with_access
195
195
 
196
- if args[1][0].is_a?(String)
197
- procedure = :redefine_access
198
- 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]
199
206
  elsif args[1][1] == 'self'
200
- method_name = args[1][2]
207
+ [procedure, klass, args[1][2], access, line]
201
208
  else
202
- klass = nil
203
- method_name = args[1][1]
209
+ [procedure, nil, args[1][1], access, line]
204
210
  end
205
-
206
- [procedure, klass, method_name, access, line]
207
211
  when "module_function"
208
212
  access = "public"
209
213
  klass = "self"
@@ -223,11 +227,13 @@ class Parser < Ripper
223
227
  when /^[mc]?attr_(accessor|reader|writer)$/
224
228
  gen_reader = $1 != 'writer'
225
229
  gen_writer = $1 != 'reader'
226
- 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)
227
233
  gen << [:def, arg[0], line] if gen_reader
228
234
  gen << [:def, "#{arg[0]}=", line] if gen_writer
229
- gen
230
235
  end
236
+ gen
231
237
  when "has_many", "has_and_belongs_to_many"
232
238
  a = args[1][0]
233
239
  kind = name.to_sym
@@ -285,8 +291,9 @@ class Parser < Ripper
285
291
  end
286
292
 
287
293
  def on_method_add_block(method, body)
288
- return unless method
289
- if %w[class_eval module_eval].include?(method[2]) && body
294
+ if method.nil?
295
+ body ? body.last : nil
296
+ elsif (method[2] == "class_eval" || method[2] == "module_eval") && body
290
297
  [:class_eval, [
291
298
  method[1].is_a?(Array) ? method[1][0] : method[1],
292
299
  method[3]
@@ -296,6 +303,8 @@ class Parser < Ripper
296
303
  call = method.dup
297
304
  call[4] = body.last
298
305
  call
306
+ elsif :fcall == method[0] && body
307
+ body.last
299
308
  else
300
309
  super
301
310
  end
@@ -538,12 +547,17 @@ end
538
547
  end
539
548
 
540
549
  def on_call(*args)
550
+ process(args)
541
551
  end
542
- alias on_aref_field on_call
543
- alias on_field on_call
544
- alias on_fcall on_call
545
- alias on_args on_call
546
- alias on_assoc on_call
547
- alias on_! on_call
552
+
553
+ def ignore(*args)
554
+ end
555
+
556
+ alias on_aref_field ignore
557
+ alias on_field ignore
558
+ alias on_fcall ignore
559
+ alias on_args ignore
560
+ alias on_assoc ignore
561
+ alias on_! ignore
548
562
  end
549
563
  end
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.9.0" end
14
+ def self.version() "1.0.0" end
15
15
 
16
16
  FatalError = Class.new(RuntimeError)
17
17
 
@@ -97,7 +97,7 @@ 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
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.9.0
4
+ version: 1.0.0
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: 2020-03-18 00:00:00.000000000 Z
12
+ date: 2023-05-18 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.4.6
55
+ signing_key:
56
56
  specification_version: 4
57
57
  summary: ctags generator for ruby code
58
58
  test_files: []