-
Notifications
You must be signed in to change notification settings - Fork 2
/
krails.rb
65 lines (57 loc) · 1.28 KB
/
krails.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
63
64
65
# Basic setup stuff.
application "config.app_name = \"#{ARGV[0]}\""
generate(:controller, 'static index about')
# Do all the file copying.
def source_paths
[File.join(
File.expand_path(File.dirname(__FILE__)), 'krails_root'
)] + Array(super)
end
inside 'config' do
remove_file 'routes.rb'
copy_file 'routes.rb'
end
inside 'lib' do
inside 'assets' do
inside 'stylesheets' do
copy_file 'sticky-footer-navbar.css'
copy_file 'typography.css'
end
end
end
inside 'app' do
inside 'assets' do
inside 'stylesheets' do
remove_file 'application.css'
copy_file 'application.css'
end
end
inside 'helpers' do
remove_file 'application_helper.rb'
copy_file 'application_helper.rb'
end
inside 'views' do
inside 'layouts' do
remove_file 'application.html.erb'
copy_file 'application.html.erb'
end
inside 'shared' do
copy_file '_footer.html.erb'
copy_file '_head.html.erb'
copy_file '_nav.html.erb'
end
inside 'static' do
remove_file 'index.html.erb'
copy_file 'index.html.erb'
remove_file 'about.html.erb'
copy_file 'about.html.erb'
end
end
end
run 'bundle'
# Set up a repository.
after_bundle do
git :init
git add: '-A .'
git commit: '-m "Initial commit."'
end