require 'rails/generators' module Breezeblocks class ListGenerator < Rails::Generators::Base desc 'List breezeblocks' def list puts 'Available Breezeblocks' puts '=================' stylesheets.each do |file_name| puts '- ' + file_name.gsub(/_|\.sass/, '') end end private def stylesheets breezeblocks_dir = File.expand_path('../../../source/stylesheets/breezeblocks', __FILE__) stylesheets = Dir.entries(breezeblocks_dir) stylesheets.reject {|f| f == '.' || f == '..' } end end end