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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 54fc8600d2da0bacfa7f9f1e04e85547c94646e6
4
- data.tar.gz: f451435d8e4441258ebe6c7faf5fc56ad6962ff8
3
+ metadata.gz: d6621fd0e6fae8e6399e7f861ee28a3e0e5482c4
4
+ data.tar.gz: b24806fab7cddd6f245a121b5083b987c9f55e19
5
5
  SHA512:
6
- metadata.gz: b1d73c98cdc6100d4417c333ae4f28e64a4c350f459e5d7cedb72590d2ca8bcda48b08f6b2d86053de818cd5712e930b788c5d210e803116ce414f640f5d781a
7
- data.tar.gz: ad28b8938a2823ec8e6ff82c3ef076ef885d90b510815ec04fd9d9c36ef61add937f41f01be7fbc6f346cdf6869b3b7c61b31c9b9f0ad060453b8fa5f4c4da9b
6
+ metadata.gz: 8ff50b98643eaf25b4cc7f7ce6244486366b6ac5662d3bff378b65c892fe1a8725780ad8dddd4c1e04ecc8309dd4871e56795c862029c472e3239566a189e16f
7
+ data.tar.gz: 55fd3694353f4491629fe173142363be315acb17c0695b232efc83351898168c1f7a3fa0254d0bd7451d115e7a11d0baf595f856d2a1eafaf9c4fdd44ca8d058
@@ -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.1" end
12
+ def self.version() "0.7.0" end
13
13
 
14
14
  FatalError = Class.new(RuntimeError)
15
15
 
@@ -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
- [:rails_def, :scope, args[1][0], line]
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.6.1
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-08-22 00:00:00.000000000 Z
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: