class Preseason

Constants

VERSION

Attributes

config[R]

Public Class Methods

new(context) click to toggle source
# File lib/preseason.rb, line 17
def initialize(context)
  Preseason::GeneratorContext.context = context

  @config = OpenStruct.new(
    :database       => Preseason::Config::Database.new,
    :factory        => Preseason::Config::Factory.new,
    :bourbon        => Preseason::Config::Bourbon.new,
    :bitters        => Preseason::Config::Bitters.new,
    :templating     => Preseason::Config::Templating.new,
    :authentication => Preseason::Config::Authentication.new,
    :ie8            => Preseason::Config::IE8.new,
    :heroku         => Preseason::Config::Heroku.new,
    :whiskey_disk   => Preseason::Config::WhiskeyDisk.new
  )
end

Public Instance Methods

game_on!() click to toggle source
# File lib/preseason.rb, line 33
def game_on!
  ask_for_config
  prepare_recipes
  display_post_install_messages
end

Private Instance Methods

ask_for_config() click to toggle source
# File lib/preseason.rb, line 40
def ask_for_config
  config.database.ask_user
  config.factory.ask_user
  config.bourbon.ask_user
  config.bitters.ask_user
  config.templating.ask_user
  config.authentication.ask_user
  config.heroku.ask_user if config.database.postgres?
  config.whiskey_disk.ask_user
  config.ie8.ask_user
end
display_post_install_messages() click to toggle source
# File lib/preseason.rb, line 56
def display_post_install_messages
  recipes.each do |recipe|
    readme "#{recipe.recipe_root}/#{recipe.post_install_hook}" if recipe.post_install_hook
  end
end
prepare_recipes() click to toggle source
# File lib/preseason.rb, line 52
def prepare_recipes
  recipes.each &:prepare
end
recipes() click to toggle source
# File lib/preseason.rb, line 62
def recipes
  @recipes ||= %w(
    Rvm
    Gemfile
    Gitignore
    Database
    Production
    Bundle
    Flash
    Application
    Schedule
    Rspec
    WhiskeyDisk
    Foreman
    Devise
    ActiveAdmin
    CustomErrorPages
    Guard
    ZeusRspec
    Initializer
    IE8
    Bourbon
    Bitters
    Routes
    Git
    Heroku
  ).map { |recipe_name| "Preseason::Recipe::#{recipe_name}".constantize.new(config) }
end