Class: SuperCopyAppGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- SuperCopyAppGenerator
- Defined in:
- lib/super/test_support/generate_copy_app.rb
Instance Method Summary collapse
- #copy_app ⇒ Object
- #copy_config ⇒ Object
- #copy_db ⇒ Object
- #ensure_reasonable_directory ⇒ Object
- #install_super ⇒ Object
- #set_destination_root ⇒ Object
Instance Method Details
#copy_app ⇒ Object
26 27 28 29 |
# File 'lib/super/test_support/generate_copy_app.rb', line 26 def copy_app directory "models", "app/models" directory "controllers", "app/controllers/admin" end |
#copy_config ⇒ Object
36 37 38 |
# File 'lib/super/test_support/generate_copy_app.rb', line 36 def copy_config copy_file "routes.rb", "config/routes.rb" end |
#copy_db ⇒ Object
31 32 33 34 |
# File 'lib/super/test_support/generate_copy_app.rb', line 31 def copy_db directory "migrations", "db/migrate" copy_file "seeds.rb", "db/seeds.rb" end |
#ensure_reasonable_directory ⇒ Object
15 16 17 18 19 20 |
# File 'lib/super/test_support/generate_copy_app.rb', line 15 def ensure_reasonable_directory app_path = File.join(destination_root, "app") if !File.directory?(app_path) raise "Can't find dir: #{app_path}" end end |
#install_super ⇒ Object
22 23 24 |
# File 'lib/super/test_support/generate_copy_app.rb', line 22 def install_super Super::InstallGenerator.start([], destination_root: destination_root) end |
#set_destination_root ⇒ Object
11 12 13 |
# File 'lib/super/test_support/generate_copy_app.rb', line 11 def set_destination_root self.destination_root = [:destination] end |