Cookie Based Sessions in Current Rails

Posted by stoyan Thu, 22 Feb 2007 02:55:00 GMT

Seems Cookie Based Sessions are the New Default in Edge Rails : …Cookie-based sessions are just faster to retrieve and process than hitting the file-system on every request. Plus, I would imagine they scale considerably better as they’re persisted on the client side and have no server-side persistence requirements…

So I made a cookie-based sessions patch agains current Rails (actionpack-1.13.2). Usage (from inside your project):
rake rails:freeze:gems
cd vendor
wget http://bgjap.net/code/ruby/ror/session_store-1.13.2.patch
patch -p0 < session_store-1.13.2.patch

Posted in Programing, Ruby | no comments

MicroRails

Posted by stoyan Wed, 24 Jan 2007 08:06:00 GMT

minimal = KISS = i like it :)

  • Camping is a web framework which consistently stays at less than 4kb of code.
  • Mosquito is a simple test framework for why the lucky stiff’s Camping web library. It provides simple hooks and a few assertions for doing unit and functional tests on your Camping models and controllers.
  • MicroTest . see also Archive for the ’Ruby’ Category
  • ComatoseComatose is a micro CMS, implemented as a Rails plugin, that is designed to be easy to embed and extend.

Posted in Programing, Ruby | no comments

Webserver with Mongrel

Posted by stoyan Tue, 14 Nov 2006 05:49:00 GMT

After seen a small webservers in Perl and Ruby here is my try with using Mongrel :

Start an webserver on all interfaces (0.0.0.0), port 3002, serving static pages from ./html/ directory:
require 'mongrel'

config = Mongrel::Configurator.new :host => "0.0.0.0", :port => 3002 do
  listener { uri "/", :handler => Mongrel::DirHandler.new("html/") }
  trap("INT") { stop }
  run
end

config.join
And with adding some statistics (on http://.../status/ URL):
#!/usr/bin/env ruby
require 'rubygems'
require 'mongrel'
require 'yaml'

stats = Mongrel::StatisticsFilter.new(:sample_rate => 1)

config = Mongrel::Configurator.new :host => "0.0.0.0", :port => 3002 do
  listener do
    uri "/", :handler => Mongrel::DirHandler.new("html/")
    uri "/", :handler => stats
    uri "/status", :handler => Mongrel::StatusHandler.new(:stats_filter => stats)
  end

  trap("INT") { stop }
  run
end

puts "Mongrel running on 0.0.0.0:3002 with docroot ./html/" 
config.join

I’m using it for serving static pages, generated with Rote – pretty fast ;)

Posted in Programing, SysAdmin, Ruby | no comments

ruby-1.8.5

Posted by stoyan Fri, 25 Aug 2006 10:18:00 GMT

We have just released the latest stable version of Ruby. This is a bug fix release. There should be no big difference from 1.8.4. We hope 1.8.5 is more stable and reliable than its preceding versions.

—Yukihiro Matsumoto

And the change summary by Mauricio Fernandez

Posted in Programing, Ruby | no comments

[ANN] Restolog-1.2 (beta1)

Posted by stoyan Thu, 24 Aug 2006 08:57:00 GMT

Created a first beta version of Restolog-1.2 . What’s new in it:
  • Textile markup for articles body (act_as_textiled plugin)
  • REST client (‘script/rester’)
  • New REST API calls added (mostly for articles and comments)
  • Some documentation (README, USAGE, CHANGELOG)
Download:
  • tarballs: restolog-1.2b1.tgz
  • SVN: svn checkout http://restolog.googlecode.com/svn/trunk/ restolog
Why it is still beta?
  • update via XML still do not work
  • authentication via keys inside the URL still not possible (Basic Authentication for now)

And by request from Benjamin there is pretty detailed Restolog USAGE file included. Enjoy

Posted in Ruby, Programing, REST | no comments

[ANN] Restolog - RESTful blog example

Posted by stoyan Fri, 11 Aug 2006 03:30:00 GMT

I modified a little the original Alisdair McDiarmid’s RestBlog sources and created very simple blog system. Made an announce to the Rails ML. The copy of it follows:

Very simple blog system based on REST/CRUD ideas. Sources (all credits going to the authors, i just combined their work):

The purpose is mostly proof of concept, not typo/mephisto etc. competition.

Read more...

Posted in Ruby, Programing, REST | 1 comment

Ruby Cookbook PDF

Posted by stoyan Wed, 09 Aug 2006 01:51:00 GMT

O’Reilly is now selling the Ruby Cookbook as a downloadable PDF for 50% off the cover price (see the ”I want the PDF checkbox in the upper right corner). Seems this is the first full-length O’Reilly book to be sold as PDF. PDF copies of the Cookbook will be watermarked but not encumbered by DRM. There is also interesting Ruby Cookbook Official Unofficial Homepage with book source code, tests etc.

Posted in Programing, Ruby | no comments

Typo with installer

Posted by stoyan Fri, 07 Jul 2006 04:54:00 GMT

Without a lot of noise there is a new version of everybody’s favourite blog engine – Typo. It including also an installer, which lets us following the no-step3-way :
$ gem install typo
$ typo install /tmp/typo
Like always with RoR, there is no step 3 ;) you have you blog ready to go.

What else give us the new Typo:

  • no need to downgrade your Rails environment – working without problems with the current Rails version
  • production ready – the new installer making mass-producing pretty easy – creating database(sqlite3 by default), choosing the random port etc.
  • Mongrel friendly – it started mongrel_rails, not webrick. Can be changed from installer/rails_installer_defaults.yml
  • jabber and email notifications – that one is pretty good I think. I need to study more the implementation.

Posted in Programing, SysAdmin, Ruby | no comments

TDD? BDD?

Posted by stoyan Tue, 02 May 2006 06:33:00 GMT

Test Driven Development (TDD) has you define the behaviour of your system by writing small tests that precisely define some small piece of your system’s behaviour. Then you implement that behaviour. Then you clean up and improve your design…It is no surprise that it takes beginners some time to get to the understanding that TDD isn’t about testing at all...if they ever do.

How true!!! Until today I didn’t pay much attention to the TDD. Like most people my opinion was ”Why to lose time for testing my small programs. Some day…on bigger project…maybe”. Oh no…I was sooo far from the true. But I’m going to change…

Everything started from a post in the Dave Astel’s blog: A New Look at Test Driven Development . He explain very well my and maybe other people’s confusion about TDD - all these Test class names, trying to test every class and method (1-1 relationship) etc. In the same post he is proposing a new look on the same problem – writing specifications of what your code will have to do. The name for this new look is Behaviour Driven Development . It’s already implemented in Ruby – the RSpec framework . For bad luck there is still not good Rails support in it.

So on first time I’ll start with the old, but well supported rails testing framework. A very good starting point: Putting REST on Rails – step by step REST implementation. The article itself is better to be tryed with Rails 1.0, because Rails 1.1 way for implementing REST is different and seems easier. But the flow of creating the application is good. I’ll try to follow it.

Posted in TDD, Ruby, Programing | 3 comments

Steve Kemp’s software – i like it

Posted by stoyan Tue, 02 May 2006 02:22:00 GMT

Found very good site: steve.org.uk

Some interesting stuff:

  • Argo — Xen Monitor / Control Panel. Simple, extensible, framework for controling a host running multiple Xen instances. Exactly what I need for the company.
  • lua-httpd — simple, but pretty good Lua http server. Even have support for vhosts!
  • Fortress — a simple script-based security scanner. C++ code, but tests should be written in Lua.

Steve Kemp have also very interesting weblog .

Posted in Programing, SysAdmin | no comments

Older posts: 1 2 3 ... 8

Powered
Ruby Blogs Directory
Performa
Box.net Refer