Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
basic install generators, initial migrations
  • Loading branch information
BillL committed Mar 19, 2011
1 parent 98f94a2 commit e7ed1af
Show file tree
Hide file tree
Showing 77 changed files with 10,904 additions and 200 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -2,3 +2,4 @@
db/*.sqlite3
log/*.log
tmp/**/*
*.tmproj
4 changes: 3 additions & 1 deletion Gemfile
Expand Up @@ -2,7 +2,8 @@ source 'http://rubygems.org'

gem 'rails', '3.0.5'

gem 'mysql2'
# gem 'mysql2'
gem "sqlite3"

gem "haml-rails", ">= 0.2"
gem "devise", ">=1.1.2"
Expand All @@ -16,6 +17,7 @@ gem "sass"
gem 'oily_png'
gem "hpricot"
gem 'jquery-rails', '>= 0.2.6'
gem "ruby_parser"
# gem 'unicorn'
# gem 'capistrano'

Expand Down
8 changes: 6 additions & 2 deletions Gemfile.lock
Expand Up @@ -100,7 +100,6 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.16)
mysql2 (0.2.6)
nokogiri (1.4.4)
oily_png (0.3.0)
chunky_png (~> 0.12)
Expand Down Expand Up @@ -147,13 +146,17 @@ GEM
ruby-debug-base19 (>= 0.11.19)
ruby_core_source (0.1.4)
archive-tar-minitar (>= 0.5.2)
ruby_parser (2.0.6)
sexp_processor (~> 3.0)
rubyzip (0.9.4)
sass (3.1.0.alpha.249)
selenium-webdriver (0.1.3)
childprocess (~> 0.1.5)
ffi (~> 0.6.3)
json_pure
rubyzip
sexp_processor (3.0.5)
sqlite3 (1.3.3)
term-ansicolor (1.0.5)
thor (0.14.6)
treetop (1.4.9)
Expand Down Expand Up @@ -183,12 +186,13 @@ DEPENDENCIES
icalendar
ice_cube
jquery-rails (>= 0.2.6)
mysql2
oily_png
rails (= 3.0.5)
rails_admin!
rspec (>= 2.0.1)
rspec-rails (>= 2.0.1)
ruby-debug19
ruby_parser
sass
sqlite3
validate_email
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -49,8 +49,8 @@ useful.
<tt>rake db:create</tt>

4. Start the Rails server and load the app in your browser to confirm a valid install:
<tt>rails s</tt>
<tt>http://localhost:3000</tt>
rails s</tt>
http://localhost:3000</tt>

5. Basic Setup and Customization

Expand Down
3 changes: 3 additions & 0 deletions app/models/photo.rb
@@ -0,0 +1,3 @@
class Photo < ActiveRecord::Base
belongs_to :photo_lookup
end
3 changes: 3 additions & 0 deletions app/models/photo_lookup.rb
@@ -0,0 +1,3 @@
class PhotoLookup < ActiveRecord::Base
has_many :photos
end
9 changes: 9 additions & 0 deletions app/models/user.rb
@@ -0,0 +1,9 @@
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :token_authenticatable, :confirmable, :lockable and :timeoutable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable

# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation, :remember_me
end
9 changes: 9 additions & 0 deletions app/views/devise/confirmations/new.html.haml
@@ -0,0 +1,9 @@
%h2 Resend confirmation instructions
= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f|
= devise_error_messages!
%p
= f.label :email
%br/
= f.text_field :email
%p= f.submit "Resend confirmation instructions"
= render :partial => "devise/shared/links"
4 changes: 4 additions & 0 deletions app/views/devise/mailer/confirmation_instructions.html.haml
@@ -0,0 +1,4 @@
%p
Welcome #{@resource.email}!
%p You can confirm your account through the link below:
%p= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token)
6 changes: 6 additions & 0 deletions app/views/devise/mailer/reset_password_instructions.html.haml
@@ -0,0 +1,6 @@
%p
Hello #{@resource.email}!
%p Someone has requested a link to change your password, and you can do this through the link below.
%p= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token)
%p If you didn't request this, please ignore this email.
%p Your password won't change until you access the link above and create a new one.
5 changes: 5 additions & 0 deletions app/views/devise/mailer/unlock_instructions.html.haml
@@ -0,0 +1,5 @@
%p
Hello #{@resource.email}!
%p Your account has been locked due to an excessive amount of unsuccessful sign in attempts.
%p Click the link below to unlock your account:
%p= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token)
14 changes: 14 additions & 0 deletions app/views/devise/passwords/edit.html.haml
@@ -0,0 +1,14 @@
%h2 Change your password
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f|
= devise_error_messages!
= f.hidden_field :reset_password_token
%p
= f.label :password
%br/
= f.password_field :password
%p
= f.label :password_confirmation
%br/
= f.password_field :password_confirmation
%p= f.submit "Change my password"
= render :partial => "devise/shared/links"
9 changes: 9 additions & 0 deletions app/views/devise/passwords/new.html.haml
@@ -0,0 +1,9 @@
%h2 Forgot your password?
= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f|
= devise_error_messages!
%p
= f.label :email
%br/
= f.text_field :email
%p= f.submit "Send me reset password instructions"
= render :partial => "devise/shared/links"
27 changes: 27 additions & 0 deletions app/views/devise/registrations/edit.html.haml
@@ -0,0 +1,27 @@
%h2
Edit #{resource_name.to_s.humanize}
= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f|
= devise_error_messages!
%p
= f.label :email
%br/
= f.text_field :email
%p
= f.label :password
%i (leave blank if you don't want to change it)
%br/
= f.password_field :password
%p
= f.label :password_confirmation
%br/
= f.password_field :password_confirmation
%p
= f.label :current_password
%i (we need your current password to confirm your changes)
%br/
= f.password_field :current_password
%p= f.submit "Update"
%h3 Cancel my account
%p
Unhappy? #{link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete}.
= link_to "Back", :back
17 changes: 17 additions & 0 deletions app/views/devise/registrations/new.html.haml
@@ -0,0 +1,17 @@
%h2 Sign up
= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f|
= devise_error_messages!
%p
= f.label :email
%br/
= f.text_field :email
%p
= f.label :password
%br/
= f.password_field :password
%p
= f.label :password_confirmation
%br/
= f.password_field :password_confirmation
%p= f.submit "Sign up"
= render :partial => "devise/shared/links"
16 changes: 16 additions & 0 deletions app/views/devise/sessions/new.html.haml
@@ -0,0 +1,16 @@
%h2 Sign in
= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f|
%p
= f.label :email
%br/
= f.text_field :email
%p
= f.label :password
%br/
= f.password_field :password
- if devise_mapping.rememberable?
%p
= f.check_box :remember_me
= f.label :remember_me
%p= f.submit "Sign in"
= render :partial => "devise/shared/links"
15 changes: 15 additions & 0 deletions app/views/devise/shared/_links.haml
@@ -0,0 +1,15 @@
- if controller_name != 'sessions'
= link_to "Sign in", new_session_path(resource_name)
%br/
- if devise_mapping.registerable? && controller_name != 'registrations'
= link_to "Sign up", new_registration_path(resource_name)
%br/
- if devise_mapping.recoverable? && controller_name != 'passwords'
= link_to "Forgot your password?", new_password_path(resource_name)
%br/
- if devise_mapping.confirmable? && controller_name != 'confirmations'
= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
%br/
- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
%br/
9 changes: 9 additions & 0 deletions app/views/devise/unlocks/new.html.haml
@@ -0,0 +1,9 @@
%h2 Resend unlock instructions
= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f|
= devise_error_messages!
%p
= f.label :email
%br/
= f.text_field :email
%p= f.submit "Resend unlock instructions"
= render :partial => "devise/shared/links"
1 change: 1 addition & 0 deletions config/application.rb
Expand Up @@ -13,6 +13,7 @@ class Application < Rails::Application
g.test_framework :rspec, :fixture => true, :views => false
g.integration_tool :rspec, :fixture => true, :views => true
end
config.action_view.javascript_expansions[:defaults] = %w(jquery rails)

config.filter_parameters += [:password]
end
Expand Down
8 changes: 8 additions & 0 deletions config/cucumber.yml
@@ -0,0 +1,8 @@
<%
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} --strict --tags ~@wip"
%>
default: <%= std_opts %> features
wip: --tags @wip:3 --wip features
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
28 changes: 8 additions & 20 deletions config/database.yml
@@ -1,32 +1,17 @@
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MySQL driver:
# gem install mysql2
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: small_communities_development
adapter: sqlite3
database: db/development.sqlite3
pool: 5
username: root
password:
socket: /opt/local/var/run/mysql5/mysqld.sock
timeout: 5000

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
encoding: utf8
reconnect: false
adapter: sqlite3
database: small_communities_test
pool: 5
username: root
password:
socket: /opt/local/var/run/mysql5/mysqld.sock
timeout: 5000

production:
adapter: mysql2
Expand All @@ -37,3 +22,6 @@ production:
username: root
password:
socket: /opt/local/var/run/mysql5/mysqld.sock

cucumber:
<<: *test
2 changes: 2 additions & 0 deletions config/environments/development.rb
Expand Up @@ -22,5 +22,7 @@

# Only use best-standards-support built into browsers
config.action_dispatch.best_standards_support = :builtin

config.action_mailer.default_url_options = { :host => 'localhost:3000' }
end

0 comments on commit e7ed1af

Please sign in to comment.