Testing & Debugging / Ruby-Debug
Visitors to VTC.com will be able to view all introductory videos for each training course.
Free Trial Members will gain access to first three chapters for each training course.
Full Access Members have full access to VTC.com’s entire library of video tutorials.
Learn More
Subtitles of the Movie
In this video we're going to look at Ruby debug. Now, Ruby has a basic debugger built in, but this is a much better debugger. It's faster and it functions pretty nice. Here you see the website for this project. DataNoise.com. And I will include this URL and also the Ruby Forge website where you can actually take a look at some of the other information about this project. They have a screen cast here that talks about some of the stuff that it does, but we'll take a look at it here too. First, in order to install it we have to do an install of Ruby debug and it already installed on this system but we'll go ahead and update it and see what it does. Guess I got to spell it right. That would help. So it's pretty fast. On your system it's probably going to come up and ask or which version, whether it's Ruby or MS Win32 and you pick if it's a Linux or Mac OSX, you're going to pick the Ruby version and if you're on a Windows system, you're going to pick the Windows version of it. But other than that, it pretty much is simple. Now, I have a file here called get web. It's from another video. I said don't worry about the details of it, of what that ones doing, but how we invoke this is we say R debug and then we give it the script name and then it'll start. And what it actually does is start and then stops at the very first line. So if we say list, now, let's do help. If you remember any command, remember help because that'll give us the available commands that we can take a look at here. So let's do a list right now. And that's going to show us where the program pointer currently is in the program, so that's not too interesting and we could say next. And that'll take us to the begin. We go next again that'll get us to this one. And if we do list, you're going to see that it's sitting right at the H right now. That means it hasn't executed yet, so if I do a display, which will show us what the, is in there, it's going to say nothing's in there at the moment. You can also do a, do it that way where we get the YML, YAML view of whatever the object is and that'll be helpful in a second when you do next. Because now we have, the full thing has been executed and since we're watching by putting on display here, I'm actually watching these. You can see that the first one, which is just the H without any YML, it's pretty much just the object information. The second one says go ahead and display this is YAML, the H, so that makes it readable for us humans and we can see the address, current HTTP version, uh some other information about what that H object has in it. Now if we do a next that went out and actually got the information and you can take a look at the data. Let's take a look at that. Now we got that data and this is all that information from their website and it's thousands of lines of stuff we don't really need to go through. But that's some basics of the debugger. You can also set break points for it to get it to stop and you can actually have it stop on some specific values that occur in variables in there, not just a straight-up break point. So it's a, it's a good little tool if you need to really get in, dig into a Ruby script and figure out what's going on.
Tutorial Information
| Course: | Programming With Ruby |
| Author: | Al Anderson |
| SKU: | 33788 |
| ISBN: | 1-934743-01-1 |
| Release Date: | 2007-08-21 |
| Duration: | 8.5 hrs / 113 lessons |
| Work Files: |
Yes |
| Captions: | For Online University members only |
| Compatibility: |
Vista/XP/2000, OS X, Linux QuickTime 7, Flash 8 |
VTC Sign up & Benefits
- Unlimited Access
- 98,729 Video Tutorials (23,265 free)
- Video Available as Flash or QuickTime
- Over 1026 Courses
- $30 for One Month Access
- Multi-User Discounts Available
United States 