Skip to content

Commit 67ede88

Browse files
author
Aditya Sanghi
committed
another attempt at the language
1 parent 6f80ea2 commit 67ede88

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

activesupport/lib/active_support/core_ext/kernel/debugger.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Kernel
22
unless respond_to?(:debugger)
3-
# Starts a debugging session if +debugger+ gem has been loaded (call rails server --debugger to do load it).
3+
# Starts a debugging session if a debugger has been loaded (call rails server --debugger to do load it).
44
def debugger
55
message = "\n***** Debugger requested, but was not available (ensure debugger is listed in Gemfile/installed as gem): Start server with --debugger to enable *****\n"
66
defined?(Rails) ? Rails.logger.info(message) : $stderr.puts(message)

guides/code/getting_started/README.rdoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ programming in general.
8686
Debugger support is available through the debugger command when you start your
8787
Mongrel or WEBrick server with --debugger. This means that you can break out of
8888
execution at any point in the code, investigate and change the model, and then,
89-
resume execution! You need to install debugger to run the server in debugging
89+
resume execution! You need to install a debugger to run the server in debugging
9090
mode. With gems, use <tt>gem install debugger</tt>. Example:
9191

9292
class WeblogController < ActionController::Base

guides/source/debugging_rails_applications.textile

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ Completed in 0.01224 (81 reqs/sec) | DB: 0.00044 (3%) | 302 Found [http://localh
191191

192192
Adding extra logging like this makes it easy to search for unexpected or unusual behavior in your logs. If you add extra logging, be sure to make sensible use of log levels, to avoid filling your production logs with useless trivia.
193193

194-
h3. Debugging with +debugger+
194+
h3. Debugging with +debugger+ gem
195195

196196
When your code is behaving in unexpected ways, you can try printing to logs or the console to diagnose the problem. Unfortunately, there are times when this sort of error tracking is not effective in finding the root cause of a problem. When you actually need to journey into your running source code, the debugger is your best companion.
197197

@@ -244,7 +244,7 @@ TIP: In development mode, you can dynamically +require \'debugger\'+ instead of
244244

245245
h4. The Shell
246246

247-
As soon as your application calls the +debugger+ method, the debugger will be started in a debugger shell inside the terminal window where you launched your application server, and you will be placed at debugger's prompt +(rdb:n)+. The _n_ is the thread number. The prompt will also show you the next line of code that is waiting to run.
247+
As soon as your application calls the +debugger+ method, the debugger will be started in a debugger shell inside the terminal window where you launched your application server, and you will be placed at the debugger's prompt +(rdb:n)+. The _n_ is the thread number. The prompt will also show you the next line of code that is waiting to run.
248248

249249
If you got there by a browser request, the browser tab containing the request will be hung until the debugger has finished and the trace has finished processing the entire request.
250250

@@ -272,7 +272,7 @@ continue edit frame method putl set tmate where
272272

273273
TIP: To view the help menu for any command use +help &lt;command-name&gt;+ in active debug mode. For example: _+help var+_
274274

275-
The next command to learn is one of the most useful: +list+. You can also abbreviate debugger commands by supplying just enough letters to distinguish them from other commands, so you can also use +l+ for the +list+ command.
275+
The next command to learn is one of the most useful: +list+. You can also abbreviate the debugging commands by supplying just enough letters to distinguish them from other commands, so you can also use +l+ for the +list+ command.
276276

277277
This command shows you where you are in the code by printing 10 lines centered around the current line; the current line in this particular case is line 6 and is marked by +=>+.
278278

@@ -349,7 +349,7 @@ h4. The Context
349349

350350
When you start debugging your application, you will be placed in different contexts as you go through the different parts of the stack.
351351

352-
debugger creates a context when a stopping point or an event is reached. The context has information about the suspended program which enables a debugger to inspect the frame stack, evaluate variables from the perspective of the debugged program, and contains information about the place where the debugged program is stopped.
352+
The debugger creates a context when a stopping point or an event is reached. The context has information about the suspended program which enables a debugger to inspect the frame stack, evaluate variables from the perspective of the debugged program, and contains information about the place where the debugged program is stopped.
353353

354354
At any time you can call the +backtrace+ command (or its alias +where+) to print the backtrace of the application. This can be very helpful to know how you got where you are. If you ever wondered about how you got somewhere in your code, then +backtrace+ will supply the answer.
355355

@@ -465,7 +465,7 @@ h4. Step by Step
465465

466466
Now you should know where you are in the running trace and be able to print the available variables. But lets continue and move on with the application execution.
467467

468-
Use +step+ (abbreviated +s+) to continue running your program until the next logical stopping point and return control to debugger.
468+
Use +step+ (abbreviated +s+) to continue running your program until the next logical stopping point and return control to the debugger.
469469

470470
TIP: You can also use <tt>step<plus> n</tt> and <tt>step- n</tt> to move forward or backward +n+ steps respectively.
471471

@@ -487,7 +487,7 @@ class Author < ActiveRecord::Base
487487
end
488488
</ruby>
489489

490-
TIP: You can use debugger while using +rails console+. Just remember to +require "debugger"+ before calling the +debugger+ method.
490+
TIP: You can use a debugger while using +rails console+. Just remember to +require "debugger"+ before calling the +debugger+ method.
491491

492492
<shell>
493493
$ rails console
@@ -605,7 +605,7 @@ A simple quit tries to terminate all threads in effect. Therefore your server wi
605605

606606
h4. Settings
607607

608-
There are some settings that can be configured in debugger to make it easier to debug your code. Here are a few of the available options:
608+
There are some settings that can be configured in the +debugger+ gem to make it easier to debug your code. Here are a few of the available options:
609609

610610
* +set reload+: Reload source code when changed.
611611
* +set autolist+: Execute +list+ command on every breakpoint.
@@ -614,7 +614,7 @@ There are some settings that can be configured in debugger to make it easier to
614614

615615
You can see the full list by using +help set+. Use +help set _subcommand_+ to learn about a particular +set+ command.
616616

617-
TIP: You can include any number of these configuration lines inside a +.rdebugrc+ file in your HOME directory. debugger will read this file every time it is loaded and configure itself accordingly.
617+
TIP: You can include any number of these configuration lines inside a +.rdebugrc+ file in your HOME directory. +debugger+ gem will read this file every time it is loaded and configure itself accordingly.
618618

619619
Here's a good start for an +.rdebugrc+:
620620

railties/lib/rails/commands/console.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def require_debugger
7676
require 'debugger'
7777
puts "=> Debugger enabled"
7878
rescue Exception
79-
puts "You need to install debugger to run the console in debugging mode. With gems, use 'gem install debugger'"
79+
puts "You need to install a debugger to run the console in debugging mode. With gems, use 'gem install debugger'"
8080
exit
8181
end
8282
end

railties/lib/rails/generators/rails/app/templates/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ programming in general.
8686
Debugger support is available through the debugger command when you start your
8787
Mongrel or WEBrick server with --debugger. This means that you can break out of
8888
execution at any point in the code, investigate and change the model, and then,
89-
resume execution! You need to install debugger to run the server in debugging
90-
mode. With gems, use <tt>sudo gem install debugger</tt>. Example:
89+
resume execution! You need to install a debugger to run the server in debugging
90+
mode. With gems, use <tt>gem install debugger</tt>. Example:
9191

9292
class WeblogController < ActionController::Base
9393
def index

railties/lib/rails/rack/debugger.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def initialize(app)
1212
::Debugger.settings[:autoeval] = true if ::Debugger.respond_to?(:settings)
1313
puts "=> Debugger enabled"
1414
rescue LoadError
15-
puts "You need to install debugger to run the server in debugging mode. With gems, use 'gem install debugger'"
15+
puts "You need to install a debugger to run the server in debugging mode. With gems, use 'gem install debugger'"
1616
exit
1717
end
1818

0 commit comments

Comments
 (0)