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



1217
1218
1219
1220
# File 'lib/jekyll-minifier.rb', line 1217

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

#write(dest) ⇒ Object



1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
# File 'lib/jekyll-minifier.rb', line 1222

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