- assets and specs can be CoffeeScript
- 3rd party JS can be placed to vendor/assets/javascripts or vendor gems
- detects gem-vendored JS via application.js require
- uses jasmine-headless-webkit to run the suite outside the browser
- this requires Qt4.7 installation
#!/bin/bash | |
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | |
APP_NAME=your_app_name_here #<--fill this in | |
APP_DIR=/var/www/apps/ | |
RAILS_ROOT=$APP_DIR/current | |
if [ "$3" ]; then | |
RUNNER="$3" | |
else | |
RUNNER=1 |
Warden::Manager.serialize_into_session{|user| user.id } | |
Warden::Manager.serialize_from_session{|id| User.get(id) } | |
Warden::Manager.before_failure do |env,opts| | |
# Sinatra is very sensitive to the request method | |
# since authentication could fail on any type of method, we need | |
# to set it for the failure app so it is routed to the correct block | |
env['REQUEST_METHOD'] = "POST" | |
end | |
Deploying a Rails 3 App with EC2 + S3 + Ubuntu + Capistrano + Passenger | |
======================================================================= | |
EC2 Setup | |
--------- | |
1 Launch New ec2 instance - ami-1634de7f | |
2 Create elastic IP [ELASTIC_IP] and associate it with instance | |
3 go to domain registrar DNS settings, @ and www to ELASTIC_IP | |
4 set the `:host` in `config/deploy.rb` to ELASTIC_IP |
source 'https://rubygems.org' | |
gem 'rails', '3.2.0' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
gem 'sqlite3' | |
window.onload = -> | |
# Development | |
window.PAYMILL_PUBLIC_KEY = 'PUBLIC_TEST_KEY' | |
# Production | |
PaymillErrorHandler = (error_message) -> | |
# Add elements to container if don't exist | |
s = $('.container').children('#notification').size() | |
#!/usr/bin/env jruby | |
# | |
# | |
require 'rubygems' | |
require 'spoon' | |
EXEC = '/tmp/exec.rb' | |
PID_PATH = '/tmp/exec.pid' | |
WORK_PATH = '/tmp/' |
UPDATE: Please see some of the forks for an updated version of this guide. I | |
myself have moved onto the Rails 3.1 betas to get the asset pipeline. But if | |
you want to stay on stable there are other folks who are keeping this guide | |
relevant despite the changes constantly occurring on Sprockets 2. The comments | |
on this gist will lead you to the right forks. :) | |
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript | |
powered JS and SASS powered CSS with YUI compression all via the magic of rack. | |
This stuff will be native in Rails 3.1 and the layout of the files on the |
-
The new rake task assets:clean removes precompiled assets. [fxn]
-
Application and plugin generation run bundle install unless
--skip-gemfile
or--skip-bundle
. [fxn] -
Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]
-
Template generation for jdbcpostgresql #jruby [Vishnu Atrai]
There are many different provisioning tools out there, the most popular of which are Chef and Puppet. Chef uses Ruby, Puppet uses a DSL (Domain Specific Language), there are others that use simple bash too, but today we're going to focus on Chef Solo.
To get Chef working properly on your local machine you need a few things.
Make sure you use Ruby 1.9.x and not Ruby 2.x as you will get errors with the json 1.6.1 gem on 2.x. Use rbenv or RVM to manage several different Rubies on the one machine.