<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -12,9 +12,6 @@
 * (5) better installation instructions
 * (2) set up deployment (rake/capistrano/vlad)
 * (1) satellite-wiki.com
-* (1) extend URLMap to provide regex mapping? (and gid rid of the ugly uploads/ hack?)
-* (1) refactor config to be a member variable instead of a constant (like logger)
-* (1) speed up search by limiting to pages/ dir only? (profile first)
 * (1) separate page sync and upload sync, since the latter is so much slower and less likely to cause merge issues?
 * (1) tests: use fixtures for data loading?
 
@@ -25,6 +22,7 @@
 * page history view
 * revert page to some previous version
 * extend search to search upload names (and upload content?)
+* speed up search by limiting to pages dir only? (profile first)
 * replace custom app reloader with Rack::Reloader
 
 === Later?
@@ -38,3 +36,4 @@
 * del.icio.us integration
 * show sync progress?
 * more profiling
+* extend URLMap to provide regex mapping? (and get rid of the ugly uploads/ hack?) -- tried this, didn't work too well</diff>
      <filename>TODO</filename>
    </modified>
    <modified>
      <diff>@@ -5,33 +5,41 @@
 
 RESULTS_DIR = File.join(File.expand_path(File.dirname(__FILE__)), '../tmp')
 
+require 'rubygems'
+require 'open-uri'
+
 # add library directory to load path
 LIBDIR = File.join(File.expand_path(File.dirname(__FILE__)), '../lib')
 $LOAD_PATH.unshift(LIBDIR)
 
-# load profiling configuration
-require 'configuration'
-CONF = Configuration.load(:profiling)
-
-if CONF.auto_reload
-  # turn on app auto-reloading
-  require 'reloader'
-  RELOADER = Reloader.new(File.join(LIBDIR, 'satellite.rb'))
-else
-  # no auto-reloading
-  require 'satellite'
+require 'satellite'
+
+def main
+  # action = lambda { open 'http://localhost:3000/list' }
+  action = lambda { open 'http://localhost:3000/search?query=foo' }
+
+  delay(5) do
+    warm_up(1, action)
+    profile_with_rubyprof(1, action)
+    profile_with_builtin_profiler(1, action)
+  end
+
+  start_server
 end
 
-def start_up
-  # kill the whole server if an unexpected exception is encounted in the sync
+def delay(sec, exit_when_complete=true)
   Thread.abort_on_exception = true
   Thread.new do
-    Satellite.start
+    puts &quot;waiting for #{sec} seconds...&quot;
+    sleep sec
+    puts &quot;done, continuing with action&quot;
+    yield
+    exit! if exit_when_complete
   end
+end
 
-  puts &quot;waiting for server to start up...&quot;
-  sleep 6
-  puts &quot;done&quot;
+def start_server
+  Satellite::Server.new(:production).start
 end
 
 def warm_up(n, action)
@@ -76,12 +84,4 @@ def profile_with_builtin_profiler(n, action)
   end
 end
 
-def main
-  action = lambda { open 'http://localhost:3000/list' }
-  start_up
-  warm_up(1, action)
-  profile_with_rubyprof(1, action)
-  profile_with_builtin_profiler(1, action)
-end
-
 main</diff>
      <filename>bin/profile</filename>
    </modified>
    <modified>
      <diff>@@ -63,9 +63,13 @@ class Configuration
 
   def load(env)
     config_file = File.join(conf_dir, &quot;#{env}.rb&quot;)
-    env = lambda { config = self; binding }
-    eval(IO.read(config_file), env.call)
-    self
+    if File.exists?(config_file)
+      env = lambda { config = self; binding }
+      eval(IO.read(config_file), env.call)
+      self
+    else
+      raise ArgumentError.new(&quot;Config file #{config_file} does not exist.&quot;)
+    end
   end
 
   def to_s</diff>
      <filename>lib/configuration.rb</filename>
    </modified>
    <modified>
      <diff>@@ -537,10 +537,10 @@ module Satellite
       app
     end
 
-    def start
+    def start(sync=true)
       @boot.run do |app, container|
         add_uploads_handler(app, container.conf)
-        DbSynchronizer.new(container.conf.sync_frequency).start
+        DbSynchronizer.new(container.conf.sync_frequency).start if sync
       end
     end
 </diff>
      <filename>lib/satellite.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>61abecd830a83b020b2551baf766a15f5b0f4712</id>
    </parent>
  </parents>
  <author>
    <name>Ken Pratt</name>
    <email>ken@kenpratt.net</email>
  </author>
  <url>http://github.com/kenpratt/satellite/commit/2d4a647586168610fcee4abfd5f6b8a31e4eeea6</url>
  <id>2d4a647586168610fcee4abfd5f6b8a31e4eeea6</id>
  <committed-date>2008-08-27T18:30:21-07:00</committed-date>
  <authored-date>2008-08-27T18:30:21-07:00</authored-date>
  <message>Fixed profiler.</message>
  <tree>547d4fba06b8e55fe5653f9d379e70e548b56298</tree>
  <committer>
    <name>Ken Pratt</name>
    <email>ken@kenpratt.net</email>
  </committer>
</commit>
