/
rails_basics.rb
54 lines (38 loc) · 1.09 KB
/
rails_basics.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
# create rvmrc file
# create_file ".rvmrc", "rvm gemset create '#{app_name}' \nrvm gemset use '#{app_name}'"
after_bundler do
# clean up rails defaults
remove_file "public/index.html"
remove_file "public/images/rails.png"
generate "controller home index"
gsub_file "app/controllers/home_controller.rb", /def index/, <<-RUBY
def index
flash.now[:notice] = "Welcome! - love Eldar Scrolls"
RUBY
route "root :to => 'home#index'"
run "mv README.rdoc RAILS_README.rdoc"
remove_file "README.rdoc"
create_file "README.md", <<-README
# ReadMe
## Deployment
```
ey deploy
```
## Thanks
The original scaffold for this application was created by [Eldar Scrolls](http://railseldarscrolls.org).
The project was created with the following scrolls:
#{ scrolls.map {|r| "* #{r}"}.join("\n")}
README
if scrolls.include? 'git'
append_file ".gitignore", "\nconfig/database.yml"
append_file ".gitignore", "\npublic/system"
end
end
after_everything do
rake "db:migrate"
end
__END__
name: Rails Basics
description: Best practices for new Rails apps
author: drnic
run_before: [git]