class Virgo::InstallGenerator

Public Instance Methods

app_has_engine_route?() click to toggle source
# File lib/generators/virgo/install/install_generator.rb, line 15
def app_has_engine_route?
  route_contents = File.read("#{Rails.root}/config/routes.rb")
  route_contents.include?("Virgo::Engine")
end
run_install() click to toggle source
# File lib/generators/virgo/install/install_generator.rb, line 3
def run_install
  unless app_has_engine_route?
    in_root do
      inject_into_file 'config/routes.rb',"\n  mount Virgo::Engine => \"/\"\n", { before: /^end/, verbose: false, force: true }
    end
  end

  generate "virgo:views"
  generate "virgo:migrations"
  generate "virgo:schedule"
end