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
85
85
def public_path ; layout . public_path end
86
86
def public_path = ( path ) ; layout . public_path = path end
87
87
88
- # @deprecated use {JRuby::Rack#logger} instead
89
- # @return [Logger]
90
- def logger ; JRuby ::Rack . logger ; end
91
-
92
88
# Boot-up this booter, preparing the environment for the application.
93
89
def boot!
94
90
adjust_gem_path
@@ -157,7 +153,7 @@ def env_gem_path
157
153
158
154
# @note called during {#boot!}
159
155
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
161
157
JRuby ::Rack . app_path = layout . app_path
162
158
JRuby ::Rack . public_path = layout . public_path
163
159
end
@@ -183,7 +179,7 @@ def load_settings_from_init_rb
183
179
stream = url . openStream
184
180
stream . to_io . read
185
181
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 } )"
187
183
next
188
184
ensure
189
185
stream . close rescue nil
Original file line number Diff line number Diff line change 10
10
11
11
describe JRuby ::Rack ::Booter do
12
12
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 ) }
16
16
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
18
21
19
22
before do
20
23
@rack_env = ENV [ 'RACK_ENV' ]
155
158
ENV [ 'GEM_PATH' ] . should == "/blah/gems"
156
159
end
157
160
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
-
166
161
before { $loaded_init_rb = nil }
167
162
168
163
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