forked from ryanb/rails-templates
-
Notifications
You must be signed in to change notification settings - Fork 1
/
base.rb
62 lines (53 loc) · 1.35 KB
/
base.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
58
59
60
61
62
# set some constants
APP_DIRNAME = File.basename(root)
APP_NAME = APP_DIRNAME.classify
APP_DOMAIN = "#{APP_DIRNAME}.info"
# Set up git repository
git :init
# remove all useless public files
run "rmdir tmp/{pids,sessions,sockets,cache}"
run "rm README"
run "rm log/*.log"
run "rm public/index.html"
run "rm public/javascripts/*"
run "rm public/favicon.ico"
run "rm public/images/rails.png"
run "rm public/robots.txt"
run "rm -rf test"
run "rm -rf doc"
run "rm config/locales/*"
# keep empty dirs
run("find . \\( -type d -empty \\) -and \\( -not -regex ./\\.git.* \\) -exec touch {}/.gitkeep \\;")
# basic .gitignore file
file '.gitignore',
%q{log/*.log
log/*.pid
db/*.db
db/*.sqlite3
db/schema.rb
tmp/**/*
.DS_Store
Thumbs.db
doc/api
doc/app
config/database.yml
autotest_result.html
coverage
public/javascripts/*_packaged.js
public/stylesheets/*_packaged.css
public/attachments
}
# copy sample database config
run "cp config/database.yml config/database.yml.sample"
# copy some files
file "config/locales/ru.yml", open("http://github.com/svenfuchs/rails-i18n/raw/master/rails/locale/ru.yml").read
file "public/javascripts/jquery.js", open("http://code.jquery.com/jquery-1.4.2.min.js").read
file "public/javascripts/application.js", <<-TXT
/*
Your application package
*/
TXT
git :submodule => "init"
git :add => "."
git :commit => %(-m "Bootstrapping #{APP_NAME}")
# ------- #