Technology Stack for Rails
Core
- Rails 3.0.1
- Ruby 1.9.2 (use RVM for mgmt.)
Development
- Bundler – manage gem dependencies
require 'fog' | |
compute = Fog::Compute.new(:provider => 'VirtualBox') | |
server = compute.servers.create(:name => 'lucid', :os => 'Ubuntu') | |
medium = compute.mediums.create(:device_type => :hard_disk, :location => '/Users/geemus/geemus/virtualbox_poc/lucid.vmdk', :read_only => false) | |
storage_controller = server.storage_controllers.create(:bus => :sata, :name => 'sata') | |
storage_controller.attach(medium, 0) |
def tip(msg); puts; puts msg; puts "-"*100; end | |
# | |
# 30 Ruby 1.9 Tips, Tricks & Features: | |
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/ | |
# | |
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2" | |
tip "Ruby 1.9 supports named captures in regular expressions!" |
Feature: Validate moves | |
Scenario: Moving the knight illegally | |
Given the following board: | |
| | | | | | | | |8| | |
| | | | | | | | |7| | |
| | | | | | | | |6| | |
| | | | | | | | |5| | |
| | | |♞| | | | |4| | |
| | | | | | | | |3| | |
|♙| | | | | | | |2| |
$ rvm ruby-1.9.2-p136@ingredients | |
$ gem list | |
animalcracker (0.0.2) | |
bacon (1.1.0) | |
beet (0.6.9) | |
berry (0.0.0) | |
breadcrumbs (0.1.5) | |
butternut (0.2.1) |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>Bayeux / Comet Test for Tropo</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.3/jquery.min.js"></script> | |
<script type="text/javascript" src="http://path/to/your/bayeaux/server/tropo.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { |
/* Scaled-down Backbone.js demonstration | |
* By Jacob Oscarson (http://twitter.com/jacob414), 2010 | |
* MIT Licenced, see http://www.opensource.org/licenses/mit-license.php */ | |
$(function() { | |
window.ulog = function(msg) { $('#log').append($('<div>'+msg+'</div>')); } | |
// Faking a little bit of Backbone.sync functionallity | |
Backbone.sync = function(method, model, succeeded) { | |
ulog('<strong>'+method + ":</strong> " + model.get('label')); | |
if(typeof model.cid != 'undefined') { |
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
module Player | |
describe MovieList, "with optional description" do | |
it "is pending example, so that you can write ones quickly" | |
it "is already working example that we want to suspend from failing temporarily" do | |
pending("working on another feature that temporarily breaks this one") |
source 'http://rubygems.org' | |
gem 'rails', '3.0.0' | |
# Bundle edge Rails instead: | |
# gem 'rails', :git => 'git://github.com/rails/rails.git' | |
#gem 'mysql2' | |
gem "sqlite3-ruby" |
Technology Stack for Rails
Core
Development
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |