module Secondbureau class MountRailsInfoGenerator < Rails::Generators::Base def mount_sextant_route sextant_route = "\tmount_sextant if Rails.env.development?\n" inject_into_file 'config/routes.rb', sextant_route, :after => "Application.routes.draw do\n" sextant_route = "\tmount Secondbureau::Engine => '/secondbureau' if Rails.env.development?\n" inject_into_file 'config/routes.rb', sextant_route, :after => "mount_sextant if Rails.env.development?\n" end def add_sextant_to_gemfile append_file 'Gemfile', <<-GEMS gem 'sextant', group: :development GEMS end def run_bundle run "bundle install" end end end