This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Tue Jul 01 05:04:03 -0700 2008 | |
| |
MIT-LICENSE.txt | Sun Jun 29 08:52:22 -0700 2008 | |
| |
README.rdoc | Tue Jul 01 05:22:29 -0700 2008 | |
| |
chat.rb | Tue Jul 01 05:27:57 -0700 2008 | |
| |
messages.example | Sun Jun 29 08:52:22 -0700 2008 | |
| |
public/ | Tue Jul 01 05:01:59 -0700 2008 | |
| |
test/ | Sun Jun 29 08:52:22 -0700 2008 | |
| |
views/ | Tue Jul 01 05:01:59 -0700 2008 |
README.rdoc
YAML-based micro chat with Sinatra
About
This mini-application demonstrates the elegance and power of the Ruby language, the Sinatra micro-framework and the Protoype JavaScript library.
It consists of six files for every essential aspect of the application:
- The chat.rb file, which holds the application logic (loading and saving the messages)
- The index.html file, which defines the GUI of the application
- The screen.css which defines the visual style of the application
- The aplication.js (and prototype.js) files which enable rich interactivity (continuous updating and instant posting)
- The messages.yml file which holds the data in YAML format (rename the messages.example file)
The layers are thus properly separated even in this micro-application. It degrades finely for browsers without JavaScript enabled.
It even features simplistic Unit tests for the application (see test directory)
Installation
Unpack the application, rename messages.example to messages.yml and run
ruby chat.rb
in the application directory in the console. You will see something like:
== Sinatra has taken the stage on port 4567!
Then point your browser to:
http://localhost:4567
Resources
- Sinatra micro-framework: sinatra.rubyforge.org
- Prototype JavaScript library: www.prototypejs.org/
- Unobtrusive JavaScript: en.wikipedia.org/wiki/Unobtrusive_JavaScript
Credits
The application was created by Karel Minařík (www.karmi.cz)







