Initializer generator
This commit is contained in:
parent
af16ec0982
commit
908d8492f7
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Burden.configure do |c|
|
||||||
|
c.storage = :active_record
|
||||||
|
c.ignored_tasks = [/environment/]
|
||||||
|
end
|
Loading…
Reference in New Issue