Class: Omen::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Omen::Generators::InstallGenerator
- Includes:
- ActiveRecord::Generators::Migration
- Defined in:
- lib/generators/omen/install/install_generator.rb
Overview
Everything installing this gem writes into a host: three migrations and one initializer. Not the roles or the database function, which are a rake task, because a copy of those would drift from what the gem goes on to expect and nothing would detect it.
Class Method Summary collapse
-
.source_paths ⇒ Array<String>
Both, since the migrations are shipped where they run from rather than as templates.
Instance Method Summary collapse
- #copy_initializer ⇒ void
-
#copy_migrations ⇒ void
Copied rather than read off the gem, so the host owns the files and their timestamps.
Class Method Details
Instance Method Details
#copy_initializer ⇒ void
This method returns an undefined value.
26 27 28 |
# File 'lib/generators/omen/install/install_generator.rb', line 26 def copy_initializer template 'omen.rb', 'config/initializers/omen.rb' end |
#copy_migrations ⇒ void
This method returns an undefined value.
Copied rather than read off the gem, so the host owns the files and their timestamps.
19 20 21 22 23 |
# File 'lib/generators/omen/install/install_generator.rb', line 19 def copy_migrations Dir.children(Omen::Engine.root.join('db/migrate')).sort.each do |name| migration_template name, "db/migrate/#{name.split('_', 2).last}" end end |