lib/rubocop/cop/style/copyright.rb in rubocop-0.42.0 vs lib/rubocop/cop/style/copyright.rb in rubocop-0.43.0
- old
+ new
@@ -74,14 +74,10 @@
regex = Regexp.new(notice)
raise Warning, "AutocorrectNotice '#{autocorrect_notice}' must " \
"match Notice /#{notice}/" unless autocorrect_notice =~ regex
lambda do |corrector|
- range = if token.nil?
- Parser::Source::Range.new('', 0, 0)
- else
- token.pos
- end
+ range = token.nil? ? range_between(0, 0) : token.pos
corrector.insert_before(range, "#{autocorrect_notice}\n")
end
end
end
end