Class: Boring::RailsAdmin::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Boring::RailsAdmin::InstallGenerator
- Defined in:
- lib/generators/boring/rails_admin/install/install_generator.rb
Instance Method Summary collapse
Instance Method Details
#add_rails_admin_ruby_gem ⇒ Object
14 15 16 17 18 19 |
# File 'lib/generators/boring/rails_admin/install/install_generator.rb', line 14 def add_rails_admin_ruby_gem say "Adding rails_admin gem", :green Bundler.with_unbundled_env do run "bundle add rails_admin" end end |
#run_rails_admin_generator ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/generators/boring/rails_admin/install/install_generator.rb', line 21 def run_rails_admin_generator return if [:skip_generator] if [:route_name].present? say "Running rails_admin generator", :green Bundler.with_unbundled_env do run "DISABLE_SPRING=1 bundle exec rails generate rails_admin:install #{[:route_name]}" end else say <<~WARNING, :red ERROR: Please specify the --route_name=<name> where you want to mount the rails_admin engine WARNING end end |