ixtlan-generators 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/features/audit.feature +6 -0
- data/features/error-handler.feature +6 -0
- data/features/generators.feature +1 -1
- data/lib/generators/ixtlan/audit_base.rb +23 -0
- data/lib/generators/ixtlan/audit_base.rb~ +23 -0
- data/lib/generators/ixtlan/audit_scaffold/audit_scaffold_generator.rb +14 -0
- data/lib/generators/ixtlan/audit_scaffold/audit_scaffold_generator.rb~ +14 -0
- data/lib/generators/ixtlan/audit_scaffold/error_dumps_scaffold_generator.rb~ +12 -0
- data/lib/generators/ixtlan/autit_base.rb~ +23 -0
- data/lib/generators/ixtlan/base.rb +9 -26
- data/lib/generators/ixtlan/configuration_base.rb +37 -0
- data/lib/generators/ixtlan/configuration_base.rb~ +35 -34
- data/lib/generators/ixtlan/configuration_model/configuration_model_generator.rb +4 -2
- data/lib/generators/ixtlan/configuration_scaffold/configuration_scaffold_generator.rb +4 -2
- data/lib/generators/ixtlan/error_base.rb~ +45 -0
- data/lib/generators/ixtlan/error_dumps_base.rb +23 -0
- data/lib/generators/ixtlan/error_dumps_base.rb~ +23 -0
- data/lib/generators/ixtlan/error_dumps_scaffold/error_dumps_scaffold_generator.rb +14 -0
- data/lib/generators/ixtlan/error_dumps_scaffold/error_dumps_scaffold_generator.rb~ +12 -0
- data/lib/generators/ixtlan/setup/setup_generator.rb +9 -5
- data/lib/generators/ixtlan/setup/templates/application_layout.html.erb +1 -1
- data/lib/generators/ixtlan/setup/templates/dynamic.rb~ +64 -0
- data/lib/generators/ixtlan/setup/templates/gitignore +1 -1
- data/lib/generators/ixtlan/setup/templates/{production.yml.example → passwords.yml.example} +0 -0
- data/lib/generators/ixtlan/setup/templates/preinitializer.rb +1 -1
- data/lib/generators/ixtlan/templates/dynamic.rb +37 -0
- data/lib/generators/ixtlan/templates/dynamic.rb~ +37 -0
- data/lib/generators/rails/scaffold_controller/scaffold_controller/singleton_controller.rb +1 -1
- metadata +41 -11
@@ -0,0 +1,6 @@
|
|
1
|
+
Feature: Generators for Ixtlan Audit
|
2
|
+
|
3
|
+
Scenario: a rails application which uses ixtlan-audit gem
|
4
|
+
Given I create new rails application with template "audit.template" and "audit" files
|
5
|
+
And I execute "rake audit"
|
6
|
+
Then the output should contain "Ixtlan::Audit::Manager"
|
@@ -0,0 +1,6 @@
|
|
1
|
+
Feature: Generators for Ixtlan Error Handler
|
2
|
+
|
3
|
+
Scenario: a rails application which uses ixtlan-error-handler gem
|
4
|
+
Given I create new rails application with template "error-handler.template" and "error-handler" files
|
5
|
+
And I execute "rake error_handler"
|
6
|
+
Then the output should contain "Ixtlan::Errors::ErrorDumper"
|
data/features/generators.feature
CHANGED
@@ -3,4 +3,4 @@ Feature: Generators for Ixtlan
|
|
3
3
|
Scenario: Create a rails application and adding 'ixtlan-generators' gem will provide the ixtlan generators
|
4
4
|
Given I create new rails application with template "generators.template"
|
5
5
|
And I execute "rails generate"
|
6
|
-
Then the output should contain "ixtlan:setup" and "ixtlan:configuration_model" and "ixtlan:configuration_scaffold"
|
6
|
+
Then the output should contain "ixtlan:setup" and "ixtlan:configuration_model" and "ixtlan:configuration_scaffold" and "ixtlan:audit_scaffold" and "ixtlan:error_dumps_scaffold"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'generators/ixtlan/base'
|
2
|
+
module Ixtlan
|
3
|
+
module Generators
|
4
|
+
class AuditBase < Base
|
5
|
+
|
6
|
+
def create
|
7
|
+
args = []
|
8
|
+
if name
|
9
|
+
args << ARGV.shift
|
10
|
+
else
|
11
|
+
args << "audit"
|
12
|
+
end
|
13
|
+
|
14
|
+
args << 'login:string message:string'
|
15
|
+
args += ARGV
|
16
|
+
|
17
|
+
args << "--read-only --timestamps"
|
18
|
+
|
19
|
+
generate generator_name, *args
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rails/generators/named_base'
|
2
|
+
module Ixtlan
|
3
|
+
module Generators
|
4
|
+
class AuditBase < Base
|
5
|
+
|
6
|
+
def create
|
7
|
+
args = []
|
8
|
+
if name
|
9
|
+
args << ARGV.shift
|
10
|
+
else
|
11
|
+
args << "error"
|
12
|
+
end
|
13
|
+
|
14
|
+
args << 'message:string request:text response:text session:text parameters:text clazz:string backtrace:text'
|
15
|
+
args += ARGV[0, 10000] || []
|
16
|
+
|
17
|
+
args << "--read-only --timestamps"
|
18
|
+
|
19
|
+
generate generator_name, *args
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'generators/ixtlan/audit_base'
|
2
|
+
module Ixtlan
|
3
|
+
module Generators
|
4
|
+
class AuditScaffoldGenerator < AuditBase
|
5
|
+
|
6
|
+
source_root File.expand_path('../../templates', __FILE__)
|
7
|
+
|
8
|
+
protected
|
9
|
+
def generator_name
|
10
|
+
"scaffold"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'generators/ixtlan/error_dumps_base'
|
2
|
+
module Ixtlan
|
3
|
+
module Generators
|
4
|
+
class ErrorDumpsScaffoldGenerator < ErrorDumpsBase
|
5
|
+
|
6
|
+
source_root File.expand_path('../../templates', __FILE__)
|
7
|
+
|
8
|
+
protected
|
9
|
+
def generator_name
|
10
|
+
"scaffold"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rails/generators/named_base'
|
2
|
+
module Ixtlan
|
3
|
+
module Generators
|
4
|
+
class ErrorDumpsBase < Base
|
5
|
+
|
6
|
+
def create
|
7
|
+
args = []
|
8
|
+
if name
|
9
|
+
args << ARGV.shift
|
10
|
+
else
|
11
|
+
args << "error"
|
12
|
+
end
|
13
|
+
|
14
|
+
args << 'message:string request:text response:text session:text parameters:text clazz:string backtrace:text'
|
15
|
+
args += ARGV[0, 10000] || []
|
16
|
+
|
17
|
+
args << "--read-only --timestamps"
|
18
|
+
|
19
|
+
generate generator_name, *args
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -5,40 +5,23 @@ module Ixtlan
|
|
5
5
|
|
6
6
|
argument :name, :type => :string, :required => false
|
7
7
|
|
8
|
+
class_option :dynamic, :type => :boolean, :default => true
|
9
|
+
|
8
10
|
protected
|
9
11
|
def generator_name
|
10
12
|
raise "please overwrite generator_name"
|
11
13
|
end
|
12
14
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
if name
|
17
|
-
args << ARGV.shift
|
18
|
-
else
|
19
|
-
args << "configuration"
|
20
|
-
end
|
21
|
-
|
22
|
-
if defined? ::Ixtlan::Errors
|
23
|
-
args << "errors_keep_dump:integer"
|
24
|
-
args << "errors_dir:string"
|
25
|
-
args << "errors_from:string"
|
26
|
-
args << "errors_to:string"
|
27
|
-
end
|
15
|
+
def application_name
|
16
|
+
@application_name ||= Rails.application.class.to_s.gsub(/::/,'').sub(/Application$/, '')
|
17
|
+
end
|
28
18
|
|
29
|
-
|
30
|
-
args << "idle_session_timeout:integer"
|
31
|
-
end
|
19
|
+
public
|
32
20
|
|
33
|
-
|
34
|
-
|
21
|
+
def create_initializer_file
|
22
|
+
if options[:dynamic]
|
23
|
+
template 'dynamic.rb', File.join('config', "initializers", "ixtlan.rb")
|
35
24
|
end
|
36
|
-
|
37
|
-
args += ARGV[0, 10000] || []
|
38
|
-
|
39
|
-
args << "--singleton"
|
40
|
-
|
41
|
-
generate generator_name, *args
|
42
25
|
end
|
43
26
|
end
|
44
27
|
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require 'generators/ixtlan/base'
|
2
|
+
module Ixtlan
|
3
|
+
module Generators
|
4
|
+
class ConfigurationBase < Base
|
5
|
+
|
6
|
+
def create
|
7
|
+
args = []
|
8
|
+
if name
|
9
|
+
args << ARGV.shift
|
10
|
+
else
|
11
|
+
args << "configuration"
|
12
|
+
end
|
13
|
+
|
14
|
+
if defined? ::Ixtlan::Errors
|
15
|
+
args << "errors_keep_dumps:integer"
|
16
|
+
args << "errors_base_url:string"
|
17
|
+
args << "errors_from_email:string"
|
18
|
+
args << "errors_to_emails:string"
|
19
|
+
end
|
20
|
+
|
21
|
+
if defined? ::Ixtlan::Sessions
|
22
|
+
args << "idle_session_timeout:integer"
|
23
|
+
end
|
24
|
+
|
25
|
+
if defined? ::Ixtlan::Audit
|
26
|
+
args << "audits_keep_logs:integer"
|
27
|
+
end
|
28
|
+
|
29
|
+
args += ARGV
|
30
|
+
|
31
|
+
args << "--singleton --timestamps"
|
32
|
+
|
33
|
+
generate generator_name, *args
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -1,44 +1,45 @@
|
|
1
1
|
require 'rails/generators/named_base'
|
2
2
|
module Ixtlan
|
3
|
-
|
3
|
+
module Generators
|
4
|
+
class ConfigurationBase < Rails::Generators::Base
|
4
5
|
|
5
|
-
|
6
|
+
argument :name, :type => :string, :required => false
|
6
7
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
11
|
-
|
12
|
-
public
|
13
|
-
def create
|
14
|
-
args = []
|
15
|
-
if name
|
16
|
-
args << ARGV.shift
|
17
|
-
else
|
18
|
-
args << "configuration"
|
8
|
+
protected
|
9
|
+
def generator_name
|
10
|
+
raise "please overwrite generator_name"
|
19
11
|
end
|
20
12
|
|
21
|
-
|
22
|
-
|
23
|
-
args
|
24
|
-
|
13
|
+
public
|
14
|
+
def create
|
15
|
+
args = []
|
16
|
+
if name
|
17
|
+
args << ARGV.shift
|
18
|
+
else
|
19
|
+
args << "configuration"
|
20
|
+
end
|
21
|
+
|
22
|
+
if defined? ::Ixtlan::Errors
|
23
|
+
args << "errors_keep_dumps:integer"
|
24
|
+
args << "errors_base_url:string"
|
25
|
+
args << "errors_from_email:string"
|
26
|
+
args << "errors_to_emails:string"
|
27
|
+
end
|
28
|
+
|
29
|
+
if defined? ::Ixtlan::Sessions
|
30
|
+
args << "idle_session_timeout:integer"
|
31
|
+
end
|
32
|
+
|
33
|
+
if defined? ::Ixtlan::Audit
|
34
|
+
args << "audit_keep_logs:integer"
|
35
|
+
end
|
36
|
+
|
37
|
+
args += ARGV[0, 10000] || []
|
38
|
+
|
39
|
+
args << "--singleton"
|
40
|
+
|
41
|
+
generate generator_name, *args
|
25
42
|
end
|
26
|
-
|
27
|
-
if defined? ::Ixtlan::Sessions
|
28
|
-
args << "idle_session_timeout:integer"
|
29
|
-
end
|
30
|
-
|
31
|
-
if defined? ::Ixtlan::Audit
|
32
|
-
args << "audit_keep_log:integer"
|
33
|
-
end
|
34
|
-
|
35
|
-
args += ARGV[0, 10000] || []
|
36
|
-
|
37
|
-
generate generator_name, *args
|
38
|
-
|
39
|
-
log "\n"
|
40
|
-
log "please make sure '#{args[0]}' becomes a singleton resource"
|
41
|
-
log "\n"
|
42
43
|
end
|
43
44
|
end
|
44
45
|
end
|
@@ -1,8 +1,10 @@
|
|
1
|
-
require 'generators/ixtlan/
|
1
|
+
require 'generators/ixtlan/configuration_base'
|
2
2
|
module Ixtlan
|
3
3
|
module Generators
|
4
|
-
class ConfigurationModelGenerator <
|
4
|
+
class ConfigurationModelGenerator < ConfigurationBase
|
5
5
|
|
6
|
+
source_root File.expand_path('../../templates', __FILE__)
|
7
|
+
|
6
8
|
protected
|
7
9
|
def generator_name
|
8
10
|
"model"
|
@@ -1,7 +1,9 @@
|
|
1
|
-
require 'generators/ixtlan/
|
1
|
+
require 'generators/ixtlan/configuration_base'
|
2
2
|
module Ixtlan
|
3
3
|
module Generators
|
4
|
-
class ConfigurationScaffoldGenerator <
|
4
|
+
class ConfigurationScaffoldGenerator < ConfigurationBase
|
5
|
+
|
6
|
+
source_root File.expand_path('../../templates', __FILE__)
|
5
7
|
|
6
8
|
protected
|
7
9
|
def generator_name
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require 'rails/generators/named_base'
|
2
|
+
module Ixtlan
|
3
|
+
module Generators
|
4
|
+
class ConfigurationBase < Rails::Generators::Base
|
5
|
+
|
6
|
+
argument :name, :type => :string, :required => false
|
7
|
+
|
8
|
+
protected
|
9
|
+
def generator_name
|
10
|
+
raise "please overwrite generator_name"
|
11
|
+
end
|
12
|
+
|
13
|
+
public
|
14
|
+
def create
|
15
|
+
args = []
|
16
|
+
if name
|
17
|
+
args << ARGV.shift
|
18
|
+
else
|
19
|
+
args << "configuration"
|
20
|
+
end
|
21
|
+
|
22
|
+
if defined? ::Ixtlan::Errors
|
23
|
+
args << "errors_keep_dumps:integer"
|
24
|
+
args << "errors_base_url:string"
|
25
|
+
args << "errors_from:string"
|
26
|
+
args << "errors_to:string"
|
27
|
+
end
|
28
|
+
|
29
|
+
if defined? ::Ixtlan::Sessions
|
30
|
+
args << "idle_session_timeout:integer"
|
31
|
+
end
|
32
|
+
|
33
|
+
if defined? ::Ixtlan::Audit
|
34
|
+
args << "audit_keep_logs:integer"
|
35
|
+
end
|
36
|
+
|
37
|
+
args += ARGV[0, 10000] || []
|
38
|
+
|
39
|
+
args << "--singleton"
|
40
|
+
|
41
|
+
generate generator_name, *args
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'generators/ixtlan/base'
|
2
|
+
module Ixtlan
|
3
|
+
module Generators
|
4
|
+
class ErrorDumpsBase < Base
|
5
|
+
|
6
|
+
def create
|
7
|
+
args = []
|
8
|
+
if name
|
9
|
+
args << ARGV.shift
|
10
|
+
else
|
11
|
+
args << "error"
|
12
|
+
end
|
13
|
+
|
14
|
+
args << 'message:string request:text response:text session:text parameters:text clazz:string backtrace:text'
|
15
|
+
args += ARGV
|
16
|
+
|
17
|
+
args << "--read-only --timestamps"
|
18
|
+
|
19
|
+
generate generator_name, *args
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'rails/generators/named_base'
|
2
|
+
module Ixtlan
|
3
|
+
module Generators
|
4
|
+
class ErrorDumpsBase < Base
|
5
|
+
|
6
|
+
def create
|
7
|
+
args = []
|
8
|
+
if name
|
9
|
+
args << ARGV.shift
|
10
|
+
else
|
11
|
+
args << "error"
|
12
|
+
end
|
13
|
+
|
14
|
+
args << 'message:string request:text response:text session:text parameters:text clazz:string backtrace:text'
|
15
|
+
args += ARGV[0, 10000] || []
|
16
|
+
|
17
|
+
args << "--read-only --timestamps"
|
18
|
+
|
19
|
+
generate generator_name, *args
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require 'generators/ixtlan/error_dumps_base'
|
2
|
+
module Ixtlan
|
3
|
+
module Generators
|
4
|
+
class ErrorDumpsScaffoldGenerator < ErrorDumpsBase
|
5
|
+
|
6
|
+
source_root File.expand_path('../../templates', __FILE__)
|
7
|
+
|
8
|
+
protected
|
9
|
+
def generator_name
|
10
|
+
"scaffold"
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -5,16 +5,20 @@ module Ixtlan
|
|
5
5
|
|
6
6
|
source_root File.expand_path('../templates', __FILE__)
|
7
7
|
|
8
|
+
protected
|
9
|
+
|
10
|
+
def application_name
|
11
|
+
@application_name ||= Rails.application.class.to_s.gsub(/::/,'').sub(/Application$/, '')
|
12
|
+
end
|
13
|
+
|
14
|
+
public
|
15
|
+
|
8
16
|
def create_preinitializer_files
|
9
17
|
template 'preinitializer.rb', File.join('config', "preinitializer.rb")
|
10
18
|
template 'gitignore', File.join('config', ".gitignore")
|
11
|
-
template '
|
19
|
+
template 'passwords.yml.example', File.join('config', "passwords.yml.example")
|
12
20
|
template 'database.yml.example', File.join('config', "database.yml.example")
|
13
21
|
end
|
14
|
-
|
15
|
-
def create_initializer_file
|
16
|
-
template 'initializer.rb', File.join('config', "initializers", "ixtlan.rb")
|
17
|
-
end
|
18
22
|
|
19
23
|
# TODO make only if template-engine is ERB
|
20
24
|
def error_templates
|
@@ -0,0 +1,64 @@
|
|
1
|
+
# dynamic configuration through a Configuration singleton model
|
2
|
+
|
3
|
+
# configuration model
|
4
|
+
# -------------------
|
5
|
+
# CONFIGURATION = Configuration
|
6
|
+
# config.configuration_model = CONFIGURATION
|
7
|
+
begin
|
8
|
+
config_instance = CONFIGURATION.instance
|
9
|
+
rescue
|
10
|
+
# allow rake tasks to work without configuration migrated
|
11
|
+
return
|
12
|
+
end
|
13
|
+
|
14
|
+
# notification email on errors and dump directory for the system dump
|
15
|
+
# the error dumps will be cleanup after the days to keeps dump expired
|
16
|
+
# --------------------------------------------------------------------
|
17
|
+
# config_instance.register("error_dumper") do |config|
|
18
|
+
# Rails.configuration.error_dumper.dump_dir = config.errors_dir
|
19
|
+
# Rails.configuration.error_dumper.email_from = config.errors_from
|
20
|
+
# Rails.configuration.error_dumper.email_to = config.errors_to
|
21
|
+
# Rails.configuration.error_dumper.keep_dumps = config.errors_keep_dump # days
|
22
|
+
# end
|
23
|
+
|
24
|
+
# idle session timeout configuration (in minutes)
|
25
|
+
# -----------------------------------------------
|
26
|
+
# config_instance.register("session_idle_timeout") do |config|
|
27
|
+
# Rails.configuration.session_idle_timeout = config.session_idle_timeout
|
28
|
+
# end
|
29
|
+
|
30
|
+
# audit log manager
|
31
|
+
# -----------------
|
32
|
+
|
33
|
+
# config.audit_manager.model = MyAudit # default: Audit
|
34
|
+
# config.audit_manager.username_method = :username # default: :login
|
35
|
+
|
36
|
+
# config_instance.register("audit_manager") do |config|
|
37
|
+
# Rails.configuration.audit_manager.keep_log = config.keep_log # days
|
38
|
+
# end
|
39
|
+
|
40
|
+
# --------------------
|
41
|
+
# static configuration
|
42
|
+
# --------------------
|
43
|
+
|
44
|
+
# error dumper
|
45
|
+
# ------------
|
46
|
+
# notification email on errors and dump directory for the system dump. per
|
47
|
+
# default there is no email notification and if email_from or email_to is
|
48
|
+
# missing then there is no email too
|
49
|
+
|
50
|
+
# config.error_dumper.dump_dir = Rails.root + "/log/errors" # default: log/errors
|
51
|
+
# config.error_dumper.email_from = "no-reply@example.com"
|
52
|
+
# config.error_dumper.email_to = "developer1@example.com,developer2@example.com"
|
53
|
+
# config.error_dumper.keep_dumps = 30 # days
|
54
|
+
# config.skip_rescue_module = true # do not include the predefined Rescue
|
55
|
+
|
56
|
+
# idle session timeout configuration
|
57
|
+
# ----------------------------------
|
58
|
+
# config.session_idle_timeout = 30 #minutes
|
59
|
+
|
60
|
+
# audit log manager
|
61
|
+
# -----------------
|
62
|
+
# config.audit_manager.model = MyAudit # default: Audit
|
63
|
+
# config.audit_manager.username_method = :username # default: :login
|
64
|
+
# config.audit_manager.keep_log = 30 # days
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
1
|
+
passwords.yml
|
2
2
|
*.example
|
File without changes
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# dynamic configuration through a Configuration singleton model
|
2
|
+
|
3
|
+
# configuration model
|
4
|
+
# -------------------
|
5
|
+
# <%= application_name %>::Application.config.configuration_model = :my_configuration # default :configuration
|
6
|
+
<% if defined? Ixtlan::Errors -%>
|
7
|
+
|
8
|
+
# notification email on errors and dump directory for the system dump
|
9
|
+
# the error dumps will be cleanup after the days to keeps dump expired
|
10
|
+
# --------------------------------------------------------------------
|
11
|
+
<%= application_name %>::Application.config.configuration_manager.register("error_dumper") do |config|
|
12
|
+
<%= application_name %>::Application.config.error_dumper.base_url = config.errors_base_url
|
13
|
+
<%= application_name %>::Application.config.error_dumper.from_email = config.errors_from_email
|
14
|
+
<%= application_name %>::Application.config.error_dumper.to_emails = config.errors_to_emails
|
15
|
+
<%= application_name %>::Application.config.error_dumper.keep_dumps = config.errors_keep_dumps # days
|
16
|
+
end
|
17
|
+
<% end -%>
|
18
|
+
<% if defined? Ixtlan::Sessions -%>
|
19
|
+
|
20
|
+
# idle session timeout configuration (in minutes)
|
21
|
+
# -----------------------------------------------
|
22
|
+
<%= application_name %>::Application.config.configuration_manager.register("session_idle_timeout") do |config|
|
23
|
+
<%= application_name %>::Application.config.idle_session_timeout = config.idle_session_timeout
|
24
|
+
end
|
25
|
+
<% end -%>
|
26
|
+
<% if defined? Ixtlan::Audit -%>
|
27
|
+
|
28
|
+
# audit log manager
|
29
|
+
# -----------------
|
30
|
+
|
31
|
+
# <%= application_name %>::Application.config.audit_manager.model = :my_audit # default: :audit
|
32
|
+
# <%= application_name %>::Application.config.audit_manager.username_method = :username # default: :login
|
33
|
+
|
34
|
+
<%= application_name %>::Application.config.configuration_manager.register("audit_manager") do |config|
|
35
|
+
<%= application_name %>::Application.config.audit_manager.keep_logs = config.audits_keep_logs # days
|
36
|
+
end
|
37
|
+
<% end -%>
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# dynamic configuration through a Configuration singleton model
|
2
|
+
|
3
|
+
# configuration model
|
4
|
+
# -------------------
|
5
|
+
# <%= application_name %>::Application.config.configuration_model = :my_configuration # default :configuration
|
6
|
+
<% if defined? Ixtlan::Errors -%>
|
7
|
+
|
8
|
+
# notification email on errors and dump directory for the system dump
|
9
|
+
# the error dumps will be cleanup after the days to keeps dump expired
|
10
|
+
# --------------------------------------------------------------------
|
11
|
+
<%= application_name %>::Application.config.configuration_manager.register("error_dumper") do |config|
|
12
|
+
<%= application_name %>::Application.config.error_dumper.dump_dir = config.errors_dir
|
13
|
+
<%= application_name %>::Application.config.error_dumper.email_from = config.errors_from
|
14
|
+
<%= application_name %>::Application.config.error_dumper.email_to = config.errors_to
|
15
|
+
<%= application_name %>::Application.config.error_dumper.keep_dumps = config.errors_keep_dump # days
|
16
|
+
end
|
17
|
+
<% end -%>
|
18
|
+
<% if defined? Ixtlan::Sessions -%>
|
19
|
+
|
20
|
+
# idle session timeout configuration (in minutes)
|
21
|
+
# -----------------------------------------------
|
22
|
+
<%= application_name %>::Application.config.configuration_manager.register("session_idle_timeout") do |config|
|
23
|
+
<%= application_name %>::Application.config.session_idle_timeout = config.session_idle_timeout
|
24
|
+
end
|
25
|
+
<% end -%>
|
26
|
+
<% if defined? Ixtlan::Audit -%>
|
27
|
+
|
28
|
+
# audit log manager
|
29
|
+
# -----------------
|
30
|
+
|
31
|
+
# <%= application_name %>::Application.config.audit_manager.model = :my_audit # default: :audit
|
32
|
+
# <%= application_name %>::Application.config.audit_manager.username_method = :username # default: :login
|
33
|
+
|
34
|
+
<%= application_name %>::Application.config.configuration_manager.register("audit_manager") do |config|
|
35
|
+
<%= application_name %>::Application.config.audit_manager.keep_log = config.keep_log # days
|
36
|
+
end
|
37
|
+
<% end -%>
|
@@ -15,7 +15,7 @@ class <%= controller_class_name %>Controller < ApplicationController
|
|
15
15
|
|
16
16
|
def stale?
|
17
17
|
if @<%= singular_table_name %>.nil?
|
18
|
-
@<%= singular_table_name %> = <%=
|
18
|
+
@<%= singular_table_name %> = <%= class_name %>.instance
|
19
19
|
respond_to do |format|
|
20
20
|
format.html { render :action => "edit" }
|
21
21
|
format.xml { render :xml => nil, :status => :conflict }
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: ixtlan-generators
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.3
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- mkristian
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-
|
13
|
+
date: 2011-11-04 00:00:00 +05:30
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -25,49 +25,60 @@ dependencies:
|
|
25
25
|
type: :development
|
26
26
|
version_requirements: *id001
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: ixtlan-audit
|
29
29
|
prerelease: false
|
30
30
|
requirement: &id002 !ruby/object:Gem::Requirement
|
31
|
+
none: false
|
32
|
+
requirements:
|
33
|
+
- - ~>
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: 0.2.0
|
36
|
+
type: :development
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
39
|
+
name: rails
|
40
|
+
prerelease: false
|
41
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
31
42
|
none: false
|
32
43
|
requirements:
|
33
44
|
- - "="
|
34
45
|
- !ruby/object:Gem::Version
|
35
46
|
version: 3.0.9
|
36
47
|
type: :development
|
37
|
-
version_requirements: *
|
48
|
+
version_requirements: *id003
|
38
49
|
- !ruby/object:Gem::Dependency
|
39
50
|
name: rspec
|
40
51
|
prerelease: false
|
41
|
-
requirement: &
|
52
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
42
53
|
none: false
|
43
54
|
requirements:
|
44
55
|
- - "="
|
45
56
|
- !ruby/object:Gem::Version
|
46
57
|
version: 2.6.0
|
47
58
|
type: :development
|
48
|
-
version_requirements: *
|
59
|
+
version_requirements: *id004
|
49
60
|
- !ruby/object:Gem::Dependency
|
50
61
|
name: cucumber
|
51
62
|
prerelease: false
|
52
|
-
requirement: &
|
63
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
53
64
|
none: false
|
54
65
|
requirements:
|
55
66
|
- - "="
|
56
67
|
- !ruby/object:Gem::Version
|
57
68
|
version: 0.9.4
|
58
69
|
type: :development
|
59
|
-
version_requirements: *
|
70
|
+
version_requirements: *id005
|
60
71
|
- !ruby/object:Gem::Dependency
|
61
72
|
name: ruby-maven
|
62
73
|
prerelease: false
|
63
|
-
requirement: &
|
74
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
64
75
|
none: false
|
65
76
|
requirements:
|
66
77
|
- - "="
|
67
78
|
- !ruby/object:Gem::Version
|
68
79
|
version: 3.0.3.0.28.5
|
69
80
|
type: :development
|
70
|
-
version_requirements: *
|
81
|
+
version_requirements: *id006
|
71
82
|
description: rails generator templates for ixtlan gems
|
72
83
|
email:
|
73
84
|
- m.kristian@web.de
|
@@ -111,20 +122,31 @@ files:
|
|
111
122
|
- lib/generators/rails/active_record/model/model.rb~
|
112
123
|
- lib/generators/ixtlan/base.rb
|
113
124
|
- lib/generators/ixtlan/configuration_base.rb~
|
125
|
+
- lib/generators/ixtlan/audit_base.rb
|
126
|
+
- lib/generators/ixtlan/error_dumps_base.rb~
|
127
|
+
- lib/generators/ixtlan/audit_base.rb~
|
128
|
+
- lib/generators/ixtlan/configuration_base.rb
|
129
|
+
- lib/generators/ixtlan/error_base.rb~
|
130
|
+
- lib/generators/ixtlan/autit_base.rb~
|
114
131
|
- lib/generators/ixtlan/base_configuration.rb~
|
115
132
|
- lib/generators/ixtlan/base.rb~
|
133
|
+
- lib/generators/ixtlan/error_dumps_base.rb
|
116
134
|
- lib/generators/ixtlan/configuration_scaffold/configuration_scaffold_generator.rb~
|
117
135
|
- lib/generators/ixtlan/configuration_scaffold/setup_controller.rb~
|
118
136
|
- lib/generators/ixtlan/configuration_scaffold/setup_generator.rb~
|
119
137
|
- lib/generators/ixtlan/configuration_scaffold/configuration_generator.rb~
|
120
138
|
- lib/generators/ixtlan/configuration_scaffold/configuration_model_generator.rb~
|
121
139
|
- lib/generators/ixtlan/configuration_scaffold/configuration_scaffold_generator.rb
|
140
|
+
- lib/generators/ixtlan/audit_scaffold/audit_scaffold_generator.rb
|
141
|
+
- lib/generators/ixtlan/audit_scaffold/audit_scaffold_generator.rb~
|
142
|
+
- lib/generators/ixtlan/audit_scaffold/error_dumps_scaffold_generator.rb~
|
122
143
|
- lib/generators/ixtlan/setup/setup_controller.rb~
|
123
144
|
- lib/generators/ixtlan/setup/setup_generator.rb~
|
124
145
|
- lib/generators/ixtlan/setup/setup_generator.rb
|
125
146
|
- lib/generators/ixtlan/setup/templates/error.html.erb~
|
126
147
|
- lib/generators/ixtlan/setup/templates/database.yml.example
|
127
148
|
- lib/generators/ixtlan/setup/templates/error_with_session.html.erb
|
149
|
+
- lib/generators/ixtlan/setup/templates/dynamic.rb~
|
128
150
|
- lib/generators/ixtlan/setup/templates/error.html.erb
|
129
151
|
- lib/generators/ixtlan/setup/templates/error_with_session.html.erb~
|
130
152
|
- lib/generators/ixtlan/setup/templates/application_layout.html.erb
|
@@ -132,17 +154,23 @@ files:
|
|
132
154
|
- lib/generators/ixtlan/setup/templates/initializer.rb
|
133
155
|
- lib/generators/ixtlan/setup/templates/gitignore
|
134
156
|
- lib/generators/ixtlan/setup/templates/initializer.rb~
|
157
|
+
- lib/generators/ixtlan/setup/templates/passwords.yml.example
|
135
158
|
- lib/generators/ixtlan/setup/templates/stale.html.erb
|
136
|
-
- lib/generators/ixtlan/setup/templates/production.yml.example
|
137
159
|
- lib/generators/ixtlan/configuration_model/configuration_model_generator.rb
|
138
160
|
- lib/generators/ixtlan/configuration_model/setup_controller.rb~
|
139
161
|
- lib/generators/ixtlan/configuration_model/setup_generator.rb~
|
140
162
|
- lib/generators/ixtlan/configuration_model/configuration_generator.rb~
|
141
163
|
- lib/generators/ixtlan/configuration_model/configuration_model_generator.rb~
|
164
|
+
- lib/generators/ixtlan/error_dumps_scaffold/error_dumps_scaffold_generator.rb
|
165
|
+
- lib/generators/ixtlan/error_dumps_scaffold/error_dumps_scaffold_generator.rb~
|
166
|
+
- lib/generators/ixtlan/templates/dynamic.rb~
|
167
|
+
- lib/generators/ixtlan/templates/dynamic.rb
|
142
168
|
- lib/ixtlan/railtie.rb~
|
143
169
|
- lib/ixtlan/railtie.rb
|
144
170
|
- features/step_definitions/simple_steps.rb
|
171
|
+
- features/audit.feature
|
145
172
|
- features/generators.feature
|
173
|
+
- features/error-handler.feature
|
146
174
|
has_rdoc: true
|
147
175
|
homepage: http://github.com/mkristian/ixtlan-generators
|
148
176
|
licenses:
|
@@ -172,5 +200,7 @@ signing_key:
|
|
172
200
|
specification_version: 3
|
173
201
|
summary: rails generator templates for ixtlan gems
|
174
202
|
test_files:
|
203
|
+
- features/audit.feature
|
175
204
|
- features/generators.feature
|
205
|
+
- features/error-handler.feature
|
176
206
|
- features/step_definitions/simple_steps.rb
|