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
|
# File 'lib/blacksmith/application.rb', line 13
def build
files = Blacksmith.config.build_files
files.each do |f|
output = Preprocessor.proccess(f)
if Blacksmith.config.jshint
puts Jshintrb.report(["#{Blacksmith.config.source_folder}/#{f}.js"]) end
if Blacksmith.config.env == :production
output = Uglifier.compile(output)
end
output_file = File.new(output_filename_helper(f), 'w')
output_file.write(output)
if Blacksmith.config.gzip
output_file_gzip = File.new(output_filename_helper(f, :gzip => true), 'w')
output_file_gzip.write(output.gzip)
end
end
puts 'Build successfully.'
end
|