This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From a fresh install of squeeze | |
apt-get install ruby rubygems # Need ruby to use fpm | |
gem1.8 install fpm --no-ri --no-rdoc | |
apt-get install build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev ncurses-dev libyaml-dev | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p125.tar.gz | |
tar -zxvf ruby-1.9.3-p125.tar.gz | |
cd ruby-1.9.3-p125 | |
rm -rf /tmp/ruby193 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Item | |
def initialize item | |
raise "expected Hash param" unless item.kind_of? Hash | |
item.each do |key,value| | |
instance_variable_set(clean_key(key), value) | |
define_singleton_method(key.to_s) { instance_variable_get( clean_key(key) ) } | |
define_singleton_method("#{key.to_s}=") { |val| instance_variable_set( clean_key(key), val ) } | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
class Item | |
#replaced with dynamic initialization below | |
#attr_reader :id, :user, :state | |
# | |
# | |
# Sample JSON | |
# | |
# [{ "id":1, "user":"john", "state":"active" }, | |
# { "id":2, "user":"jane", "state":"inactive" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env roundup | |
describe "redis-cli(1)" | |
# Start the redis server on port 9999 | |
port=9999 | |
printf "PORT $port\n" | ./redis-server - & | |
redis_pid=$! | |
# Give redis time to start listening |
NewerOlder