<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>lib/redcar.rb</filename>
    </added>
    <added>
      <filename>plugins/application/spec/application/application_spec.rb</filename>
    </added>
    <added>
      <filename>plugins/application/spec/spec_helper.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -5,4 +5,6 @@ Things taken out that must be put back in:
 
   1. Single-instance support, formerly in lib/dbus.rb
   2. Gnome url handlers, formerly in lib/gconf.rb (do we use Java-GNOME for this?)
+  3. Pull in STDOUT, formerly in bin/redcar
+  4. Detach Redcar process, formerly in bin/redcar
   
\ No newline at end of file</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -1,144 +1,7 @@
 #!/usr/bin/env ruby
 
 process_start_time = Time.now
+$:.push File.join(File.dirname(__FILE__), '..', 'lib')
 
-if ARGV.include?(&quot;-h&quot;) or ARGV.include?(&quot;--help&quot;)
-  puts s=&lt;&lt;USAGE
-Redcar (c) Daniel Lucraft 2007-#{Time.now.year}
-
-Usage: redcar [OPTIONS] [FILE|DIRECTORY]* 
-
-Files given are opened in tabs, directories are opened as projects.
-
-               --help, -h   This information
-             --detach, -d   Detach Redcar if there is standard input
-      --multiple-instance   Launch a new instance of Redcar, whether there is one already running or not
-USAGE
-#Testing Options
-#            --spec PLUGIN   Run specs for plugin PLUGIN (e.g. project)
-#        
-#USAGE
-  exit
-end
-
-HERE = File.expand_path(File.dirname(__FILE__))
-
-if STDIN.isatty == false
-  $stdin_contents = &quot;&quot;
-  until STDIN.eof?
-    $stdin_contents &lt;&lt; STDIN.read
-  end
-  STDIN.close
-  STDOUT.close
-  STDERR.close
-  $stdout = File.open(&quot;/dev/null&quot;, &quot;w&quot;)
-  $stderr = $stdout
-  if ARGV.include?(&quot;-d&quot;) or ARGV.include?(&quot;--detach&quot;)
-    if pid = fork
-      Process.detach(pid)
-      exit(0)
-    end
-  end
-end
-
-def in_features_process?
-  $gutkumber
-end
-
-# TODO: replace with JRuby single-instance code
-
-# require File.join(File.dirname(__FILE__), %w'.. lib dbus')
-# 
-# unless ARGV.include?(&quot;--multiple-instance&quot;)
-#   Redcar::DBus.try_export_service
-# end
-
-# See if a code base was passed as an argument. If not
-# default the codebase to the path of the freeride.rb script
-codebase = File.expand_path(File.dirname(__FILE__))
-project = nil
-
-$FR_CODEBASE = codebase
-$FR_PROJECT = project
-$FREEBASE_APPLICATION = &quot;Redcar&quot;
-
-$:.unshift(File.join(codebase, &quot;..&quot;, &quot;lib&quot;))
-
-require HERE + '/../freebase2/lib/freebase/freebase'
-
-require 'gems'
-Dir[HERE + &quot;/../lib/*.rb&quot;].each {|f| require f unless f =~ /gems\.rb/ }
-
-module Redcar
-  VERSION = '0.0.1'
-  VERSION_MAJOR = 0
-  VERSION_MINOR = 0
-  VERSION_RELEASE = 1
-  ROOT = File.expand_path(File.dirname(__FILE__) + &quot;/../&quot;)
-  
-  include FreeBASE::DataBusHelper
-
-  module App
-    class &lt;&lt; self
-      attr_accessor :ARGV
-    end
-  end
-  
-  def self.verify_configurations(dir)
-    # verify the existence of the config directory (relative to codebase 
-    # if relative path given)
-    if File.absolute_path?(dir)
-      configDir = dir
-    else
-      configDir = File.join($FR_CODEBASE,dir)
-    end
-    
-    begin
-      files = Dir.entries(configDir)
-    rescue
-      raise &quot;Could not locate directory #{configDir}&quot;
-    end
-    # make sure that either properties.yaml exists or default.yaml
-    unless files.include?(&quot;properties.yaml&quot;) or files.include?(&quot;default.yaml&quot;)
-      raise &quot;Could not locate default.yaml in #{configDir}&quot;
-    end
-  end
-  
-  # Requires the same 'dir' as Redcar.startup. If plugin is
-  # nil then runs all the specs, otherwise runs the specs for
-  # that plugin.
-  def self.spec(dir, plugin=nil)
-    verify_configurations(dir)
-    
-    FreeBASE::Core.load_plugins(&quot;properties.yaml&quot;,&quot;#{dir}/default.yaml&quot;)
-  end
-
-  # Start up Redcar and block until shut down event is received
-  #
-  # dir:: [String] The directory which holds the FreeRIDE codebase
-  def self.startup(dir)
-    verify_configurations(dir)
-    
-    # This method will not return until Redcar is closed (shut down)
-    FreeBASE::Core.startup(&quot;properties.yaml&quot;,&quot;#{dir}/default.yaml&quot;)
-  end
-
-  def self.PLUGINS_PATH
-    bus(&quot;/system/properties/config/codebase&quot;).data + &quot;/&quot; + 
-      bus(&quot;/system/properties/config/plugin_path&quot;).data
-  end
-end
-
-Redcar::PROCESS_START_TIME = process_start_time
-Redcar::App.ARGV ||= Marshal.load(Marshal.dump(ARGV))
-
-config_dir = File.join(codebase, &quot;..&quot;, &quot;config&quot;)
-
-if ix = Redcar::App.ARGV.index(&quot;--spec&quot;)
-  Redcar.spec(config_dir, Redcar::App.ARGV[ix+1])
-elsif Redcar::App.ARGV.index(&quot;--test&quot;)
-  Redcar.spec(config_dir)
-end
-
-Redcar.startup(config_dir)
-
+require 'redcar'
+Redcar.start</diff>
      <filename>bin/redcar</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d3aab4941c7235a9488c15b044efe3f0ad59eb6e</id>
    </parent>
  </parents>
  <author>
    <name>Daniel Lucraft</name>
    <email>dan@fluentradical.com</email>
  </author>
  <url>http://github.com/danlucraft/redcar/commit/3c5a729d0f3a368ddadc0078fab8e997d6d0e634</url>
  <id>3c5a729d0f3a368ddadc0078fab8e997d6d0e634</id>
  <committed-date>2009-09-20T05:24:36-07:00</committed-date>
  <authored-date>2009-09-20T05:24:36-07:00</authored-date>
  <message>Cleaned up the load path; can now run plugin specs</message>
  <tree>35f6264dbc221714485432742343f5fbbb0329f1</tree>
  <committer>
    <name>Daniel Lucraft</name>
    <email>dan@fluentradical.com</email>
  </committer>
</commit>
