broney (owner)

Revisions

gist: 90185 Download_button fork
public
Public Clone URL: git://gist.github.com/90185.git
Embed All Files: show embed
bryces-template.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Template created by You've Got Rails (http://www.youvegotrails.com)
 
 
# Remove unnecessary Rails files
run 'rm README'
run 'rm public/index.html'
run 'rm public/favicon.ico'
run 'rm public/images/rails.png'
 
 
# Copy database.yml
run 'cp config/database.yml config/database.yml.example'
 
gem 'RedCloth', :lib => 'redcloth'
plugin 'restful-authentication', :git => 'git://github.com/technoweenie/restful-authentication.git'
plugin 'role_requirement', :git => 'git://github.com/timcharper/role_requirement.git'
plugin 'rspec', :git => 'git://github.com/dchelimsky/rspec.git'
plugin 'rspec-rails', :git => 'git://github.com/dchelimsky/rspec-rails.git'
plugin 'attachment_fu', :git => 'git://github.com/technoweenie/attachment_fu.git'
# Install gems on local system
rake('gems:install', :sudo => true) if yes?('Install gems on local system? (y/n)')
 
# Unpack gems into vendor/gems
rake('gems:unpack:dependencies') if yes?('Unpack gems into vendor directory? (y/n)')
 
 
# Use database (active record) session store
rake('db:sessions:create')
initializer 'session_store.rb', <<-FILE
ActionController::Base.session = { :session_key => '_#{(1..6).map { |x| (65 + rand(26)).chr }.join}_session', :secret => '#{(1..40).map { |x| (65 + rand(26)).chr }.join}' }
ActionController::Base.session_store = :active_record_store
FILE
 
# Generate roles for User
generate("roles", "Role User")
 
# Generate restful-authentication user and session
generate("authenticated", "user session")
 
# Run rspec generator
generate("rspec")
 
 
# Create .gitignore file
file '.gitignore', <<-FILE
.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3
FILE
 
# Set up git repository
git :init
git :add => '.'