Skip to content

Commit a2967b8

Browse files
author
Jon Yurek
committed
Initial Commit
0 parents  commit a2967b8

File tree

1,831 files changed

+218451
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,831 files changed

+218451
-0
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
log/*
2+
tmp/**/*
3+
db/schema.rb
4+
db/*.sqlite3
5+
public/system
6+
*.DS_Store
7+
coverage/*
8+
*.swp

Capfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
load 'deploy' if respond_to?(:namespace) # cap2 differentiator
2+
Dir['vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
3+
load 'config/deploy'

Rakefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Add your own tasks in files placed in lib/tasks ending in .rake,
2+
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3+
4+
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
5+
6+
require 'rake'
7+
require 'rake/testtask'
8+
require 'rake/rdoctask'
9+
10+
require 'tasks/rails'

app/controllers/application.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class ApplicationController < ActionController::Base
2+
3+
helper :all
4+
5+
protect_from_forgery
6+
7+
include HoptoadNotifier::Catcher
8+
9+
end

app/helpers/application_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module ApplicationHelper
2+
def body_class
3+
"#{controller.controller_name} #{controller.controller_name}-#{controller.action_name}"
4+
end
5+
end

app/models/.keep

Whitespace-only changes.

app/views/layouts/_flashes.erb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<div id="flash">
2+
<% flash.each do |key, value| -%>
3+
<div id="flash_<%= key %>"><%=h value %></div>
4+
<% end %>
5+
</div>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4+
<head>
5+
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
6+
<title><%= PROJECT_NAME.humanize %></title>
7+
<%= stylesheet_link_tag 'screen', :media => 'all' %>
8+
<%= javascript_include_tag :defaults %>
9+
</head>
10+
<body class="<%= body_class %>">
11+
<%= render :partial => 'layouts/flashes' %>
12+
<%= yield %>
13+
</body>
14+
</html>

config/boot.rb

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
# Don't change this file!
2+
# Configure your app in config/environment.rb and config/environments/*.rb
3+
4+
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
5+
6+
module Rails
7+
class << self
8+
def boot!
9+
unless booted?
10+
preinitialize
11+
pick_boot.run
12+
end
13+
end
14+
15+
def booted?
16+
defined? Rails::Initializer
17+
end
18+
19+
def pick_boot
20+
(vendor_rails? ? VendorBoot : GemBoot).new
21+
end
22+
23+
def vendor_rails?
24+
File.exist?("#{RAILS_ROOT}/vendor/rails")
25+
end
26+
27+
def preinitialize
28+
load(preinitializer_path) if File.exist?(preinitializer_path)
29+
end
30+
31+
def preinitializer_path
32+
"#{RAILS_ROOT}/config/preinitializer.rb"
33+
end
34+
end
35+
36+
class Boot
37+
def run
38+
load_initializer
39+
Rails::Initializer.run(:set_load_path)
40+
end
41+
end
42+
43+
class VendorBoot < Boot
44+
def load_initializer
45+
require "#{RAILS_ROOT}/vendor/rails/railties/lib/initializer"
46+
Rails::Initializer.run(:install_gem_spec_stubs)
47+
end
48+
end
49+
50+
class GemBoot < Boot
51+
def load_initializer
52+
self.class.load_rubygems
53+
load_rails_gem
54+
require 'initializer'
55+
end
56+
57+
def load_rails_gem
58+
if version = self.class.gem_version
59+
gem 'rails', version
60+
else
61+
gem 'rails'
62+
end
63+
rescue Gem::LoadError => load_error
64+
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
65+
exit 1
66+
end
67+
68+
class << self
69+
def rubygems_version
70+
Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
71+
end
72+
73+
def gem_version
74+
if defined? RAILS_GEM_VERSION
75+
RAILS_GEM_VERSION
76+
elsif ENV.include?('RAILS_GEM_VERSION')
77+
ENV['RAILS_GEM_VERSION']
78+
else
79+
parse_gem_version(read_environment_rb)
80+
end
81+
end
82+
83+
def load_rubygems
84+
require 'rubygems'
85+
min_version = '1.1.1'
86+
unless rubygems_version >= min_version
87+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
88+
exit 1
89+
end
90+
91+
rescue LoadError
92+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
93+
exit 1
94+
end
95+
96+
def parse_gem_version(text)
97+
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
98+
end
99+
100+
private
101+
def read_environment_rb
102+
File.read("#{RAILS_ROOT}/config/environment.rb")
103+
end
104+
end
105+
end
106+
end
107+
108+
# All that for this:
109+
Rails.boot!

config/database.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<% PASSWORD_FILE = File.join(RAILS_ROOT, '..', '..', 'shared', 'config', 'dbpassword') %>
2+
3+
development:
4+
adapter: mysql
5+
database: <%= PROJECT_NAME %>_development
6+
username: root
7+
password:
8+
host: localhost
9+
encoding: utf8
10+
11+
test:
12+
adapter: mysql
13+
database: <%= PROJECT_NAME %>_test
14+
username: root
15+
password:
16+
host: localhost
17+
encoding: utf8
18+
19+
staging:
20+
adapter: mysql
21+
database: <%= PROJECT_NAME %>_staging
22+
username: <%= PROJECT_NAME %>
23+
password: <%= File.read(PASSWORD_FILE).chomp if File.readable? PASSWORD_FILE %>
24+
host: localhost
25+
encoding: utf8
26+
socket: /var/lib/mysql/mysql.sock
27+
28+
production:
29+
adapter: mysql
30+
database: <%= PROJECT_NAME %>_production
31+
username: <%= PROJECT_NAME %>
32+
password: <%= File.read(PASSWORD_FILE).chomp if File.readable? PASSWORD_FILE %>
33+
host: localhost
34+
encoding: utf8
35+
socket: /var/lib/mysql/mysql.sock

0 commit comments

Comments
 (0)