require 'rails/generators/named_base' module Ixtlan class ConfigurationGenerator < Rails::Generators::Base source_root File.expand_path('../../templates', __FILE__) argument :name, :type => :string, :required => false def create args = [] if name args << ARGV.shift else args << "configuration" end if defined? Ixtlan::Errors args << "errors_dir:string" args << "errors_from:string" args << "errors_to:string" end if defined? Ixtlan::Sessions args << "idle_session_timeout:integer" end if defined? Ixtlan::Audit args << "audit_keep_log:integer" end args += ARGV[0, 10000] || [] generate "scaffold", *args log "\n" log "please make sure '#{args[0]}' becomes a singleton resource" log "\n" end end end