Skip to content

Commit 8159d7a

Browse files
committed
[chore] Drop deprecated JRuby::Rack::RailsFileSystemLayout alias for JRuby::Rack::FileSystemLayout
1 parent 606592f commit 8159d7a

File tree

3 files changed

+21
-50
lines changed

3 files changed

+21
-50
lines changed

History.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
- Drop `jruby.rack.jruby.version` and `jruby.rack.rack.release` keys from rack `env` Hash
1010
- Drop deprecated `Rack::Handler::Servlet::Env` and `Rack::Handler::Servlet::LazyEnv` types (replaced by `DefaultEnv`)
1111
- Drop undocumented and deprecated jruby-rack 1.0 backwards compat properties `jruby.runtime.timeout.sec`, `jruby.runtime.initializer.threads`, `jruby.init.serial`, `jruby.rack.request.size.threshold.bytes`
12+
- Drop deprecated `JRuby::Rack::RailsFileSystemLayout` alias for `JRuby::Rack::FileSystemLayout`
1213
- Change context listener to throw, in case of an exception during initialization, by default
1314
- Change rails context listener to assume a thread-safe application by default
1415
- update (bundled) rack to 2.2.17

src/main/ruby/jruby/rack/app_layout.rb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,5 @@ def expand_path(path)
181181
end
182182

183183
end
184-
185-
RailsFileSystemLayout = FileSystemLayout
186-
# @private backwards compatibility
187-
RailsFilesystemLayout = FileSystemLayout
188-
189184
end
190185
end

src/spec/ruby/jruby/rack/app_layout_spec.rb

Lines changed: 20 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,12 @@
8787

8888
end
8989

90-
shared_examples "FileSystemLayout" do
90+
describe JRuby::Rack::FileSystemLayout do
91+
92+
let(:layout) do
93+
allow(@rack_context).to receive(:getRealPath) { |path| path }
94+
JRuby::Rack::FileSystemLayout.new(@rack_context)
95+
end
9196

9297
before do
9398
@original_work_dir = Dir.pwd
@@ -99,6 +104,20 @@
99104
Dir.chdir @original_work_dir
100105
end
101106

107+
it "sets app uri from an app.root context param" do
108+
FileUtils.mkdir_p 'app/current'
109+
expect(@rack_context).to receive(:getInitParameter).with("app.root").and_return "#{Dir.pwd}/app/current"
110+
expect(layout.app_uri).to eq File.expand_path('app/current')
111+
expect(layout.app_path).to eq "#{Dir.pwd}/app/current"
112+
end
113+
114+
it "sets app uri from a rails.root context param" do
115+
base = File.join File.dirname(__FILE__), '../../rails'
116+
expect(@rack_context).to receive(:getInitParameter).with("rails.root").and_return base
117+
expect(layout.app_uri).to eq base
118+
expect(layout.app_path).to eq File.expand_path(base)
119+
end
120+
102121
it "sets app and public uri defaults based on a typical (Rails/Rack) app" do
103122
FileUtils.mkdir('./public')
104123
expect(layout.app_uri).to eq '.'
@@ -181,47 +200,3 @@
181200
end
182201

183202
end
184-
185-
describe JRuby::Rack::FileSystemLayout do
186-
187-
let(:layout) do
188-
allow(@rack_context).to receive(:getRealPath) { |path| path }
189-
JRuby::Rack::FileSystemLayout.new(@rack_context)
190-
end
191-
192-
it_behaves_like "FileSystemLayout"
193-
194-
it "sets app uri from an app.root context param" do
195-
FileUtils.mkdir_p 'app/current'
196-
expect(@rack_context).to receive(:getInitParameter).with("app.root").and_return "#{Dir.pwd}/app/current"
197-
expect(layout.app_uri).to eq File.expand_path('app/current')
198-
expect(layout.app_path).to eq "#{Dir.pwd}/app/current"
199-
end
200-
201-
describe "deprecated-constant" do
202-
203-
it "still works" do
204-
expect(JRuby::Rack::RailsFilesystemLayout).to be JRuby::Rack::FileSystemLayout
205-
end
206-
207-
end
208-
209-
end
210-
211-
describe JRuby::Rack::RailsFileSystemLayout do
212-
213-
let(:layout) do
214-
allow(@rack_context).to receive(:getRealPath) { |path| path }
215-
JRuby::Rack::RailsFileSystemLayout.new(@rack_context)
216-
end
217-
218-
it_behaves_like "FileSystemLayout"
219-
220-
it "sets app uri from a rails.root context param" do
221-
base = File.join File.dirname(__FILE__), '../../rails'
222-
expect(@rack_context).to receive(:getInitParameter).with("rails.root").and_return base
223-
expect(layout.app_uri).to eq base
224-
expect(layout.app_path).to eq File.expand_path(base)
225-
end
226-
227-
end if defined? JRuby::Rack::RailsFileSystemLayout

0 commit comments

Comments
 (0)