Skip to content

Commit 7458e81

Browse files
authored
Merge pull request #369 from chadlwilson/drop-deprecated-global
[chore] Drop long-deprecated global variable setting during embedded usage
2 parents 196f0d8 + 01e783e commit 7458e81

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Breaking Ruby API changes
2222
- Drop deprecated `JRuby::Rack::RailsFileSystemLayout` alias for `JRuby::Rack::FileSystemLayout`
2323
- Drop deprecated `JRuby::Rack::Errors` alias for `JRuby::Rack::ErrorApp`
2424
- Drop deprecated `Rack::Handler::Servlet::Env` and `Rack::Handler::Servlet::LazyEnv` types (replaced by `DefaultEnv`)
25+
- Drop deprecated setting of global `$servlet_context` variable during embedded usage (replaced by `JRuby::Rack.context`)
2526

2627
Breaking configuration capability changes
2728
- Drop `jruby.rack.jruby.version` and `jruby.rack.rack.release` keys from rack `env` Hash

src/main/java/org/jruby/rack/embed/Dispatcher.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ private void initialize() {
4444
IRubyObject rackModule = runtime.getModule("JRuby").getConstantAt("Rack");
4545
// `JRuby::Rack.context = context`
4646
rackModule.callMethod(runtime.getCurrentContext(), "context=", rubyContext);
47-
// TODO @deprecated only doing this due backwards compatibility :
48-
// user code should use JRuby::Rack.context instead of $servlet_context
49-
runtime.getGlobalVariables().set("$servlet_context", rubyContext);
5047
}
5148

5249
@Override
@@ -68,7 +65,6 @@ public void destroy() {
6865
protected void afterException(
6966
RackEnvironment env, Exception re,
7067
RackResponseEnvironment response) throws IOException {
71-
// TODO a fast draft (probably should use rack.errors) :
7268
context.log("Error:", re);
7369
response.sendError(500);
7470
}

src/spec/ruby/rack/embed/dispatcher_spec.rb

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@
55
let(:application) { double "application" }
66
let(:context) { org.jruby.rack.embed.Context.new "test" }
77

8-
before { $servlet_context = nil }; after { $servlet_context = nil }
9-
10-
it "initializes $servlet_context", :deprecated => true do
11-
org.jruby.rack.embed.Dispatcher.new context, application
12-
expect($servlet_context).to be(context)
13-
end
14-
158
it "initializes JRuby::Rack.context" do
169
prev_context = JRuby::Rack.context
1710
JRuby::Rack.context = nil

0 commit comments

Comments
 (0)