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
|
# File 'lib/generators/mugen/mugen_generator.rb', line 4
def install
%W(
app/controllers/mygengo
app/views/mygengo/account
app/views/mygengo/comments
app/views/mygengo/jobs
public/stylesheets/mygengo
public/images/mygengo
).each {|dir|
directory dir
}
%W(
config/initializers/mugen.rb
app/helpers/mugen_helper.rb
app/views/layouts/mygengo.html.erb
).each do |filename|
copy_file filename, filename
end
sentinel = '::Application.routes.draw do'
new_routes = IO.read(File.dirname(__FILE__) + '/templates/config/routes3.rb')
gsub_file 'config/routes3.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
"#{match}\n #{new_routes}"
end
puts MugenGenerator.description
end
|