ripper-tags 0.6.1 → 0.7.0
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/parser.rb +22 -2
- 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: d6621fd0e6fae8e6399e7f861ee28a3e0e5482c4
|
4
|
+
data.tar.gz: b24806fab7cddd6f245a121b5083b987c9f55e19
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ff50b98643eaf25b4cc7f7ce6244486366b6ac5662d3bff378b65c892fe1a8725780ad8dddd4c1e04ecc8309dd4871e56795c862029c472e3239566a189e16f
|
7
|
+
data.tar.gz: 55fd3694353f4491629fe173142363be315acb17c0695b232efc83351898168c1f7a3fa0254d0bd7451d115e7a11d0baf595f856d2a1eafaf9c4fdd44ca8d058
|
data/lib/ripper-tags.rb
CHANGED
data/lib/ripper-tags/parser.rb
CHANGED
@@ -73,6 +73,7 @@ class Parser < Ripper
|
|
73
73
|
"scope", "named_scope",
|
74
74
|
"public_class_method", "private_class_method", "protected_class_method",
|
75
75
|
"public", "protected", "private",
|
76
|
+
"module_function",
|
76
77
|
/^[mc]?attr_(accessor|reader|writer)$/
|
77
78
|
on_method_add_arg([:fcall, name], args[0])
|
78
79
|
when "delegate"
|
@@ -144,7 +145,7 @@ class Parser < Ripper
|
|
144
145
|
end
|
145
146
|
|
146
147
|
def on_vcall(name)
|
147
|
-
[name[0].to_sym] if name[0].to_s =~ /^(private|protected|public|private_class_method|public_class_method)$/
|
148
|
+
[name[0].to_sym] if name[0].to_s =~ /^(private|protected|public|private_class_method|public_class_method|module_function)$/
|
148
149
|
end
|
149
150
|
|
150
151
|
def on_call(lhs, op, rhs)
|
@@ -186,9 +187,23 @@ class Parser < Ripper
|
|
186
187
|
method_name = args[1][1]
|
187
188
|
end
|
188
189
|
|
190
|
+
[procedure, klass, method_name, access, line]
|
191
|
+
when "module_function"
|
192
|
+
access = "public"
|
193
|
+
klass = "self"
|
194
|
+
procedure = :def_with_access
|
195
|
+
|
196
|
+
if args[1][0].is_a?(String)
|
197
|
+
procedure = :redefine_access
|
198
|
+
method_name = args[1][0]
|
199
|
+
else
|
200
|
+
method_name = args[1][1]
|
201
|
+
end
|
202
|
+
|
189
203
|
[procedure, klass, method_name, access, line]
|
190
204
|
when "scope", "named_scope"
|
191
|
-
|
205
|
+
scope_name = args[1][0]
|
206
|
+
[:rails_def, :scope, scope_name, line] if scope_name
|
192
207
|
when /^[mc]?attr_(accessor|reader|writer)$/
|
193
208
|
gen_reader = $1 != 'writer'
|
194
209
|
gen_writer = $1 != 'reader'
|
@@ -398,6 +413,11 @@ end
|
|
398
413
|
def on_private_class_method() @current_access = 'private' end
|
399
414
|
def on_public_class_method() @current_access = 'public' end
|
400
415
|
|
416
|
+
def on_module_function()
|
417
|
+
@is_singleton = true
|
418
|
+
@current_access = 'public'
|
419
|
+
end
|
420
|
+
|
401
421
|
# Ripper trips up on keyword arguments in pre-2.1 Ruby and supplies extra
|
402
422
|
# arguments that we just ignore here
|
403
423
|
def on_assign(name, rhs, line, *junk)
|
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.
|
4
|
+
version: 0.7.0
|
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-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: fast, accurate ctags generator for ruby source code using Ripper
|
14
14
|
email:
|