|
Ruby WebServer 3
ERB (Embedded Ruby)! This addition to our Ruby web server application allows you to call web pages with Ruby code that execute on the fly (time of render). Check out these snippets: myfile = IO.readlines("chris.html") #@session.puts myfile template = ERB.new <<-EOF #{myfile} EOF @session.puts templat...
|
|
|
Ruby WebServer 2
This is a continuation of the BYO-WebServer application except rather than outputing static text, we will read and output an html file stored in the same directory. The new 2 lines of code are as follows: myfile = IO.readlines("chris.html") @session.puts myfile
|
|
|
Ruby WebServer 1
By popular demand, here's a screencast of a basic web server engine based on Ruby. Source by Suresh Mahadevan. require 'thread' require 'socket' class RequestHandler def initialize(session) @session = session end def process while @session.gets.chop.length != 0 end @session.puts "HTTP/1.1 200 OK" @se...
|
|
|
Camping a Microframework for ruby
By popular demand, we are going to cover Why's Camping framework again but this time via a screen cast rather than an audio podcast. It's almost 18 minutes of Camping fun and it includes an exercise to determine if Bill Gates is really evil or not.
|
|
|
SOAP
I decided to combine all of the podcasts and screencasts into the same numbering system. I hope that you enjoy this one on SOAP-based web services!
|
|
|
SDBM
SDBM (formerly DBM) is a native Ruby string-based hash file-storage system. Let me know what kind of uses you can think of for this solution!
|
|
|
KirbyBase
Check out Jamey Cribbs' open sourced database called KirbyBase! It's a quite powerful database application written in Ruby and takes up approximately 100kb of memory
|
|
|
Threading
Did you know that Ruby supports multi-threading natively? Check out these quick couple of steps needed to thread your Ruby applications!
|
|
|
YAML
What is YAML? YAML = YAML Aint Markup Language! YAML is great for quickly exporting and importing data to and from your Ruby application. There seem to be many pros and cons on when to use YAML vs. XML. My rule of thumb is to use YAML when everything is controlled by your application. Use XML is you ...
|
|
|
XML-RPC
Before SOAP and REST, there were Remote Procedure Calls. Ruby ships with native RPC support and I'll show you how to built powerful remote API queries with 3 lines of Ruby code!
|
|