1
0
Fork 0

Initializer generator

This commit is contained in:
Gregory Eremin 2013-06-07 11:09:37 +04:00
parent af16ec0982
commit 908d8492f7
6 changed files with 17 additions and 16 deletions

View File

@ -1,12 +1,6 @@
require 'burden'
Burden.configure do |c| Burden.configure do |c|
c.storage = :active_record c.storage = :active_record
c.ignored_tasks = [ c.ignored_tasks = [/environment/]
/environment/,
/^db:/,
/^assets:/,
/^doc:/,
/^tmp:/,
/^time:/,
/^rails:/
]
end end

View File

@ -8,8 +8,6 @@ require 'burden/storage'
require 'burden/version' require 'burden/version'
require 'burden/wrapper' require 'burden/wrapper'
# require 'generators/burden/install_generator'
module Burden module Burden
include Config::Helper include Config::Helper

View File

@ -1,8 +1,9 @@
Description: Description:
Explain the generator Generates Burden migration and initializer
Example: Example:
rails generate install Thing rails generate burden:install
This will create: This will create:
what/will/it/create config/initializers/burden.rb
db/migrate/create_burden_runs.rb

View File

@ -9,11 +9,15 @@ module Burden
source_root File.expand_path('../templates', __FILE__) source_root File.expand_path('../templates', __FILE__)
def self.next_migration_number(path) def self.next_migration_number(path)
Time.now.utc.strftime("%Y%m%d%H%M%S") Time.now.utc.strftime('%Y%m%d%H%M%S')
end end
def create_migration def create_migration
migration_template 'create_burden_runs.rb', 'db/migrate/create_burden_runs.rb' migration_template 'burden_runs_migration.rb', 'db/migrate/create_burden_runs.rb'
end
def create_initializer
template 'burden_initializer.rb', 'config/initializers/burden.rb'
end end
end end
end end

View File

@ -0,0 +1,4 @@
Burden.configure do |c|
c.storage = :active_record
c.ignored_tasks = [/environment/]
end