<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,7 +1,7 @@
 Ruby-Processing is released under the MIT License. 
 You can do pretty much whatever you'd like with it.
 
-------------------------------------------------
+====================================================
 
 Copyright (c) 2008 omygawshkenas
 
@@ -29,7 +29,7 @@ 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.
 
-------------------------------------------------
+====================================================
 
 Ruby-Processing also distributes core components 
 of both JRuby and Processing, which are licensed </diff>
      <filename>LICENSE</filename>
    </modified>
    <modified>
      <diff>@@ -9,9 +9,11 @@ end
 
 require 'ruby-processing/helpers/string'
 
+# The top-level namespace, a home for all Ruby-Processing classes.
 module Processing
   VERSION = [1,1]
   
+  # Returns the current version of Ruby-Processing.
   def self.version
     VERSION.join('.')
   end</diff>
      <filename>lib/ruby-processing.rb</filename>
    </modified>
    <modified>
      <diff>@@ -10,11 +10,18 @@ module Processing
   require &quot;#{RP5_ROOT}/lib/core/core.jar&quot; unless Object.const_defined?(:JRUBY_APPLET)  
   include_package &quot;processing.core&quot;
 
+  # This is the main Ruby-Processing class, and is what you'll
+  # inherit from when you create a sketch. This class can call
+  # all of the methods available in Processing, and has two 
+  # mandatory methods, 'setup' and 'draw', both of which you
+  # should define in your sketch. 'setup' will be called one
+  # time when the sketch is first loaded, and 'draw' will be 
+  # called constantly, for every frame.
   class App &lt; PApplet
     include Math
 
     include_class &quot;javax.swing.JFrame&quot;
-
+    
     # Alias some methods for familiarity for Shoes coders.
     attr_accessor :frame, :title
     alias_method :oval, :ellipse
@@ -25,18 +32,18 @@ module Processing
     # Watch the definition of these methods, to make sure 
     # that Processing is able to call them during events.
     METHODS_TO_WATCH_FOR = { 
-      :mouse_pressed =&gt; :mousePressed,
-      :mouse_dragged =&gt; :mouseDragged,
-      :mouse_clicked =&gt; :mouseClicked,
-      :mouse_moved   =&gt;   :mouseMoved, 
+      :mouse_pressed  =&gt; :mousePressed,
+      :mouse_dragged  =&gt; :mouseDragged,
+      :mouse_clicked  =&gt; :mouseClicked,
+      :mouse_moved    =&gt; :mouseMoved, 
       :mouse_released =&gt; :mouseReleased,
-      :key_pressed =&gt; :keyPressed,
-      :key_released =&gt; :keyReleased,
-      :key_typed =&gt; :keyTyped 
+      :key_pressed    =&gt; :keyPressed,
+      :key_released   =&gt; :keyReleased,
+      :key_typed      =&gt; :keyTyped 
     }
 
 
-    def self.method_added(method_name)
+    def self.method_added(method_name) #:nodoc:
       if METHODS_TO_WATCH_FOR.keys.include?(method_name)
         alias_method METHODS_TO_WATCH_FOR[method_name], method_name
       end
@@ -56,10 +63,10 @@ module Processing
     
 
     def self.current=(app); @current_app = app; end
-    def self.current; @current_app; end
-
+    def self.current; @current_app; end   
+    
 
-    # Detect if we're online or not.
+    # Are we running inside an applet?
     def self.online?
       @online ||= Object.const_defined?(:JRUBY_APPLET)
     end
@@ -74,10 +81,11 @@ module Processing
     def library_loaded?(folder); self.class.library_loaded?(folder); end
     
 
-    # For pure ruby libs.
+    # For pure ruby libraries.
     # The library should have an initialization ruby file 
     # of the same name as the library folder.
-    # If a library is put into a folder next to the sketch it will
+    #
+    # If a library is put into a 'library' folder next to the sketch it will
     # be used instead of the library that ships with Ruby-Processing.
     def self.load_ruby_library(dir)
       dir = dir.to_sym
@@ -90,11 +98,15 @@ module Processing
     end
 
 
-    # Loading libraries which include native code needs to 
+    # For pure java libraries, such as the ones that are available
+    # on this page: http://processing.org/reference/libraries/index.html
+    #
+    # If a library is put into a 'library' folder next to the sketch it will
+    # be used instead of the library that ships with Ruby-Processing.
+    #
+    # P.S. -- Loading libraries which include native code needs to 
     # hack the Java ClassLoader, so that you don't have to 
     # futz with your PATH. But it's probably bad juju.
-    # If a library is put into a folder next to the sketch it will
-    # be used instead of the library that ships with Ruby-Processing.
     def self.load_java_library(dir)
       dir = dir.to_sym
       return true if @@loaded_libraries[dir]
@@ -118,11 +130,13 @@ module Processing
     end
 
 
-    def self.has_slider(*args)
+    def self.has_slider(*args) #:nodoc:
       raise &quot;has_slider has been replaced with a nicer control_panel library. Check it out.&quot;
     end
 
 
+    # Used by the Processing::Watcher to completely remove all 
+    # traces of the current sketch, so that it can be loaded afresh.
     def self.wipe_out_current_app!
       app = Processing::App.current
       return unless app
@@ -132,6 +146,12 @@ module Processing
     end
 
 
+    # When you make a new sketch, you pass in (optionally), 
+    # a width, height, title, and whether or not you want to 
+    # run in full-screen. 
+    #
+    # This is a little different than Processing where height
+    # and width are declared inside the setup method instead.
     def initialize(options = {})
       super()
       $app = App.current = self
@@ -149,6 +169,7 @@ module Processing
     end
 
 
+    # Provide a loggable string to represent this sketch.
     def inspect
       &quot;#&lt;Processing::App:#{self.class}:#{@title}&gt;&quot;
     end
@@ -162,61 +183,6 @@ module Processing
     end
 
 
-    def display_full_screen(graphics_env)
-      @frame = java.awt.Frame.new
-      mode = graphics_env.display_mode
-      @width, @height = mode.get_width, mode.get_height
-      gc = graphics_env.get_default_configuration
-      @frame.set_undecorated true
-      @frame.set_background java.awt.Color.black
-      @frame.set_layout java.awt.BorderLayout.new
-      @frame.add(self, java.awt.BorderLayout::CENTER)
-      @frame.pack
-      graphics_env.set_full_screen_window @frame
-      @frame.set_location(0, 0)
-      @frame.show
-      self.init
-      self.request_focus
-    end
-
-
-    def display_in_a_window
-      @frame = JFrame.new(@title)
-      @frame.add(self)
-      @frame.setSize(@width, @height + 22)
-      @frame.setDefaultCloseOperation(JFrame::EXIT_ON_CLOSE)
-      @frame.setResizable(false)
-      @frame.show
-      self.init
-    end
-
-
-    def display_in_an_applet
-      JRUBY_APPLET.set_size(@width, @height)
-      JRUBY_APPLET.background_color = nil
-      JRUBY_APPLET.double_buffered = false
-      JRUBY_APPLET.add self
-      JRUBY_APPLET.validate
-      # Add the callbacks to peacefully expire.
-      JRUBY_APPLET.on_stop { self.stop }
-      JRUBY_APPLET.on_destroy { self.destroy }
-      self.init
-    end
-
-
-    # Tests to see which display method should run.
-    def determine_how_to_display(options)
-      if online? # Then display it in an applet.
-        display_in_an_applet
-      elsif options[:full_screen] # Then display it fullscreen.
-        graphics_env = java.awt.GraphicsEnvironment.get_local_graphics_environment.get_default_screen_device
-        graphics_env.is_full_screen_supported ? display_full_screen(graphics_env) : display_in_a_window
-      else # Then display it in a window.
-        display_in_a_window
-      end
-    end
-
-
     # There's just so many functions in Processing,
     # Here's a convenient way to look for them.
     def find_method(method_name)
@@ -268,7 +234,7 @@ module Processing
       value[1..-1].hex + 0xff000000
     end
 
-
+    
     # Fields that should be made accessible as under_scored.
     def mouse_x;      mouseX;       end
     def mouse_y;      mouseY;       end
@@ -279,16 +245,19 @@ module Processing
     def key_code;     keyCode;      end
 
 
+    # Is the mouse pressed for this frame?
     def mouse_pressed?
       Java.java_to_primitive(java_class.field(&quot;mousePressed&quot;).value(java_object))
     end
 
 
+    # Is a key pressed for this frame?
     def key_pressed?
       Java.java_to_primitive(java_class.field(&quot;keyPressed&quot;).value(java_object))
     end
+    
 
-
+    # Cleanly close and shutter a running sketch.
     def close
       Processing::App.current = nil
       control_panel.remove if respond_to?(:control_panel) &amp;&amp; !online?
@@ -298,14 +267,69 @@ module Processing
       container.dispose
     end
 
-
+    
     def quit
-      java.lang.System.exit(0)
+      exit
     end
     
     
     private
     
+    # Tests to see which display method should run.
+    def determine_how_to_display(options)
+      if online? # Then display it in an applet.
+        display_in_an_applet
+      elsif options[:full_screen] # Then display it fullscreen.
+        graphics_env = java.awt.GraphicsEnvironment.get_local_graphics_environment.get_default_screen_device
+        graphics_env.is_full_screen_supported ? display_full_screen(graphics_env) : display_in_a_window
+      else # Then display it in a window.
+        display_in_a_window
+      end
+    end
+    
+    
+    def display_full_screen(graphics_env)
+      @frame = java.awt.Frame.new
+      mode = graphics_env.display_mode
+      @width, @height = mode.get_width, mode.get_height
+      gc = graphics_env.get_default_configuration
+      @frame.set_undecorated true
+      @frame.set_background java.awt.Color.black
+      @frame.set_layout java.awt.BorderLayout.new
+      @frame.add(self, java.awt.BorderLayout::CENTER)
+      @frame.pack
+      graphics_env.set_full_screen_window @frame
+      @frame.set_location(0, 0)
+      @frame.show
+      self.init
+      self.request_focus
+    end
+
+
+    def display_in_a_window
+      @frame = JFrame.new(@title)
+      @frame.add(self)
+      @frame.setSize(@width, @height + 22)
+      @frame.setDefaultCloseOperation(JFrame::EXIT_ON_CLOSE)
+      @frame.setResizable(false)
+      @frame.show
+      self.init
+    end
+
+
+    def display_in_an_applet
+      JRUBY_APPLET.set_size(@width, @height)
+      JRUBY_APPLET.background_color = nil
+      JRUBY_APPLET.double_buffered = false
+      JRUBY_APPLET.add self
+      JRUBY_APPLET.validate
+      # Add the callbacks to peacefully expire.
+      JRUBY_APPLET.on_stop { self.stop }
+      JRUBY_APPLET.on_destroy { self.destroy }
+      self.init
+    end
+    
+    
     # When the net library is included, we make the Ruby interpreter
     # accessible to javascript as the 'ruby' variable. From javascript,
     # you can call evalScriptlet() to run code against the sketch.</diff>
      <filename>lib/ruby-processing/app.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
-# This is a utility to export Ruby-Processing
-# sketches to applets that can be viewed online.
-
 module Processing
+  
+  # A utility class to export Ruby-Processing sketches as applets 
+  # that can be viewed online.
   class AppletExporter &lt; BaseExporter
     
     def export!(sketch)</diff>
      <filename>lib/ruby-processing/exporters/applet_exporter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,7 @@
-# This is a utility to export Ruby-Processing sketches as Applications.
-
 module Processing
+  
+  # A utility class to export Ruby-Processing sketches as 
+  # Mac/Win/Nix Applications.
   class ApplicationExporter &lt; BaseExporter
     
     def export!(sketch)</diff>
      <filename>lib/ruby-processing/exporters/application_exporter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,10 +1,10 @@
-# This base exporter implements some of the common 
-# things needed to generate apps and applets.
-
 require 'fileutils'
 require 'erb'
 
 module Processing
+  
+  # This base exporter implements some of the common 
+  # code-munging needed to generate apps and applets.
   class BaseExporter
     include FileUtils
     
@@ -12,10 +12,13 @@ module Processing
     DEFAULT_DIMENSIONS = {'width' =&gt; '500', 'height' =&gt; '500'}
     DEFAULT_DESCRIPTION = ''
     
+    # Returns the filepath, basename, and directory name of the sketch.
     def get_main_file(file)
       return file, File.basename(file), File.dirname(file)
     end
     
+    # Centralized method to read the source of the sketch and extract
+    # all the juicy details.
     def extract_information
       # Extract information from main file
       @info = {}
@@ -30,26 +33,31 @@ module Processing
       @info
     end
     
+    # Searches the source for a class name.
     def extract_class_name(source)
       match = source.match(/(\w+)\s*&lt;\s*Processing::App/)
       match ? match[1] : nil
     end
     
+    # Searches the source for a title.
     def extract_title(source)
       match = source.match(/#{@info[:class_name]}\.new.*?:title\s=&gt;\s[&quot;'](.+)[&quot;']/m)
       match ? match[1] : DEFAULT_TITLE
     end
     
+    # Searches the source for the width and height of the sketch.
     def extract_dimension(source, dimension)
       match = source.match(/#{@info[:class_name]}\.new.*?:#{dimension}\s=&gt;\s(\d+)/m)
       match ? match[1] : DEFAULT_DIMENSIONS[dimension]
     end
     
+    # Searches the source for a description of the sketch.
     def extract_description(source)
       match = source.match(/# Description:(.*?)\n [^#]/m)
       match ? match[1] : DEFAULT_DESCRIPTION
     end
     
+    # Searches the source any libraries that have been loaded.
     def extract_libraries(source)
       libs = []
       code = source.dup
@@ -67,9 +75,9 @@ module Processing
       libs
     end
     
-    # This method looks for all of the codes require or load 
-    # directives, checks to see if the file exists (that it's 
-    # not a gem, or a standard lib) and gives you the real ones.
+    # Looks for all of the codes require or load commands, checks 
+    # to see if the file exists (that it's not a gem, or a standard lib) 
+    # and hands you back all the real ones.
     def extract_real_requires(source)
       code = source.dup
       requirements = []
@@ -86,6 +94,9 @@ module Processing
       return requirements
     end
     
+    
+    protected
+    
     def read_source_code
       File.read(@main_file_path)
     end</diff>
      <filename>lib/ruby-processing/exporters/base_exporter.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
-# Use this class to build a blank sketch.
-
 module Processing
+  
+  # This class creates blank sketches, with the boilerplate filled in.
   class Creator &lt; BaseExporter
     
+    # Create a blank sketch, given a path.
     def create!(path, args)
       usage path
       main_file = File.basename(path, &quot;.rb&quot;)
@@ -26,6 +27,7 @@ module Processing
       end
     end
     
+    # Show the help/usage message for create.
     def usage(predicate)
       unless predicate
         puts &lt;&lt;-USAGE</diff>
      <filename>lib/ruby-processing/exporters/creator.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,5 @@
-# Mostly ripped from activesupport
-
-class String
+class String #:nodoc:
+  
   def titleize
     self.underscore.humanize.gsub(/\b([a-z])/) { $1.capitalize }
   end
@@ -24,4 +23,5 @@ class String
       tr(&quot;-&quot;, &quot;_&quot;).
       downcase
   end
+  
 end
\ No newline at end of file</diff>
      <filename>lib/ruby-processing/helpers/string.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,6 +3,8 @@ require 'fileutils'
 
 module Processing
   
+  # Utility class to handle the different commands that the 'rp5' command
+  # offers. Able to run, watch, live, create, app, applet, and unpack_samples
   class Runner
     
     # Start running a ruby-processing sketch from the passed-in arguments
@@ -17,6 +19,7 @@ module Processing
       @options = OpenStruct.new
     end
     
+    # Dispatch central.
     def execute!
       case @options.action
       when 'run'    : run(@options.path)
@@ -32,7 +35,7 @@ module Processing
       end
     end
     
-    # Parse the command-line options. Keep it simple
+    # Parse the command-line options. Keep it simple.
     def parse_options(args)
       @options.action = args[0]     || 'run'
       @options.path   = args[1]     || File.basename(Dir.pwd + '.rb')
@@ -78,10 +81,12 @@ module Processing
       # TODO
     end
     
+    # Display the current version of Ruby-Processing.
     def show_version
       exit_with_success(&quot;ruby-processing version #{Processing.version}&quot;)
     end
     
+    # Show the standard help/usage message.
     def show_help
       help = &lt;&lt;-EOS
 Usage: rp5 [run | watch | live | create | applet | app] path/to/the/sketch
@@ -92,6 +97,8 @@ Usage: rp5 [run | watch | live | create | applet | app] path/to/the/sketch
     
     private
     
+    # Trade in this Ruby instance for a JRuby instance, loading in a 
+    # starter script and passing it some arguments.
     def spin_up(starter_script, args)
       runner = &quot;#{RP5_ROOT}/lib/ruby-processing/runners/#{starter_script}&quot;
       command = &quot;java -cp #{jruby_complete} #{dock_icon} org.jruby.Main #{runner} #{args}&quot;
@@ -107,6 +114,7 @@ Usage: rp5 [run | watch | live | create | applet | app] path/to/the/sketch
       File.join(RP5_ROOT, 'lib/core/jruby-complete.jar')
     end
     
+    # On the Mac, we can display a fat, shiny ruby in the Dock.
     def dock_icon
       mac = RUBY_PLATFORM.match(/darwin/i)
       mac ? &quot;-Xdock:name=Ruby-Processing -Xdock:icon=script/application_files/Contents/Resources/sketch.icns&quot; : &quot;&quot;</diff>
      <filename>lib/ruby-processing/runner.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,18 +1,21 @@
-# A sketch loader, observer, and reloader, to tighten 
-# the feedback between code and effect.
-
 require &quot;#{File.dirname(__FILE__)}/base.rb&quot;
 
 module Processing  
+  
+  # A sketch loader, observer, and reloader, to tighten 
+  # the feedback between code and effect.
   class Watcher
     
-    def initialize(file)
-      @file = file
+    # Sic a new Processing::Watcher on a given sketch.
+    def initialize(sketch)
+      @file = sketch
       @time = Time.now
       load @file
       start_watching
     end
     
+    # Kicks off a thread to watch the sketch, reloading Ruby-Processing
+    # and restarting the sketch whenever it changes.
     def start_watching
       thread = Thread.start do
         loop do</diff>
      <filename>lib/ruby-processing/runners/watch.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>258fe7d46554d040f1dc004d2d1f4bc6a01c5ed9</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Ashkenas</name>
    <email>jashkenas@gmail.com</email>
  </author>
  <url>http://github.com/jashkenas/ruby-processing/commit/9a9c36bc976febf124042f83e8ed6214d83cfff2</url>
  <id>9a9c36bc976febf124042f83e8ed6214d83cfff2</id>
  <committed-date>2009-01-11T19:13:48-08:00</committed-date>
  <authored-date>2009-01-11T19:13:48-08:00</authored-date>
  <message>Comments galore for better RDocs</message>
  <tree>45c1677275c449fa9919e09629f6a89dd1d8879f</tree>
  <committer>
    <name>Jeremy Ashkenas</name>
    <email>jashkenas@gmail.com</email>
  </committer>
</commit>
