File tree Expand file tree Collapse file tree 2 files changed +9
-18
lines changed
Expand file tree Collapse file tree 2 files changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -85,10 +85,6 @@ def gem_path=(path); layout.gem_path = path end
8585 def public_path ; layout . public_path end
8686 def public_path = ( path ) ; layout . public_path = path end
8787
88- # @deprecated use {JRuby::Rack#logger} instead
89- # @return [Logger]
90- def logger ; JRuby ::Rack . logger ; end
91-
9288 # Boot-up this booter, preparing the environment for the application.
9389 def boot!
9490 adjust_gem_path
@@ -157,7 +153,7 @@ def env_gem_path
157153
158154 # @note called during {#boot!}
159155 def export_global_settings
160- JRuby ::Rack . send ( :instance_variable_set , : @booter, self ) # TODO
156+ JRuby ::Rack . instance_variable_set ( : @booter, self ) # NOTE: unused for now
161157 JRuby ::Rack . app_path = layout . app_path
162158 JRuby ::Rack . public_path = layout . public_path
163159 end
@@ -183,7 +179,7 @@ def load_settings_from_init_rb
183179 stream = url . openStream
184180 stream . to_io . read
185181 rescue Exception => e
186- logger . info "failed to read from '#{ url . toString } ' (#{ e . message } )"
182+ JRuby :: Rack . logger . info "failed to read from '#{ url . toString } ' (#{ e . message } )"
187183 next
188184 ensure
189185 stream . close rescue nil
Original file line number Diff line number Diff line change 1010
1111describe JRuby ::Rack ::Booter do
1212
13- let ( :booter ) do
14- JRuby :: Rack :: Booter . new JRuby :: Rack . context = @rack_context
15- end
13+ let ( :context ) { JRuby :: Rack . context = @rack_context }
14+
15+ let ( :booter ) { JRuby :: Rack :: Booter . new ( context ) }
1616
17- after ( :all ) { JRuby ::Rack . context = nil }
17+ after ( :all ) do
18+ JRuby ::Rack . context = nil
19+ JRuby ::Rack . instance_variable_set ( :@booter , nil ) if JRuby ::Rack . instance_variable_get ( :@booter )
20+ end
1821
1922 before do
2023 @rack_env = ENV [ 'RACK_ENV' ]
155158 ENV [ 'GEM_PATH' ] . should == "/blah/gems"
156159 end
157160
158- it "creates a logger that writes messages to the servlet context (by default)" do
159- booter . boot!
160- @rack_context . stub ( :isEnabled ) . and_return true
161- level = org . jruby . rack . RackLogger ::Level ::DEBUG
162- @rack_context . should_receive ( :log ) . with ( level , 'Hello-JRuby!' )
163- booter . logger . debug 'Hello-JRuby!'
164- end
165-
166161 before { $loaded_init_rb = nil }
167162
168163 it "loads and executes ruby code in META-INF/init.rb if it exists" do
You can’t perform that action at this time.
0 commit comments