Skip to content

Commit b6769aa

Browse files
committed
Release 3.3.1 that drops Rails 4.2 compatibility
1 parent ef20875 commit b6769aa

File tree

5 files changed

+25
-21
lines changed

5 files changed

+25
-21
lines changed

CHANGELOG.markdown

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## master (unreleased)
44

5+
## 3.3.1
6+
7+
Drop support for Rails `4.2.0`.
8+
59
## 3.3.0
610

711
* [203](https://github.com/rails/web-console/pull/203) Map bindings to traces based on the trace __FILE__ and __LINE__ ([@gsamokovarov])

lib/web_console/extensions.rb

+1-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,7 @@ module ActionDispatch
2424
class DebugExceptions
2525
def render_exception_with_web_console(request, exception)
2626
render_exception_without_web_console(request, exception).tap do
27-
# Retain superficial Rails 4.2 compatibility.
28-
env = Hash === request ? request : request.env
29-
30-
backtrace_cleaner = env['action_dispatch.backtrace_cleaner']
27+
backtrace_cleaner = request.get_header('action_dispatch.backtrace_cleaner')
3128
error = ExceptionWrapper.new(backtrace_cleaner, exception).exception
3229

3330
# Get the original exception if ExceptionWrapper decides to follow it.

lib/web_console/integration.rb

+17-15
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
1-
module WebConsole
2-
# Returns the Ruby bindings of Kernel#callers locations.
3-
#
4-
# The list of bindings here doesn't map 1 to 1 with Kernel#callers, as we
5-
# can't build Ruby bindings for C functions or the equivalent native
6-
# implementations in JRuby and Rubinius.
7-
#
8-
# This method needs to be overridden by every integration.
9-
def self.caller_bindings
10-
raise NotImplementedError
11-
end
12-
end
13-
141
class Exception
152
# Returns an array of the exception backtrace locations bindings.
163
#
174
# The list won't map to the traces in #backtrace 1 to 1, because we can't
185
# build bindings for every trace (C functions, for example).
196
#
20-
# Every integration should the instance variable.
7+
# Every integration should set the instance variable.
218
def bindings
22-
(defined?(@bindings) && @bindings) || []
9+
defined?(@bindings) ? @bindings : []
2310
end
2411
end
2512

@@ -28,4 +15,19 @@ def bindings
2815
require 'web_console/integration/rubinius'
2916
when 'ruby'
3017
require 'web_console/integration/cruby'
18+
else
19+
# Prevent a `method redefined; discarding old caller_bindings` warning.
20+
21+
module WebConsole
22+
# Returns the Ruby bindings of Kernel#callers locations.
23+
#
24+
# The list of bindings here doesn't map 1 to 1 with Kernel#callers, as we
25+
# can't build Ruby bindings for C functions or the equivalent native
26+
# implementations in JRuby and Rubinius.
27+
#
28+
# This method needs to be overridden by every integration.
29+
def self.caller_bindings
30+
raise NotImplementedError
31+
end
32+
end
3133
end

lib/web_console/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module WebConsole
2-
VERSION = '3.3.0'
2+
VERSION = '3.3.1'
33
end

web-console.gemspec

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@ Gem::Specification.new do |s|
1515

1616
s.required_ruby_version = '>= 2.2.2'
1717

18-
rails_version = ">= 4.2"
18+
rails_version = ">= 5.0"
1919

2020
s.add_dependency "railties", rails_version
2121
s.add_dependency "activemodel", rails_version
22+
s.add_dependency "actionview", rails_version
2223
s.add_dependency "debug_inspector"
2324
end

0 commit comments

Comments
 (0)