Skip to content

Commit

Permalink
count this
Browse files Browse the repository at this point in the history
  • Loading branch information
pjhyett committed Feb 15, 2008
0 parents commit 9dd9005
Show file tree
Hide file tree
Showing 158 changed files with 2,435 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Rakefile
@@ -0,0 +1,10 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require(File.join(File.dirname(__FILE__), 'config', 'boot'))

require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'

require 'tasks/rails'
40 changes: 40 additions & 0 deletions app/.svn/entries
@@ -0,0 +1,40 @@
8

dir
365
svn://errtheblog.com/svn/projects/counter/app
svn://errtheblog.com/svn/projects



2007-06-20T21:23:52.510167Z
177
pj


svn:special svn:externals svn:needs-lock











cf301c5b-d72e-0410-996c-ed4829982077

helpers
dir

models
dir

controllers
dir

views
dir

1 change: 1 addition & 0 deletions app/.svn/format
@@ -0,0 +1 @@
8
52 changes: 52 additions & 0 deletions app/controllers/.svn/entries
@@ -0,0 +1,52 @@
8

dir
365
svn://errtheblog.com/svn/projects/counter/app/controllers
svn://errtheblog.com/svn/projects



2007-06-20T21:04:19.042538Z
176
pj


svn:special svn:externals svn:needs-lock











cf301c5b-d72e-0410-996c-ed4829982077

application.rb
file




2008-02-15T21:05:41.000000Z
ddeef0afed8a42a883e767f0afc2266e
2007-06-18T20:19:38.886950Z
147
pj

sites_controller.rb
file




2008-02-15T21:05:41.000000Z
e813f046881395b55611729dbee5fe72
2007-06-20T21:04:19.042538Z
176
pj

1 change: 1 addition & 0 deletions app/controllers/.svn/format
@@ -0,0 +1 @@
8
3 changes: 3 additions & 0 deletions app/controllers/.svn/text-base/application.rb.svn-base
@@ -0,0 +1,3 @@
class ApplicationController < ActionController::Base
session :off
end
33 changes: 33 additions & 0 deletions app/controllers/.svn/text-base/sites_controller.rb.svn-base
@@ -0,0 +1,33 @@
class SitesController < ApplicationController
def index
@sites = Site.find_active
respond_to do |wants|
wants.html
wants.json { render :json => @sites.to_json }
wants.xml { render :xml => @sites.to_xml }
end
end

def show
@site = Site.find(params[:id])
respond_to do |wants|
wants.html
wants.json { render :json => @site.to_json }
wants.xml { render :xml => @site.to_xml }
end
end

def create
url = sanitize(params[:url])
@site = Site.find_by_url(url)
@site = Site.create!(:url => url) unless @site
redirect_to site_path(@site)
rescue
redirect_to '/'
end

private
def sanitize(url)
url.gsub(/^www\./, '').gsub(/\/$/, '')
end
end
3 changes: 3 additions & 0 deletions app/controllers/application.rb
@@ -0,0 +1,3 @@
class ApplicationController < ActionController::Base
session :off
end
33 changes: 33 additions & 0 deletions app/controllers/sites_controller.rb
@@ -0,0 +1,33 @@
class SitesController < ApplicationController
def index
@sites = Site.find_active
respond_to do |wants|
wants.html
wants.json { render :json => @sites.to_json }
wants.xml { render :xml => @sites.to_xml }
end
end

def show
@site = Site.find(params[:id])
respond_to do |wants|
wants.html
wants.json { render :json => @site.to_json }
wants.xml { render :xml => @site.to_xml }
end
end

def create
url = sanitize(params[:url])
@site = Site.find_by_url(url)
@site = Site.create!(:url => url) unless @site
redirect_to site_path(@site)
rescue
redirect_to '/'
end

private
def sanitize(url)
url.gsub(/^www\./, '').gsub(/\/$/, '')
end
end
40 changes: 40 additions & 0 deletions app/helpers/.svn/entries
@@ -0,0 +1,40 @@
8

dir
365
svn://errtheblog.com/svn/projects/counter/app/helpers
svn://errtheblog.com/svn/projects



2007-06-18T20:34:01.236006Z
150
pj


svn:special svn:externals svn:needs-lock











cf301c5b-d72e-0410-996c-ed4829982077

application_helper.rb
file




2008-02-15T21:05:41.000000Z
7b9ebb8b67ebd491bc8e091b4d757357
2007-06-18T20:34:01.236006Z
150
pj

1 change: 1 addition & 0 deletions app/helpers/.svn/format
@@ -0,0 +1 @@
8
2 changes: 2 additions & 0 deletions app/helpers/.svn/text-base/application_helper.rb.svn-base
@@ -0,0 +1,2 @@
module ApplicationHelper
end
2 changes: 2 additions & 0 deletions app/helpers/application_helper.rb
@@ -0,0 +1,2 @@
module ApplicationHelper
end
40 changes: 40 additions & 0 deletions app/models/.svn/entries
@@ -0,0 +1,40 @@
8

dir
365
svn://errtheblog.com/svn/projects/counter/app/models
svn://errtheblog.com/svn/projects



2007-06-20T21:23:52.510167Z
177
pj


svn:special svn:externals svn:needs-lock











cf301c5b-d72e-0410-996c-ed4829982077

site.rb
file




2008-02-15T21:05:41.000000Z
77b6b78938b314e742abc743f865538f
2007-06-20T21:23:52.510167Z
177
pj

1 change: 1 addition & 0 deletions app/models/.svn/format
@@ -0,0 +1 @@
8
6 changes: 6 additions & 0 deletions app/models/.svn/text-base/site.rb.svn-base
@@ -0,0 +1,6 @@
class Site < ActiveRecord::Base
validates_format_of :url, :with => /^\w+\.[a-z0-9.:]+$/i
def self.find_active
find(:all, :conditions => 'hits > 0', :order => 'hits desc')
end
end
6 changes: 6 additions & 0 deletions app/models/site.rb
@@ -0,0 +1,6 @@
class Site < ActiveRecord::Base
validates_format_of :url, :with => /^\w+\.[a-z0-9.:]+$/i
def self.find_active
find(:all, :conditions => 'hits > 0', :order => 'hits desc')
end
end
34 changes: 34 additions & 0 deletions app/views/.svn/entries
@@ -0,0 +1,34 @@
8

dir
365
svn://errtheblog.com/svn/projects/counter/app/views
svn://errtheblog.com/svn/projects



2007-06-20T21:04:19.042538Z
176
pj


svn:special svn:externals svn:needs-lock











cf301c5b-d72e-0410-996c-ed4829982077

layouts
dir

sites
dir

1 change: 1 addition & 0 deletions app/views/.svn/format
@@ -0,0 +1 @@
8
40 changes: 40 additions & 0 deletions app/views/layouts/.svn/entries
@@ -0,0 +1,40 @@
8

dir
365
svn://errtheblog.com/svn/projects/counter/app/views/layouts
svn://errtheblog.com/svn/projects



2007-06-20T21:04:19.042538Z
176
pj


svn:special svn:externals svn:needs-lock











cf301c5b-d72e-0410-996c-ed4829982077

application.rhtml
file




2008-02-15T21:05:41.000000Z
4b4de96b435e8a0731569345f1224965
2007-06-20T21:04:19.042538Z
176
pj

1 change: 1 addition & 0 deletions app/views/layouts/.svn/format
@@ -0,0 +1 @@
8
16 changes: 16 additions & 0 deletions app/views/layouts/.svn/text-base/application.rhtml.svn-base
@@ -0,0 +1,16 @@
<html>
<head>
<title>ErrCount</title>
<%= stylesheet_link_tag 'screen' %>
</head>
<body>
<h1><%= link_to 'ErrCount' ,'/' %></h1>
<h2>keeping you honest. <span class="tight"><%= link_to 'look here', sites_path %>.</span></h2>

<%= yield %>

<div id="footer">
an <span class="tight"><%= link_to 'Err the Blog', 'http://errtheblog.com' %></span> production.
</div>
</body>
</html>

0 comments on commit 9dd9005

Please sign in to comment.