require 'rails/generators/base' require 'sugar-high/array' require 'active_support/inflector' require 'rails_artifactor' module CanTango module Generators class LicensesGenerator < Rails::Generators::Base desc "Creates Licenses for use with CanCan Permits" argument :licenses, :type => :array, :default => [], :desc => "Licenses" source_root File.dirname(__FILE__) + '/../license/templates' def main_flow licenses.each do |license| template_license(license) end end protected attr_accessor :license_name def template_license name self.license_name = name template "license.erb", "app/licenses/#{name}_license.rb" end end end end