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
66
67
68
69
70
71
72
73
74
75
76
|
# File 'lib/awestruct/cli/init.rb', line 28
def run()
manifest = Manifest.new(BASE_MANIFEST)
scaffold_name = @framework
manifest.template_file('Gemfile', Init.framework_path('base_Gemfile'), {:framework => @framework})
lib = nil
case @framework
when 'bootstrap'
lib = 'bootstrap-sass'
when 'foundation'
lib = 'zurb-foundation'
end
unless lib.nil?
require 'sass/callbacks'
require 'compass'
require 'compass/commands'
require lib
manifest.install_compass(@framework, lib)
end
if (@scaffold)
manifest.copy_file('_config/site.yml', framework_path('base_site.yml'), :overwrite => true)
manifest.copy_file('_layouts/base.html.haml', framework_path('base_layout.html.haml', scaffold_name))
base_index = framework_path('base_index.html.haml', scaffold_name)
if File.file? base_index
manifest.copy_file('index.html.haml', base_index)
else
manifest.copy_file('index.html.haml', framework_path('base_index.html.haml'))
end
humans_txt = framework_path('humans.txt')
if File.file? humans_txt
manifest.copy_file('humans.txt', humans_txt, :overwrite => true)
end
manifest.touch_file('_config/site.yml')
manifest.add_requires('_ext/pipeline.rb', [lib]) unless lib.nil?
if scaffold_name == 'foundation'
manifest.remove_file('index.html')
manifest.remove_file('MIT-LICENSE.txt')
end
end
begin
manifest.perform(@dir)
rescue => e
puts e.backtrace
puts e.message
puts manifest.steps
end
end
|