module Octopress::AutoPrefixer

Public Class Methods

find_stylesheets(dir) click to toggle source
# File lib/octopress-autoprefixer.rb, line 12
def self.find_stylesheets(dir)
  return [] unless Dir.exist? dir
  Find.find(dir).to_a.reject {|f| File.extname(f) != '.css' }
end
prefix(stylesheet, options) click to toggle source
# File lib/octopress-autoprefixer.rb, line 23
def self.prefix(stylesheet, options)
  content = File.open(stylesheet).read
  File.open(stylesheet, 'w') do |f|
    f.write(AutoprefixerRails.process(content, options))
  end
end
process(site) click to toggle source
# File lib/octopress-autoprefixer.rb, line 17
def self.process(site)
  find_stylesheets(site.config['destination']).each do |file|
    prefix(file, site.config['autoprefixer'] || {})
  end
end