This was a test with Poltergeist I did the other day
#!ruby
def polter
noop
end
#!/bin/bash -l | |
install_path="$HOME/install" | |
### Verify if the executing user is the root | |
function is_root { | |
if [[ $(/usr/bin/id -u) -ne 0 ]]; then | |
echo "The installation process requires to be run as root. Consider using sudo." | |
false | |
fi |
#! /bin/sh | |
TINYPMVERSION=2.2.3 | |
# from /etc/init.d/tomcat6 | |
NAME=tomcat6 | |
# Directory where the Tomcat 6 binary distribution resides | |
CATALINA_HOME=/usr/share/$NAME | |
# Directory for per-instance configuration files and webapps | |
CATALINA_BASE=/var/lib/$NAME |
# this does not run as a complete script :( | |
pkg_add -r bash curl sudo | |
pkg_add -r git vim # can you live without it? | |
pkg_add -r libxml2 libxslt # for nokogiri later | |
pw usermod pzol -G wheel | |
bash # start bash and run the rest inside it | |
curl -# -L http://bit.ly/rvm-install-system-wide > rvm-install-system-wide | |
bash -l < rvm-install-system-wide |
# encoding: UTF-8 | |
# parsing with EOF throws illegal characters!? | |
json = <<EOF | |
{ | |
"date_a": "2011-07-22T09:54:44Z", | |
"city": "wroc\u0142aw", # after this the next date is not parsed anymore! | |
"date_b": "2011-07-22T09:54:44Z" | |
} | |
EOF |
This was a test with Poltergeist I did the other day
#!ruby
def polter
noop
end
sudo bash -l -c 'rvm implode && rm -rf /etc/rvmrc /usr/local/bin/rvm* /usr/local/rvm' | |
rm ~/.rvmrc | |
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer ) | |
rvm reload | |
# check if it is loaded correctly, this should return rvm is a function | |
type rvm | head -n 1 |
feature 'Drinking Beer' do | |
scenario 'Drink a favorite beer' do | |
user = TestUser.new.extend(BeerDrinker) | |
user.pickup_favorite_beer "Belfast" | |
user.drinks_chosen_beer! | |
end | |
scenario "Getting wasted" do | |
user = TestUser.new.extend(BeerDrinker) |
def Maybe(obj) | |
return Maybe.new(Nothing.new) if obj.nil? | |
return Maybe.new(obj) | |
end | |
class Nothing | |
def method_missing(*args, &block) | |
self | |
end |
class MonadicHotelBookingPresenter | |
def initialize(booking) | |
@booking = Maybe(booking) | |
end | |
def hotel_name | |
hotel_details['name'].fetch.to_s | |
end | |
def hotel_category |
I use the latest Puma v1.4.0 from rubygems.
Make sure you have nginx installed with these options:
>/opt/nginx/sbin/nginx -V
nginx version: nginx/1.0.15
built by gcc 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)