Class: MagickPen::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- MagickPen::InstallGenerator
- Defined in:
- lib/generators/magick_pen/install_generator.rb
Instance Method Summary collapse
- #check_paper_trail ⇒ Object
- #copy_config ⇒ Object
- #finished ⇒ Object
- #install_migrations ⇒ Object
- #install_npm ⇒ Object
- #run_migrations ⇒ Object
- #start ⇒ Object
Instance Method Details
#check_paper_trail ⇒ Object
15 16 17 18 19 20 |
# File 'lib/generators/magick_pen/install_generator.rb', line 15 def check_paper_trail puts "Paper Trail Install...." Dir.chdir(Rails.root) do `bundle exec rails generate paper_trail:install` end end |
#copy_config ⇒ Object
29 30 31 32 |
# File 'lib/generators/magick_pen/install_generator.rb', line 29 def copy_config file = File.join(Rails.root,'app','models','magick_pen', 'config.rb') template 'config.rb', file end |
#finished ⇒ Object
45 46 47 48 |
# File 'lib/generators/magick_pen/install_generator.rb', line 45 def finished puts "\n" + ("*" * 80) puts "Done! Magick Pen has been successfully installed." end |
#install_migrations ⇒ Object
22 23 24 25 26 27 |
# File 'lib/generators/magick_pen/install_generator.rb', line 22 def install_migrations puts "Copying over Magick Pen migrations..." Dir.chdir(Rails.root) do `bundle exec rake magick_pen_engine:install:migrations` end end |
#install_npm ⇒ Object
40 41 42 43 |
# File 'lib/generators/magick_pen/install_generator.rb', line 40 def install_npm puts "Running npm install vue_magick_pen" `npm install vue-magick-pen` end |
#run_migrations ⇒ Object
34 35 36 37 38 |
# File 'lib/generators/magick_pen/install_generator.rb', line 34 def run_migrations return unless ["with-migrate"] puts "Running rake db:migrate" `bundle exec rake db:migrate` end |
#start ⇒ Object
10 11 12 13 |
# File 'lib/generators/magick_pen/install_generator.rb', line 10 def start puts "Start installing Magick Pen..." puts "*" * 80 + "\n" end |