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

6th Kansai Rails meeting in Kobe

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

After small timeout I found a time to put some notes for the last Rails meeting in Kobe .

Sometimes StikiPad is down (specially when i need my notes ;) ), so like a work around will try to duplicate all notes on the self-hosted Junebug -powered wiki . For the related discussions there is a Beast -powered forum . Hahahah © Powered by RoR site a ;) The only missing part is maybe Mephisto for blogging. Or I can use my homemade Restolog when it’s ready.

Posted in Ruby, Personal | 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

nginx notes

Posted by stoyan Fri, 25 Aug 2006 09:59:00 GMT

I put some notes for nginx on my wiki .

The rails system administration is like waves – somebody found a new software and the community just fulfill it. Maybe there must be some name for this effect. Something like digg-effect but maybe Rails wave hahaha.

First there was lighttpd , now nginx comming. Maybe your piece of code will be the next. Are your ready? ;)

Posted in SysAdmin, 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

MapReduce for Ruby: Ridiculously Easy Distributed Programming

Posted by stoyan Mon, 21 Aug 2006 07:03:00 GMT

Google’s MapReduce is now available for Ruby (via gem install starfish ). MapReduce is the technique used by Google to do monstrous distributed programming over 30 terabyte files.

Here is the basic code that will get you up and running with MapReduce in Starfish .
    # item.rb
    ActiveRecord::Base.establish_connection(
      :adapter  => "mysql",
      :host     => "localhost",
      :username => "root",
      :password => "",
      :database => "some_database" 
    )

    class Item < ActiveRecord::Base; end

    server do |map_reduce|
      map_reduce.type = Item
    end

    client do |item|
      logger.info item.id
    end
Now just run:
    starfish item.rb
and Starfish takes care of the rest. The code above does the following:
  • The server grabs all the items via: Item.find(:all)
  • Each of the clients grab an item from the collection
  • When there are no more items to be grabbed, everything shuts down

Just add REST (and it’s come by default with the Edge Rails) and you’ll have your own S3 or GDrive for free ;)

Posted in Ruby | 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

Older posts: 1 2 3 ... 9

Powered
Ruby Blogs Directory
Performa
Box.net Refer