Sha256: 91351b6a347928cb1ff8e7d0ad51688898b2068548a63a5faf1bda2c31e11397

Contents?: true

Size: 1.6 KB

Versions: 9

Compression:

Stored size: 1.6 KB

Contents

# Application template recipe for the rails_apps_composer. Change the recipe here:
# https://github.com/RailsApps/rails_apps_composer/blob/master/recipes/routes.rb

after_bundler do
  say_wizard "recipe running after 'bundle install'"
  ### HOME ###
  if prefer :starter_app, 'home_app'
    remove_file 'public/index.html'
    gsub_file 'config/routes.rb', /get \"home\/index\"/, 'root :to => "home#index"'
  end
  ### USER_ACCOUNTS ###
  if ['users_app','admin_app'].include? prefs[:starter_app]
    ## DEVISE
    copy_from_repo 'config/routes.rb', :repo => 'https://raw.github.com/RailsApps/rails3-devise-rspec-cucumber/master/' if prefer :authentication, 'devise'
    ## OMNIAUTH
    copy_from_repo 'config/routes.rb', :repo => 'https://raw.github.com/RailsApps/rails3-mongoid-omniauth/master/' if prefer :authentication, 'omniauth'
  end
  ### SUBDOMAINS ###
  copy_from_repo 'lib/subdomain.rb', :repo => 'https://raw.github.com/RailsApps/rails3-subdomains/master/' if prefer :starter_app, 'subdomains'
  copy_from_repo 'config/routes.rb', :repo => 'https://raw.github.com/RailsApps/rails3-subdomains/master/' if prefer :starter_app, 'subdomains'
  ### CORRECT APPLICATION NAME ###
  gsub_file 'config/routes.rb', /^.*.routes.draw do/, "#{app_const}.routes.draw do"
  ### GIT ###
  git :add => '.' if prefer :git, true
  git :commit => "-aqm 'rails_apps_composer: routes'" if prefer :git, true
end # after_bundler

__END__

name: routes
description: "Add routes needed for starter apps."
author: RailsApps

requires: [setup, gems, auth, models, controllers, views]
run_after: [setup, gems, auth, models, controllers, views]
category: mvc

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rails_apps_composer-2.1.7 recipes/routes.rb
rails_apps_composer-2.1.6 recipes/routes.rb
rails_apps_composer-2.1.5 recipes/routes.rb
rails_apps_composer-2.1.4 recipes/routes.rb
rails_apps_composer-2.1.3 recipes/routes.rb
rails_apps_composer-2.1.2 recipes/routes.rb
rails_apps_composer-2.1.1 recipes/routes.rb
rails_apps_composer-2.1.0 recipes/routes.rb
rails_apps_composer-2.0.1 recipes/routes.rb