6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# File 'lib/qbuild/stylesheet_handler.rb', line 6
def self.transpile_and_minify_style
style_formats = ['.css', '.scss']
style_filenames = Qbuild::Config.stylesheet_filenames
min_style_path = Qbuild::Config.minified_stylesheets_path
min_style_file = Qbuild::Config.stylesheet_name
Qbuild::Config.create_target_directory(min_style_path)
content = ''
style_filenames.each do |file|
next unless PadUtils.file_exist?(file)
next unless style_formats.include? File.extname(file)
next if file.include? '.min.css'
content += "\n#{File.read(file)}"
end
minified = scss_to_css content
File.write("#{min_style_path}/#{min_style_file}", minified)
end
|