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
|
# File 'lib/clayburn-gen.rb', line 9
def app(name)
generate_path = File.join(Dir.pwd,name)
template_path = File.join(File.dirname(__FILE__),'templates/clayburn-app')
if File.exist?(generate_path)
puts "error: a file or directory called #{name} already exists."
else
::FileUtils.cp_r(template_path, generate_path)
if File.exist?(generate_path)
puts "\nGenerating with clayburn generator:"
puts " [ADDED] clayburn.sh"
puts " [ADDED] 127.0.0.1/js/"
puts " [ADDED] 127.0.0.1/js/bootstrap.js"
puts " [ADDED] 127.0.0.1/js/config.js"
puts " [ADDED] 127.0.0.1/js/controller.js"
puts " [ADDED] 127.0.0.1/js/exception.js"
puts " [ADDED] 127.0.0.1/js/model.js"
puts " [ADDED] 127.0.0.1/web/"
puts " [ADDED] 127.0.0.1/web/public/"
puts " [ADDED] 127.0.0.1/web/public/logo.png"
puts " [ADDED] 127.0.0.1/web/public/master.css"
puts " [ADDED] 127.0.0.1/web/views/"
puts " [ADDED] 127.0.0.1/web/views/home/"
puts " [ADDED] 127.0.0.1/web/views/home/index.html"
puts " [ADDED] 127.0.0.1/web/views/exception/"
puts " [ADDED] 127.0.0.1/web/views/exception/general.html"
puts " [ADDED] 127.0.0.1/web/views/exception/notfound.html"
puts " [ADDED] 127.0.0.1/web/layouts/"
puts " [ADDED] 127.0.0.1/web/layouts/application.html"
end
if `cd #{generate_path}/127.0.0.1 && git init && git add . && git commit -am "initial commit by clayburn generator"`
puts " [GIT] init"
puts " [GIT] add ."
puts " [GIT] commit -m \"initial commit by clayburn generator\""
end
if `cd #{generate_path}/127.0.0.1 && git submodule add git://github.com/silentrob/clayburn.git js/clayburn && git add . && git commit -am "added clayburn as a git submodule"`
puts " [GIT] submodule add git://github.com/silentrob/clayburn.git js/clayburn"
puts " [GIT] add ."
puts " [GIT] commit -m \"added clayburn as a git submodule\""
end
end
end
|