Class: Mkconfig::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Mkconfig::Generators::InstallGenerator
- Defined in:
- lib/generators/mkconfig/install_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
7 8 9 |
# File 'lib/generators/mkconfig/install_generator.rb', line 7 def self.source_root File.("../templates", __FILE__) end |
Instance Method Details
#create_migrations ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/generators/mkconfig/install_generator.rb', line 11 def create_migrations Dir["#{self.class.source_root}/migrations/*.rb"].sort.each do |filepath| name = File.basename(filepath) new_name = Time.now.to_i.to_s + "_" + File.basename(filepath).to_s template "migrations/#{name}", "db/migrate/#{new_name}" sleep 1 end end |