-
Notifications
You must be signed in to change notification settings - Fork 0
/
001_core.rails
48 lines (40 loc) · 1.17 KB
/
001_core.rails
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
# Core Rails template
#
# Provides:
# - Rails application directory structure initiliazed with git as the SCM system
# - Standard "ignored files" are added to '.gitignore' (.log, database.yml, etc)
# - Saved standard "empty" directories you want in your app
# - A base database.yml file set up to talk to Sqlite3
# - Removes unnecessary files...except index.html (README, et cetera)
# - A single "Initial commit" commit in your repository history
#
# Borrowed HEAVILY from rails-template 'newgit' template
# URL:
# rails:rm_tmp_dirs
["./tmp/pids", "./tmp/sessions", "./tmp/sockets", "./tmp/cache"].each do |f|
run("rmdir ./#{f}")
end
# Delete unnecessary files
run "rm README"
run "rm doc/README_FOR_APP"
run "rm public/favicon.ico"
run "rm public/robots.txt"
# git:hold_empty_dirs
run("find . \\( -type d -empty \\) -and \\( -not -regex ./\\.git.* \\) -exec touch {}/.gitignore \\;")
# git:rails:new_app
git :init
file '.gitignore', <<-CODE
log/*.log
log/*.pid
db/*.db
db/*.sqlite3
db/schema.rb
tmp/**/*
.DS_Store
doc/api
doc/app
config/database.yml
CODE
run "cp config/database.yml config/database.yml.sample"
git :add => "."
git :commit => "-a -m 'Initial commit'"