Brightlight Weblog

Woah! I know ruby-fu!

Entries for the ‘Ruby’ Category

iPhonefriendcodes – new Microproject

To test the power of rails (yet again). I worked up this little friendcode-sharing project in less than 8 hours. So if you got an iPhone and play one of those “mmo” games like iMob, iVampires or Mafia Wars take a look at iPhonefriendcodes.com

Giving your staging database some love

We over at NoXa like to begin every day with a fresh database on our staging enviroment. Problem is it’s a lot of work to do it manually everytime. So altough we like the daily update we often end up with a staging database that gets refreshed once a year. So today I decided the old-database [...]

Unattended Passenger / Ruby Enterprise Installation on Ubuntu 8

[update @ 15-03-09]
Updated the script to use the latest passenger 2.1.2 and the lastest version of Ruby Enterprise. Also made a few changes as suggested in the comments, thanks guys!
I needed a small project that I could use to learn some basic bash scripting. Since I like automating things a unattended passenger installation seemed like [...]

Capistrano and Glassfish

There is enough documentation when it comes to installing JRuby and Glassfish. What was lacking was a simple capistrano recipe to get you started, let’s get cracking.

1
2
3
4
5
6
7
namespace :app do
desc "Warble and Deploy"
task :warble_and_deploy , :roles => [:app] do
run "cd #{release_path}/ && warble"
run "/bin/asadmin [...]

I need an excuse to check my syntax highlighter

1
2
3
4
5
6
7
8
9
class Organization < ActiveRecord::Base
named_scope :active, :conditions => "status = ‘1′"
end
 
class OrganizationsController < ApplicationController
def index
@organizations = Organizations.active.paginate(:page => params[:page])
end
end

Namedscopes are soo pretteh