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
|
# File 'lib/bones/initializer.rb', line 20
def self.run(root=nil)
Bones.root = root
puts "** Initializing"
puts "** Directory: #{Bones.root}"
ensure_directory(Bones.root / 'public' / 'javascripts')
ensure_directory(Bones.root / 'public' / 'stylesheets')
pages_new = ensure_directory(Bones.root / 'pages')
ensure_directory(Bones.root / 'layouts')
ensure_directory(Bones.root / 'helpers')
ensure_directory(Bones.root / 'tmp')
if pages_new
ensure_file(Bones.root / 'pages' / 'index.html.erb') do |f|
f.write File.read(Bones.system_path / 'pages' / 'intro.html.erb')
end
end
ensure_file(Bones.root / 'layouts' / 'application.html.erb') do |f|
f.write File.read(Bones.system_path / 'layouts' / 'application.html.erb')
end
ensure_file(Bones.root / 'public' / 'stylesheets' / 'styles.css')
ensure_file(Bones.root / 'helpers' / 'application_helper.rb') do |f|
f.write File.read(Bones.system_path / 'helpers' / 'application_helper.rb')
end
ensure_file(Bones.root / 'Rakefile') do |f|
f.write File.read(Bones.system_path / '../pushables/Rakefile')
end
ensure_file(Bones.root / 'boot.rb') do |f|
f.write File.read(Bones.system_path / '../pushables/boot.rb')
end
ensure_file(Bones.root / 'config.ru') do |f|
f.write File.read(Bones.system_path / '../pushables/config.ru')
end
end
|