Class: Jekyll::StaticFile

Inherits:
Object
  • Object
show all
Includes:
Compressor
Defined in:
lib/jekyll-minifier.rb

Instance Method Summary collapse

Methods included from Compressor

#output_compressed, #output_css, #output_css_or_file, #output_file, #output_html, #output_js, #output_js_or_file, #output_json

Instance Method Details

#copy_file(path, dest_path) ⇒ Object



1135
1136
1137
1138
# File 'lib/jekyll-minifier.rb', line 1135

def copy_file(path, dest_path)
  FileUtils.mkdir_p(File.dirname(dest_path))
  FileUtils.cp(path, dest_path)
end

#write(dest) ⇒ Object



1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
# File 'lib/jekyll-minifier.rb', line 1140

def write(dest)
  dest_path = destination(dest)

  return false if File.exist?(dest_path) and !modified?
  self.class.mtimes[path] = mtime

  if exclude?(dest, dest_path)
    copy_file(path, dest_path)
  else
    process_static_file(dest_path)
  end
  true
end