$LOAD_PATH << File.expand_path(File.dirname(__FILE__) + '../../lib') require 'csses' class CssesGenerator < Rails::Generator::Base attr_reader :css def initialize(*args) super files_to_scan = Dir.glob('app/views/**/*.erb') + Dir.glob('app/helpers/*.rb') @css = CSSes.new(files_to_scan) end def manifest record do |m| m.directory "public/stylesheets" m.template 'application.css.erb', 'public/stylesheets/application.css' end end end