Skip to content

Commit 9006822

Browse files
committed
Group methods under same Ruby constraints
1 parent 9a14fb1 commit 9006822

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

activesupport/lib/active_support/backtrace_cleaner.rb

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,20 +92,7 @@ def first_clean_frame(kind = :silent)
9292
return frame if frame
9393
end
9494
end
95-
else
96-
# Returns the first clean frame of the caller's backtrace, or +nil+.
97-
#
98-
# Frames are strings.
99-
def first_clean_frame(kind = :silent)
100-
Thread.each_caller_location(2) do |location|
101-
frame = clean_frame(location, kind)
102-
return frame if frame
103-
end
104-
end
105-
end
10695

107-
# Thread.each_caller_location does not accept a start in Ruby < 3.4.
108-
if Thread.method(:each_caller_location).arity == 0
10996
# Returns the first clean location of the caller's call stack, or +nil+.
11097
#
11198
# Locations are Thread::Backtrace::Location objects. Since they are
@@ -124,6 +111,16 @@ def first_clean_location(kind = :silent)
124111
end
125112
end
126113
else
114+
# Returns the first clean frame of the caller's backtrace, or +nil+.
115+
#
116+
# Frames are strings.
117+
def first_clean_frame(kind = :silent)
118+
Thread.each_caller_location(2) do |location|
119+
frame = clean_frame(location, kind)
120+
return frame if frame
121+
end
122+
end
123+
127124
# Returns the first clean location of the caller's call stack, or +nil+.
128125
#
129126
# Locations are Thread::Backtrace::Location objects. Since they are

0 commit comments

Comments
 (0)