Class: Evilution::DisableComment Private

Inherits:
Object
  • Object
show all
Defined in:
lib/evilution/disable_comment.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Constant Summary collapse

DISABLE_MARKER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

/\A#\s*evilution:disable\s*\z/
ENABLE_MARKER =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

/\A#\s*evilution:enable\s*\z/

Instance Method Summary collapse

Instance Method Details

#call(source) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



9
10
11
12
13
14
15
16
17
18
# File 'lib/evilution/disable_comment.rb', line 9

def call(source)
  return [] if source.empty?

  result = Prism.parse(source)
  return [] if result.failure?

  method_ranges = collect_def_ranges(result.value)
  comments = classify_comments(result, source)
  scan_comments(comments, method_ranges, source.lines.length)
end