From 8f5a88ace7a3015fa6b316b8aaf9af9c9e969c2e Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Sat, 1 Oct 2022 16:09:33 -0700 Subject: [PATCH] rubocop --- actionview/lib/action_view/template/handlers/erb.rb | 10 +++++----- .../core_ext/thread/backtrace/location.rb | 2 ++ 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/actionview/lib/action_view/template/handlers/erb.rb b/actionview/lib/action_view/template/handlers/erb.rb index ca2e1333d63ae..2042dd76cad99 100644 --- a/actionview/lib/action_view/template/handlers/erb.rb +++ b/actionview/lib/action_view/template/handlers/erb.rb @@ -117,7 +117,7 @@ def tokenize(source) tokens << [:TEXT, source.string[pos, len]] if len > 0 tokens << [:OPEN, source.matched] if source.scan(/(.*?)(?=#{finish_re}|$)/m) - tokens << [:CODE, source.matched] + tokens << [:CODE, source.matched] tokens << [:CLOSE, source.scan(finish_re)] unless source.eos? else raise NotImplemented @@ -140,9 +140,9 @@ def find_offset(compiled, source_tokens, error_column) while tok = source_tokens.shift case tok - in [:TEXT, str] + in [:TEXT, str] raise unless compiled.scan(str) - in [:CODE, str] + in [:CODE, str] raise "We went too far" if compiled.pos > error_column if compiled.pos + str.bytesize >= error_column @@ -151,13 +151,13 @@ def find_offset(compiled, source_tokens, error_column) else raise unless compiled.scan(str) end - in [:OPEN, str] + in [:OPEN, str] next_tok = source_tokens.first.last loop do break if compiled.match?(next_tok) compiled.getch end - in [:CLOSE, str] + in [:CLOSE, str] next_tok = source_tokens.first.last loop do break if compiled.match?(next_tok) diff --git a/activesupport/lib/active_support/core_ext/thread/backtrace/location.rb b/activesupport/lib/active_support/core_ext/thread/backtrace/location.rb index 51e59c4c98643..c7ecbc1e9855e 100644 --- a/activesupport/lib/active_support/core_ext/thread/backtrace/location.rb +++ b/activesupport/lib/active_support/core_ext/thread/backtrace/location.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Thread::Backtrace::Location if defined?(ErrorHighlight) && Gem::Version.new(ErrorHighlight::VERSION) >= Gem::Version.new("0.4.0") def spot(ex)