class method self.ranges

Ruby on Rails 8.1.3.1

Since v7.2.3.2

Available in: v7.2.3.2 v8.0.5.1 v8.1.3.1 edge

Signature

self.ranges(filepath)

No documentation comment.

Parameters

filepath req
Source
# File railties/lib/rails/test_unit/test_parser.rb, line 27
          def self.ranges(filepath)
            queue = [Prism.parse_file(filepath).value]
            begins_to_ends = {}
            while (node = queue.shift)
              case node.type
              when :def_node
                begins_to_ends[node.location.start_line] = node.location.end_line
              when :call_node
                begins_to_ends[node.location.start_line] = node.location.end_line
              end

              queue.concat(node.compact_child_nodes)
            end
            begins_to_ends
          end

Defined in railties/lib/rails/test_unit/test_parser.rb line 27 · View on GitHub · Improve this page · Find usages on GitHub

Defined in Rails::TestUnit::TestParser

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close