lib/generators/cm_admin/install_generator.rb in cm-admin-0.5.7 vs lib/generators/cm_admin/install_generator.rb in cm-admin-0.5.8

- old
+ new

@@ -1,26 +1,16 @@ require 'rails/generators' - def add_required_gems - gem 'slim' - gem 'simple_form' - system("yarn add bootstrap") - system("yarn add @fortawesome/fontawesome-free") - system("yarn add select2") - system("yarn add daterangepicker") - system("yarn add jgrowl") - end +module CmAdmin + module Generators + class InstallGenerator < Rails::Generators::Base + source_root File.expand_path('templates', __dir__) - def copy_layout_file - copy_file "layouts/_side_navbar.html.slim", "app/views/layouts/_side_navbar.html.slim" - copy_file "layouts/_navbar.html.slim", "app/views/layouts/_navbar.html.slim" - remove_file "app/views/layouts/application.html.erb" - copy_file "layouts/application.html.slim", "app/views/layouts/application.html.slim" + def copy_initializer + copy_file 'cm_admin_initializer.rb', 'config/initializers/cm_admin.rb' + copy_file 'custom.js', 'app/assets/javascripts/custom.js' + copy_file 'custom.css', 'app/assets/stylesheets/custom.css' + route 'mount CmAdmin::Engine => "/admin"' + end end - - def copy_asset_file - copy_file "assets/images/cm.png", "app/assets/images/cm.png" - directory "assets/stylesheets/", "app/assets/stylesheets/" - remove_file "app/assets/stylesheets/application.css" - end end -end +end \ No newline at end of file