<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/ruby-processing/run.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,4 +1,4 @@
 #!/usr/bin/env ruby
 
-require File.expand_path(File.dirname(__FILE__) + &quot;/../lib/ruby-processing/runner&quot;)
+require File.expand_path(File.dirname(__FILE__) + &quot;/../lib/ruby-processing&quot;)
 Processing::Runner.execute
\ No newline at end of file</diff>
      <filename>bin/rp5</filename>
    </modified>
    <modified>
      <diff>@@ -2,13 +2,10 @@
 # Send suggestions, ideas, and hate-mail to jashkenas [at] gmail.com
 # Also, send samples and libraries.
 
-require 'java'
-require 'fileutils'
-
-$LOAD_PATH &lt;&lt; File.expand_path(File.dirname(__FILE__))
-
-# RUBY_PROCESSING_ROOT = File.expand_path(File.dirname(__FILE__)) unless defined?(RUBY_PROCESSING_ROOT)
-# SKETCH_PATH = File.dirname($0) unless defined?(SKETCH_PATH)
+unless defined? RP5_ROOT
+  $LOAD_PATH &lt;&lt; File.expand_path(File.dirname(__FILE__))
+  RP5_ROOT = File.expand_path(File.dirname(__FILE__) + &quot;/../&quot;)
+end
 
 module Processing
   VERSION = [1,1]
@@ -17,5 +14,6 @@ module Processing
     VERSION.join('.')
   end
   
-  autoload :App,      'processing/app'
+  autoload :App,      'ruby-processing/app'
+  autoload :Runner,   'ruby-processing/runner'
 end
\ No newline at end of file</diff>
      <filename>lib/ruby-processing.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,11 +2,12 @@
 # Most of the code here is for interfacing with Swing, 
 # web applets, going fullscreen and so on.
 
+require 'java'
 
 module Processing 
 
   # Conditionally load core.jar
-  require &quot;#{RUBY_PROCESSING_ROOT}/core.jar&quot; unless Object.const_defined?(:JRUBY_APPLET)  
+  require &quot;#{RP5_ROOT}/lib/core/core.jar&quot; unless Object.const_defined?(:JRUBY_APPLET)  
   include_package &quot;processing.core&quot;
 
   class App &lt; PApplet</diff>
      <filename>lib/ruby-processing/app.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-['optparse', 'ostruct'].each {|f| require f }
+require 'ostruct'
 
 module Processing
   
@@ -18,57 +18,22 @@ module Processing
       @options.path = File.basename(Dir.pwd) + '.rb'
     end
     
-    def parse_options(args)
-      # EWGG!
-    end
-    
     def execute!
       case @options.action
-      when :run     : run(@options.path)
-      when :watch   : watch(@options.path)
-      when :create  : create(@options.path)
-      when :live    : live(@options.path)
-      when :sample  : sample(@options.path)
+      when 'run'    : run(@options.path)
+      when 'watch'  : watch(@options.path)
+      when 'create' : create(@options.path)
+      when 'live'   : live(@options.path)
+      when 'sample' : sample(@options.path)
+      when /-v/     : show_version
+      when /-h/     : show_help
       end
     end
     
+    # Parse the command-line options. Keep it simple
     def parse_options(args)
-      begin
-        args.extend(OptionParser::Arguable)
-        args.options do |opts|
-          opts.banner = &quot;Usage: rp5 []&quot;
-          
-          opts.separator &quot;&quot;
-          opts.separator &quot;Creating a fresh project:&quot;
-          
-          opts.on('create', 'create [SKETCH]', 'Create a new Ruby-Processing sketch') do |sketch|
-            @options.action = :create
-            @options.path = sketch
-          end
-          
-          opts.separator &quot;&quot;
-          opts.separator &quot;Running a project:&quot;
-          
-          opts.on &quot;run&quot;, &quot;run [SKETCH]&quot;, 'Run a Ruby-Processing sketch' do |sketch|
-            @options.action :run
-            @options.path = sketch
-          end
-          
-          opts.separator &quot;&quot;
-          opts.separator &quot;Extra options:&quot;
-          
-          opts.on_tail('-v', '--version', 'Show version') do
-            exit_with_success(&quot;ruby-processing version #{Processing.version}&quot;)
-          end
-          
-          opts.on_tail('-h', '--help', 'Show this message') do
-            exit_with_success(opts)
-          end
-          
-        end.parse!
-      rescue Exeption =&gt; e
-        exit_with_error(e)
-      end
+      @options.action = args[0]
+      @options.path = args[1]
     end
     
     # Create a fresh Ruby-Processing sketch, with the necessary
@@ -81,7 +46,7 @@ module Processing
     # Just simply run a ruby-processing sketch.
     def run(sketch)
       ensure_exists(sketch)
-      spin_up(sketch)
+      spin_up(&quot;#{File.join(RP5_ROOT, 'lib/ruby-processing/run.rb')} '#{sketch}'&quot;)
     end
     
     # Run a sketch, keeping an eye on it's file, and reloading
@@ -97,17 +62,36 @@ module Processing
       spin_up(&quot;lib/processing/live.rb '#{sketch}'&quot;)
     end
     
+    def sample
+      
+    end
+    
+    def show_version
+      exit_with_success(&quot;ruby-processing version #{Processing.version}&quot;)
+    end
+    
+    def show_help
+      help = &lt;&lt;-EOS
+Usage: rp5 [run | watch | live | create | applet | application] path/to/the/sketch
+      EOS
+      exit_with_success(help)
+    end
+    
     
     private
     
     def spin_up(args)
-      puts `java -cp jruby-complete.jar #{doc_icon} org.jruby.Main #{args}`
+      puts `java -cp #{jruby_complete} #{dock_icon} org.jruby.Main #{args}`
     end
     
     def ensure_exists(sketch)
       exit_with_error(&quot;Couldn't find: #{sketch}&quot;) unless File.exists?(sketch)
     end
     
+    def jruby_complete
+      File.join(RP5_ROOT, 'lib/core/jruby-complete.jar')
+    end
+    
     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>@@ -22,7 +22,7 @@ module Processing
             begin
               load @file
             rescue SyntaxError
-              print &quot;Syntax Error in your sketch: &quot;,$!, &quot;\n&quot;
+              print &quot;Syntax Error in your sketch: &quot;, $!, &quot;\n&quot;
             end
           end
           sleep 0.1</diff>
      <filename>lib/ruby-processing/watcher.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>49be5872ab6f825fa6246ce25d1d6c44ffdb5ca9</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Ashkenas</name>
    <email>jashkenas@gmail.com</email>
  </author>
  <url>http://github.com/jashkenas/ruby-processing/commit/521c3b2f9199dcb1bc18d55e2e65849b917b63cc</url>
  <id>521c3b2f9199dcb1bc18d55e2e65849b917b63cc</id>
  <committed-date>2009-01-06T09:19:16-08:00</committed-date>
  <authored-date>2009-01-06T09:19:16-08:00</authored-date>
  <message>still pretty rough, working 'rp5 run' from anywhere I believe</message>
  <tree>f3395e76491f62c31dc6be437b9cb7ffabe7950f</tree>
  <committer>
    <name>Jeremy Ashkenas</name>
    <email>jashkenas@gmail.com</email>
  </committer>
</commit>
