File tree Expand file tree Collapse file tree 3 files changed +23
-12
lines changed Expand file tree Collapse file tree 3 files changed +23
-12
lines changed Original file line number Diff line number Diff line change 83
83
app = Rack ::Builder . new {
84
84
use Rails ::Rack ::Logger
85
85
use Rails ::Rack ::Static
86
+ use Rails ::Rack ::Debugger if options [ :debugger ]
86
87
run ActionController ::Dispatcher . new
87
88
} . to_app
88
89
end
89
90
90
- if options [ :debugger ]
91
- begin
92
- require_library_or_gem 'ruby-debug'
93
- Debugger . start
94
- Debugger . settings [ :autoeval ] = true if Debugger . respond_to? ( :settings )
95
- puts "=> Debugger enabled"
96
- rescue Exception
97
- puts "You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'"
98
- exit
99
- end
100
- end
101
-
102
91
puts "=> Call with -d to detach"
103
92
104
93
trap ( :INT ) { exit }
Original file line number Diff line number Diff line change 1
1
module Rails
2
2
module Rack
3
+ autoload :Debugger , "rails/rack/debugger"
3
4
autoload :Logger , "rails/rack/logger"
4
5
autoload :Static , "rails/rack/static"
5
6
end
Original file line number Diff line number Diff line change
1
+ module Rails
2
+ module Rack
3
+ class Debugger
4
+ def initialize ( app )
5
+ @app = app
6
+
7
+ require_library_or_gem 'ruby-debug'
8
+ ::Debugger . start
9
+ ::Debugger . settings [ :autoeval ] = true if ::Debugger . respond_to? ( :settings )
10
+ puts "=> Debugger enabled"
11
+ rescue Exception
12
+ puts "You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'"
13
+ exit
14
+ end
15
+
16
+ def call ( env )
17
+ @app . call ( env )
18
+ end
19
+ end
20
+ end
21
+ end
You can’t perform that action at this time.
0 commit comments