# >---------------------------------------------------------------------------< # # _____ _ _ __ ___ _ # | __ \ (_) | \ \ / (_) | | # | |__) |__ _ _| |___\ \ /\ / / _ ______ _ _ __ __| | # | _ // _` | | / __|\ \/ \/ / | |_ / _` | '__/ _` | # | | \ \ (_| | | \__ \ \ /\ / | |/ / (_| | | | (_| | # |_| \_\__,_|_|_|___/ \/ \/ |_/___\__,_|_| \__,_| # # This template was generated by rails_apps_composer, a custom version of # RailsWizard, the application template builder. For more information, see: # https://github.com/RailsApps/rails_apps_composer/ # # >---------------------------------------------------------------------------< # >----------------------------[ Initial Setup ]------------------------------< initializer 'generators.rb', <<-RUBY Rails.application.config.generators do |g| end RUBY @recipes = <%= resolve_recipes.map(&:key).inspect %> <%= render "helpers" %> # this application template only supports Rails version 3.1 and newer case Rails::VERSION::MAJOR.to_s when "3" case Rails::VERSION::MINOR.to_s when "2" say_wizard "You are using Rails version #{Rails::VERSION::STRING}." when "1" say_wizard "You are using Rails version #{Rails::VERSION::STRING}." when "0" say_wizard "You are using Rails version #{Rails::VERSION::STRING} which is not supported. Try 3.1 or newer." raise StandardError.new "Rails #{Rails::VERSION::STRING} is not supported. Try 3.1 or newer." else say_wizard "You are using Rails version #{Rails::VERSION::STRING}." end else say_wizard "You are using Rails version #{Rails::VERSION::STRING} which is not supported. Try 3.1 or newer." raise StandardError.new "Rails #{Rails::VERSION::STRING} is not supported. Try 3.1 or newer." end say_wizard "Checking configuration. Please confirm your preferences." # >---------------------------[ Autoload Modules/Classes ]-----------------------------< inject_into_file 'config/application.rb', :after => 'config.autoload_paths += %W(#{config.root}/extras)' do <<-'RUBY' config.autoload_paths += %W(#{config.root}/lib) RUBY end # >---------------------------------[ Recipes ]----------------------------------< <% resolve_recipes.each do |recipe| %> <%= render 'recipe', recipe.get_binding %> <% end %> <% if custom_code? %># >-----------------------------[ Custom Code ]-------------------------------< <%= custom_code %><% end %> @current_recipe = nil # >-----------------------------[ Run Bundler ]-------------------------------< say_wizard "Running 'bundle install'. This will take a while." run 'bundle install' say_wizard "Running 'after bundler' callbacks." require 'bundler/setup' @after_blocks.each{|b| config = @configs[b[0]] || {}; @current_recipe = b[0]; b[1].call} @current_recipe = nil say_wizard "Running 'after everything' callbacks." @after_everything_blocks.each{|b| config = @configs[b[0]] || {}; @current_recipe = b[0]; b[1].call} @current_recipe = nil say_wizard "Finished running the rails_apps_composer app template." say_wizard "Your new Rails app is ready."