!header dev-utils nomain h1. The Ruby dev-utils Project !toc h2. About dev-utils p. @dev-utils@ provides utilites to assist the process of developing Ruby programs. At the moment, the target areas are debugging and unit testing (planned). Version 1.0 was released on 2004-10-08 as a RubyGem, and made its way into RPA. Version 1.0.1 was released on 2004-10-12, in order to make tarball installation possible. There's no need to upgrade, as there is no code change. Throughout this documentation, there are references to planned features. These will be released in 2.0, for which there is no estimated completion date. h3. Debugging With @dev-utils/debug@ you can: * Escape to an IRB session from a running program.
breakpoint breakpoint 'Person#name' # Identify it when it happens. breakpoint { @name } # Default return value.* Access a no-config logfile for debugging.
debug 'Database connection established' # Look in ./debug.log* Trace expressions in that logfile.
trace 'x + y' trace 'Process.pid' trace 'names', :pp # Pretty-print. trace 'page_structure', :yaml # YAML representation.* %(planned)Find the difference between complex objects (planned).% For more information, see "Debugging Aids":DebuggingAids.html.
gem install -r dev-utilsRPA:
rpa install dev-utilsTarball:
tar zxvf dev-utils-1.0.1.tgz cd dev-utils-1.0.1 [sudo] ruby setup.rb(See the "setup.rb instructions webpage":setup for advanced installation options.) [setup]http://i.loveruby.net/en/man/setup/usage.html h2. Administrivia h3. Credits The breakpoint-related code was contributed unwittingly by Joel VanderWerf and Florian Gross. The rest of the code is by Gavin Sinclair. h3. Notes p. @dev-utils@ depends on "@extensions@":http://extensions.rubyforge.org, version 0.5 or greater. Runnable examples are located in the @examples@ directory of the distribution. h3. License Copyright (c) 2004, Gavin Sinclair. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.