Skip to content

Commit

Permalink
Set up PostgreSQL by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvdrum committed Jun 29, 2009
1 parent eb0a420 commit 82d48a7
Showing 1 changed file with 43 additions and 7 deletions.
50 changes: 43 additions & 7 deletions base.rb
@@ -1,35 +1,71 @@
project_name = @root.split('/').last
owner = `whoami`

# Delete unnecessary files
run "rm README"
run "rm -rf doc"
run "rm public/index.html"
run "rm public/favicon.ico"

# Set up git repository
# Set up git.
git :init

# Copy database.yml for distribution use
run "cp config/database.yml config/database.yml.example"

file '.gitignore', <<-END
.DS_Store
.idea
*.sqlite3
log
tmp
config/database.yml
END

# Copy database.yml for distribution use
run "cp config/database.yml config/database.yml.example"

file 'config/database.yml', <<-END
# gem install postgresql-ruby (not necessary on OS X Leopard)
development:
adapter: postgresql
database: #{project_name}
username: #{owner}
password: #{owner}
host: localhost
pool: 5
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: postgresql
database: #{project_name}_test
username: #{owner}
password: #{owner}
host: localhost
pool: 5
timeout: 5000
production:
adapter: postgresql
database: #{project_name}
username: #{owner}
password: #{owner}
host: localhost
pool: 5
timeout: 5000
END

# Install Rails plugins
plugin 'less-for-rails', :git => 'git://github.com/augustl/less-for-rails.git'

# Install all gems
gem 'less'
gem 'shoulda'
gem 'mocha'
gem 'postgresql-ruby'
gem 'shoulda'

rake 'gems:install', :sudo => true

# Commit all work so far to the repository
# Now commit everything.
git :add => '.'
git :commit => "-a -m 'Initial commit.'"

Expand Down

0 comments on commit 82d48a7

Please sign in to comment.