Class: MagickPen::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/magick_pen/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#check_paper_trailObject



12
13
14
15
16
17
# File 'lib/generators/magick_pen/install_generator.rb', line 12

def check_paper_trail
  puts "Paper Trail Install...."
  Dir.chdir(Rails.root) do
    `bundle exec rails generate paper_trail:install`
  end
end

#finishedObject



37
38
39
40
# File 'lib/generators/magick_pen/install_generator.rb', line 37

def finished
  puts "\n" + ("*" * 80)
  puts "Done! Magick Pen has been successfully installed."
end

#install_migrationsObject



19
20
21
22
23
24
# File 'lib/generators/magick_pen/install_generator.rb', line 19

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_npmObject



32
33
34
35
# File 'lib/generators/magick_pen/install_generator.rb', line 32

def install_npm
  puts "Running npm install vue_magick_pen"
  `npm install vue-magick-pen`
end

#run_migrationsObject



26
27
28
29
30
# File 'lib/generators/magick_pen/install_generator.rb', line 26

def run_migrations
  return unless options["with-migrate"]
  puts "Running rake db:migrate"
  `bundle exec rake db:migrate`
end

#startObject



7
8
9
10
# File 'lib/generators/magick_pen/install_generator.rb', line 7

def start
  puts "Start installing Magick Pen..."
  puts "*" * 80 + "\n"
end