Skip to content

Instantly share code, notes, and snippets.

@rodreegez
rodreegez / tnt.rb
Created December 20, 2009 23:15
a thor script that implements basic twitter functionality. (save as tnt.thor)
require 'rubygems'
require 'thor'
require 'twitter'
class TNT < Thor
map "MESSAGE" => :post
desc "post \"message\"", "Post a message to Twitter"
def post(message)
client.update message
$ sudo env ARCHFLAGS="-arch i386 -arch x86_64"
$ gem install --no-rdoc --no-ri mysql -- --with-mysql-dir=/usr/local/lib/mysql --with-mysql-config=/usr/loca /bin/mysql_config
# get current git branch
git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null)
if [[ -n $ref ]]; then
echo "[${ref#refs/heads/}]"
fi
}
# set prompt a la Ubuntu, but with added git branch (if any)
export PS1='\u@\h:$(git_prompt_info)\w$ '
require 'pyrite_helper'
class SampleTest < Pyrite::PyriteTest
test "homepage" do
visit root_path # use rails roots, or "/some/path/to/page"
follow "A Link" # link label text
press "A Button" # press a button with the value "A Button"
click "#anything_else" # any other elements can be clicked using a CSS selector
wait_for :page_load # we don't wait automatically, because that causes problems
assert_text "some text you should see"

Coding Rails with Homebrew

Right now, this assumes you are using Snow Leopard.

Install Homebrew

Homebrew is MacPorts (or APT) without the suck. http://github.com/mxcl/homebrew

@rodreegez
rodreegez / rails_tested.md
Created May 6, 2010 15:24
Hudson, Ruby Enterprise Edition, Nginx.

Testing Rails with Hudson CI

Written for Ubuntu LTS 10.4

Update and upgrade

  $ sudo aptitude update
  $ sudo aptitude upgrade
sudo apt-get install aspell libaspell-dev aspell-en
sudo gem install raspell

source

  sudo apt-get install libxml2 libxml2-dev libxslt1-dev
  sudo gem install nokogiri

source

sudo apt-get install libcurl4-gnutls-dev
sudo gem install typhoeus

source

wget http://ftp.de.debian.org/debian/pool/main/r/redis/redis-server_1.2.6-1_i386.deb
sudo dpkg -i redis-server_1.2.6-1_i386.deb

source