lib/rubocop/directive_comment.rb in rubocop-1.46.0 vs lib/rubocop/directive_comment.rb in rubocop-1.47.0
- old
+ new
@@ -43,13 +43,13 @@
parsed_cop_names.uniq.sort == cop_names.uniq.sort
end
def range
match = comment.text.match(DIRECTIVE_COMMENT_REGEXP)
- begin_pos = comment.loc.expression.begin_pos
+ begin_pos = comment.source_range.begin_pos
Parser::Source::Range.new(
- comment.loc.expression.source_buffer, begin_pos + match.begin(0), begin_pos + match.end(0)
+ comment.source_range.source_buffer, begin_pos + match.begin(0), begin_pos + match.end(0)
)
end
# Returns match captures to directive comment pattern
def match_captures
@@ -106,10 +106,10 @@
splitted_cops_string.count
end
# Returns line number for directive
def line_number
- comment.loc.expression.line
+ comment.source_range.line
end
private
def splitted_cops_string