Class: Moonshadow::Manifest::Rails

Inherits:
Moonshadow::Manifest show all
Includes:
Apache, Mysql, Os, Passenger, Postgresql, Rails, Sqlite3
Defined in:
lib/moonshadow/manifest/rails.rb

Overview

The Rails Manifest includes recipes for Apache, Mysql, Sqlite3 and Rails running on Ubuntu 8.04 or greater.

Defined Under Namespace

Modules: Apache, Mysql, Os, Passenger, Postgresql, Rails, Sqlite3

Instance Method Summary collapse

Methods included from Os

#cron_packages, #motd, #ntp, #postfix, #security_updates, #time_zone

Methods included from Rails

#rails_bootstrap, #rails_directories, #rails_gems, #rails_logrotate, #rails_migrations, #rails_rake_environment

Methods included from Apache

#apache_server

Methods included from Sqlite3

#sqlite3

Methods included from Postgresql

#postgresql_database, #postgresql_gem, #postgresql_server, #postgresql_user

Methods included from Mysql

#mysql_database, #mysql_fixup_debian_start, #mysql_gem, #mysql_server, #mysql_user

Methods included from Passenger

#passenger_apache_module, #passenger_configure_gem_path, #passenger_gem, #passenger_site

Methods inherited from Moonshadow::Manifest

#database_environment, deploy_stage, #deploy_stage, initial_configuration, #on_stage, plugin, rails_env, #rails_env, rails_root, #rails_root, #template

Instance Method Details

#default_stackObject

A super recipe for installing Apache, Passenger, a database, Rails, NTP, Cron, Postfix. To customize your stack, call the individual recipes you want to include rather than default_stack.

The database installed is based on the adapter in database.yml.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
# File 'lib/moonshadow/manifest/rails.rb', line 40

def default_stack
  self.class.recipe :apache_server
  self.class.recipe :passenger_gem, :passenger_configure_gem_path, :passenger_apache_module, :passenger_site
  case database_environment[:adapter]
  when 'mysql'
    self.class.recipe :mysql_server, :mysql_gem, :mysql_database, :mysql_user, :mysql_fixup_debian_start
  when 'postgresql'
    self.class.recipe :postgresql_server, :postgresql_gem, :postgresql_user, :postgresql_database
  when 'sqlite' || 'sqlite3'
    self.class.recipe :sqlite3
  end
  self.class.recipe :rails_rake_environment, :rails_gems, :rails_directories, :rails_bootstrap, :rails_migrations, :rails_logrotate
  self.class.recipe :ntp, :time_zone, :postfix, :cron_packages, :motd, :security_updates
end

#validate_platformObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/moonshadow/manifest/rails.rb', line 4

def validate_platform
  unless Facter.lsbdistid == 'Ubuntu' && Facter.lsbdistrelease.to_f >= 8.04
    error = <<-ERROR


    Moonshadow::Manifest::Rails is currently only supported on Ubuntu 8.04
    or greater. If you'd like to see your favorite distro supported, fork
    Moonshadow on GitHub!
    ERROR
    raise NotImplementedError, error
  end
end