<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,3 +1,4 @@
 load 'deploy' if respond_to?(:namespace) # cap2 differentiator
 Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
-load 'config/deploy'
\ No newline at end of file
+load 'config/deploy'
+</diff>
      <filename>Capfile</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,7 @@
 Twitter Vote Report
 https://votereport.pbwiki.com
 
-This is a set of applications desgined to pull polling place reports in from multiple sources, including:
+This application hosts a set of mechanisms desgined to pull polling place reports in from multiple sources, including:
 
 Twitter
   Polls http://twittervision.com/votereport.json for latest #votereport Tweets</diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -1,2 +1,16 @@
 class Report &lt; ActiveRecord::Base
+  validates_uniqueness_of :tid
+  belongs_to :location
+  belongs_to :twitter_user
+  
+  before_save :detect_location
+
+  private
+  def detect_location
+    LOCATION_PATTERNS.find { |p| self.text =~ p }
+    self.location = Location.geocode($1) if $1
+    self.zip = location.postal_code if location &amp;&amp; location.postal_code
+    self.location = twitter_user.location if !self.location &amp;&amp; twitter_user &amp;&amp; twitter_user.location
+  end
+
 end</diff>
      <filename>app/models/report.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,38 @@
-set :application, &quot;set your application name here&quot;
-set :repository,  &quot;set your repository location here&quot;
+# Use Git for deployment - git-specific options
+default_run_options[:pty] = true
+set :scm, &quot;git&quot;
+set :repository,  &quot;git@github.com:davetroy/votereport.git&quot;
+set :branch, &quot;master&quot;
+set :deploy_via, :remote_cache
+set :git_shallow_clone, 1
 
-# If you aren't deploying to /u/apps/#{application} on the target
-# servers (which is the default), you can specify the actual location
-# via the :deploy_to variable:
-# set :deploy_to, &quot;/var/www/#{application}&quot;
+set :application, &quot;votereport&quot;
+set :keep_releases, 3
 
-# If you aren't using Subversion to manage your source code, specify
-# your SCM below:
-# set :scm, :subversion
+role :app, &quot;74.63.9.148&quot;
+role :daemons, &quot;74.63.9.148&quot;
+role :db, &quot;74.63.9.148&quot;, :primary=&gt;true
 
-role :app, &quot;your app-server here&quot;
-role :web, &quot;your web-server here&quot;
-role :db,  &quot;your db-server here&quot;, :primary =&gt; true
\ No newline at end of file
+set :use_sudo, false
+set :user, application
+set :deploy_to, &quot;/home/#{application}&quot;
+
+namespace :deploy do
+  desc &quot;Restart Application&quot;
+  task :restart, :roles =&gt; :app do
+    run &quot;touch #{current_path}/tmp/restart.txt&quot;
+  end
+end
+
+namespace :daemons do
+  desc &quot;Start Daemons&quot;
+  task :start, :roles =&gt; :daemons do
+    run &quot;#{deploy_to}/current/script/daemons start&quot;
+  end
+
+  desc &quot;Stop Daemons&quot;
+  task :stop, :roles =&gt; :daemons do
+    run &quot;#{deploy_to}/current/script/daemons stop&quot;
+		run &quot;sleep 5 &amp;&amp; killall -9 ruby&quot;
+  end
+end</diff>
      <filename>config/deploy.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,5 +4,6 @@ LOCATION_PATTERNS = [
   Regexp.new(/#(\d{5})/),                           # #00000
   Regexp.new(/^l:\s*([^:]+).*$/im),                 # L: at start of text
   Regexp.new(/[\s,]l:\s*([^:]+).*$/im),             # L: in text after space
-  Regexp.new(/\s(\d{5})\s?/)                        # 00000 anywhere in text
+  Regexp.new(/\s(\d{5})\s?/),                       # 00000 anywhere in text
+  Regexp.new(/(\d{5}-\d{4})/)
 ]
\ No newline at end of file</diff>
      <filename>config/initializers/votereport.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-ENV[&quot;RAILS_ENV&quot;] ||= 'development'
+ENV[&quot;RAILS_ENV&quot;] ||= 'production'
 
 FEED = &quot;http://twittervision.com/votereport.json&quot;
 EXTRACTOR = Regexp.new(/^(\w+?):\s(.*)$/m)</diff>
      <filename>lib/daemons/poll_tweets.rb</filename>
    </modified>
    <modified>
      <filename>lib/daemons/poll_tweets_ctl</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,5 @@
 # Initialization is not needed; everything will be loaded in the loadpath via lib/geo.rb
 require 'geo'
-require 'grid'
 
 class Hash
   # Returns hash that is a subset of the current hash, including only the requested keys</diff>
      <filename>vendor/plugins/geocoding/init.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@ require 'json'
 class Hash
   # Returns hash that is a subset of the current hash, including only the requested keys
   def subset(keys)
-    keys.split! if keys is_a?(String)
+    keys = keys.split if keys.is_a?(String)
     result = keys.inject({}) { |result, k| result[k.to_sym] = self[k.to_sym]; result }
   end
 end</diff>
      <filename>vendor/plugins/geocoding/lib/geo.rb</filename>
    </modified>
    <modified>
      <diff>@@ -16,8 +16,8 @@ module Geo
         :postal_code =&gt; 'Placemark AddressDetails Country AdministrativeArea Locality PostalCode PostalCodeNumber' )
       loc[:locality] = loc[:sub_administrative_area] unless loc[:locality]
       loc.merge(:point =&gt; point, :geo_source_id =&gt; 1)
-    # rescue
-    #   nil
+    rescue
+      nil
     end
   end
 end</diff>
      <filename>vendor/plugins/geocoding/lib/geocoders/001_google/geocode.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>vendor/plugins/geocoding/lib/grid.rb</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>2f3cd592bb2d0ead9775778cfa50539f8b3dfe2a</id>
    </parent>
  </parents>
  <author>
    <name>David Troy</name>
    <email>dave@popvox.com</email>
  </author>
  <url>http://github.com/davetroy/votereport/commit/a68acef899168bd0a8685ae855dfa5768b5657a7</url>
  <id>a68acef899168bd0a8685ae855dfa5768b5657a7</id>
  <committed-date>2008-10-22T13:55:43-07:00</committed-date>
  <authored-date>2008-10-22T13:55:43-07:00</authored-date>
  <message>Added capistrano files
Tweaked location detection</message>
  <tree>07d8a7906704002b235051ed984788cae4ea630c</tree>
  <committer>
    <name>David Troy</name>
    <email>dave@popvox.com</email>
  </committer>
</commit>
