lib/generators/ixtlan/configuration_base.rb~ in ixtlan-generators-0.1.2 vs lib/generators/ixtlan/configuration_base.rb~ in ixtlan-generators-0.1.3
- old
+ new
@@ -1,44 +1,45 @@
require 'rails/generators/named_base'
module Ixtlan
- class ConfigurationBase < Rails::Generators::Base
+ module Generators
+ class ConfigurationBase < Rails::Generators::Base
- argument :name, :type => :string, :required => false
+ argument :name, :type => :string, :required => false
- protected
- def generator_name
- raise "please overwrite generator_name"
- end
-
- public
- def create
- args = []
- if name
- args << ARGV.shift
- else
- args << "configuration"
+ protected
+ def generator_name
+ raise "please overwrite generator_name"
end
- if defined? ::Ixtlan::Errors
- args << "errors_dir:string"
- args << "errors_from:string"
- args << "errors_to:string"
- end
+ public
+ def create
+ args = []
+ if name
+ args << ARGV.shift
+ else
+ args << "configuration"
+ end
- if defined? ::Ixtlan::Sessions
- args << "idle_session_timeout:integer"
- end
+ if defined? ::Ixtlan::Errors
+ args << "errors_keep_dumps:integer"
+ args << "errors_base_url:string"
+ args << "errors_from_email:string"
+ args << "errors_to_emails:string"
+ end
- if defined? ::Ixtlan::Audit
- args << "audit_keep_log:integer"
- end
+ if defined? ::Ixtlan::Sessions
+ args << "idle_session_timeout:integer"
+ end
- args += ARGV[0, 10000] || []
+ if defined? ::Ixtlan::Audit
+ args << "audit_keep_logs:integer"
+ end
+
+ args += ARGV[0, 10000] || []
+
+ args << "--singleton"
- generate generator_name, *args
-
- log "\n"
- log "please make sure '#{args[0]}' becomes a singleton resource"
- log "\n"
+ generate generator_name, *args
+ end
end
end
end