Skip to content

Development and Debugging Tools

Jason R. Clark edited this page Apr 23, 2015 · 4 revisions

Development

Running samples

There are lots of sample apps in the samples/ directory. To run through them efficiently, use the rake samples commands:

rake --tasks
...
rake samples:bad                   # Run all non-working samples in random order
rake samples:bad_list              # Create list of non-working samples
rake samples:good                  # Run all working samples in alphabetical order
rake samples:random                # Run all working samples in random order
rake samples:subset[filename]      # Run all samples listed in samples/filename
...

Debugging

Pry

The development group in Shoe's Gemfile has pry and pry-nav installed, which should give a solid, basic debugging experience when necessary.

To use this, just add this line where you want to break in the execution of your Shoes app:

binding.pry

If you want to learn more about Pry, start at http://pryrepl.org/

Memory leaks

To help track down memory leaks from SWT objects, require the leak hunter in your app:

# my_leaky_app.rb
require 'shoes/swt/tooling/leak_hunter'

Shoes.app do
  para "When you close this app, you'll get a report on SWT objects that may be leaking"
end

And run it:

bin/shoes path/to/my_leaky_app.rb

Now hunt down those leaks!