Firebug 1.2 Makes Progress

written July 23 2008 by
{ Kommen }
Comments 1

I’m following the Firebug development since I’m a heavy user of it. And since I switched to Firefox 3, I have to use the latest development version.

With beta8 (should be available in a few days) a long standing bug will fixed: $0 and $1 variables (containing the most recently inspected objects) now work again. Finally!
I think this was one of the most annoying issues I had since I switched to FF3 and FB1.2.

Also, I hope development gets a boost with John Resig spending half of his time at Mozilla with working on Firebug.

I’m really looking forward to one of the best web development tools being improved upon even more.

Firebug Links:

Redcloth 4.0 released: 40 times faster!

written July 21 2008 by
{ Kommen }
Comments 1

Redcloth 4.0: was just released and according to Jason Garber it is 40 times faster than the previous version.

Sounds like a huge speed up for textilize and co. I guess it will be shortly available through the rubyforge gem severs.

Check Rails Applications For Rails 2.0 Compatibility

written September 23 2007 by
{ Kommen }
Comments 0

Mislav just posted this in #rails-contrib on irc.freenode.net: Pastie

This little script checks your existing Rails application for Rails 2.0 compatibility. Should be very useful for everyone
who wants to upgrade and use the latest and greatest Rails features.

It will give you rough clues about where you have to get your hands on.

Akismator — The Better Way To Protect a Rails App Against Spam

written September 16 2007 by
{ Kommen }
Comments 1

As I wrote some time ago, we protect our blog with Akismet against spam.

For those who don’t follow Ryan Bates’ Railscasts (I really suggest to do so) I want to introduce Akismetor. It’s a small library that simplifies the use of Akismet. I really recommend watching this free screencast about how it works or alternatively you can read the Akismator README.

RadRails or Emacs?

written February 24 2007 by
{ Kommen }
Comments 3

The last RadRails version 0.7.2 was released 3 months ago and it seems the RadRails-Team members are spending their time on other things. RadRails isn’t feature complete yet and there are still many bugs bugs waiting to be fixed.

And honestly, I don’t like to work with software, which needs some work but isn’t under maintenance/development any more.

So I (again) took a look at other Rails editors/IDEs to try out. After playing around with vim and emacs I decided to give emacs a try.

This article is continued. Click to read more!

RadRails and Brand New Java SE 6

written December 16 2006 by
{ Kommen }
Comments 0

Some days ago I read on a news feed that Java SE 6 is ready. I had a look at the Key Features List. One point was Improved desktop performance and integration. So I wondered if RadRails could be faster then it was with Java SE 5.

This article is continued. Click to read more!

Mongrel 0.3.18 is out

written December 8 2006 by
{ Kommen }
Comments 0

Already two weeks ago, version 0.3.18 of Mongrel was released.
Read about the important integration of fastthread and how to install it.

This article is continued. Click to read more!

RadRails 0.7.2 arrived

written December 8 2006 by
{ Kommen }
Comments 0

I just want to drop a note that RadRails 0.7.2 was released, for the case you missed it.

Check it out!

Hedgehog: New Trac-like ticket system

written December 3 2006 by
{ Kommen }
Comments 0

The RadRails guys set up their own Trac-like ticket system written in Rails: Hedgehog

Features include:

Currently they use it for developing RadRails and the software itself. I’ve heard they plan to release it as open source.

I had a look at it and it looks promising. But there are some things that they have to work on. E.g. currently I’m not even able to create a new ticket, but I think they will fix that soon.

Maybe it will get an lightweight alternative to Trac and Collaboa.

Nightly and Integration Builds for RadRails

written December 3 2006 by
{ Kommen }
Comments 0

The RadRails team has announced that they will provide automatically generated nightly and integration builds for RadRails.

The nightly builds can be found here: http://www.radrails.org/build/nightly/

Yesterday they released a new integration build for RadRails 0.7.2, which should fix some bugs in the RHTML editor. It can be found here:
http://www.radrails.org/build/integration/2006.12/I061202.1640/

I’m using the integration build from yesterday and it runs very well. Keep up the good job, RadRails guys!

Administrate SQLite Databases from RadRails

written November 5 2006 by
{ Kommen }
Comments 2

Recently, when I switched from Ubuntu Dapper Drake to Edgy Eft, I also had to set up my development environment again.
This time I decided to use SQLite3 for Rails development on my notebook instead of MySQL.

I used to administer my databases with phpMyAdmin or with the Data Perspective in RadRails. Now my problem was, that the SQLite JDBC driver which RadRails uses sucks and the Data Perspective wont work.

So I looked for a solution to easily manage the SQLite databases from my projects with RadRails.
Here it is:

Install rSQLiteGUI

rSQLiteGUI is a very simple but useful graphical interface to manage SQLite databases written in Ruby and using GTK2.

To install it, just download the latest version from here and extract the archive to a directory. Make sure rsqlitegui.rb is executable.

Configure RadRails to work with rSQLiteGUI

In RadRails you can define File Associations. So associate the *.db files with rSQLiteGUI:

Done! Now you can view or edit a SQLite database just double clicking on it in the Rails navigator.

The Rails Way

written November 1 2006 by
{ Kommen }
Comments 0

I just came across a new interesting site: The Rails Way


From the About:

The Rails Way is all about teaching “best practices” in Rails application design. It is run by Jamis Buck and Michael Koziarski, both of whom are members of the Rails core team and have had extensive experience with both designing and building web applications.

How To Protect A Rails Application Against Spam with Akismet

written October 1 2006 by
{ Kommen }
Comments 75

Spam is more and more a problem for many sites. And there are many approaches to fight spam. One is Akismet.

Akismet is a collaborative effort to make spam a non-issue. While there are Akismet plugins for Typo, WordPress, etc. you have to do some work to use it in your own application.

In this article I will demonstrate how to use Akismet in your own
Rails application to protect it against spammers. As example I will use comments, e.g in a weblog.
I’m assuming you already have your blog up and running, and want to add spam protection with Akismet.

Get an Akismet key

Akismet is free for personal use. But for using it, you have to get a key. Either a commercial or a personal one.
So go to http://akismet.com/ and get one.
For the personal one you will get redirected to the WordPress signup. If you just
want the key for your application, choose the option Just a username, please..

After submitting the form, you’ll get an activation email. Click on the link in the email
to verify your email address. Then you will get another email, which contains your
user data and your Akismet key labeled with API Key:.

Get the Akismet API for Ruby

David Czarnecki has written a Ruby interface that you can use in your application to easily access the Akismet API.
Download the akismet.rb file from here:
http://soakedandsoaped.com/files/akismet.rb
and put it in the lib directory from your Rails application.
The filename has to be akismet.rb. (case sensitive!)

Create a little helper function

In your controller write a little helper function that checks comments for spam.
This could look like this:

 1 
 2   protected
 3   
 4   def check_comment_for_spam(author, text)
 5     @akismet = Akismet.new('< your Akismet key here>', '<your blog url here>') # blog url: e.g. http://sas.sparklingstudios.com
 6     
 7     # return true when API key isn't valid, YOUR FAULT!!
 8     return true unless @akismet.verifyAPIKey 
 9     
10     # will return false, when everthing is ok and true when Akismet thinks the comment is spam. 
11     return @akismet.commentCheck(
12               request.remote_ip,            # remote IP
13               request.user_agent,           # user agent
14               request.env['HTTP_REFERER'],  # http referer
15               '',                           # permalink
16               'comment',                    # comment type
17               author,                       # author name
18               '',                           # author email
19               '',                           # author url
20               text,                         # comment text
21               {})                           # other
22   end

Call the method before saving a comment

Your create method could look like this:

 1 
 2   def create
 3     @comment = Comment.new(params[:comment])
 4     unless check_comment_for_spam(@comment.author, @comment.comment_text)
 5       if @comment.save
 6         flash[:notice] = 'Comment was successfully created.'
 7         redirect_to :action => 'list'
 8       else
 9         render :action => 'new'
10       end
11     else
12       # Spam detected! Do something with the spammer.
13       flash[:notice] = 'Go away!'
14       render :action => 'new'
15     end
16   end

Test your spam protection

You can test your spam protection by trying to create a comment with author set to viagra-test-123
Akismet should always say that this is spam.

You’re done! Akismet is now watching at your comments and blocks spammers!

Help Akismet

Note that you can submit spam also! Use the submitSpam function of the API.

Ressources

Parse natural language date/time strings in Ruby with Chronic

written September 14 2006 by
{ Kommen }
Comments 1

Yesterday, while fighting against spam on the Ruby on Rails wiki, I came over a nice gem: Chronic

With Chronic you can easily parse natural language date and time formats into a DateTime object. You don’t have to mess around with regex to parse things manually. As gem, it’s easy to install and it’s also very handy to use.

Install it

$ gem install chronic
Thats it.

Use it

Put this in your model or controller file:


require 'chronic'


Then you can use Chronic.parse in your methods. E.g. Chronic.parse('tomorrow'),
Chronic.parse('monday', :context => :past), Chronic.parse('this tuesday 5:00')

Or more complex: Chronic.parse('3rd thursday this september'), Chronic.parse('3 months ago saturday at 5:00 pm')

And of course it can do a lot more! For a complete reference and more examples see chronic.rubyforge.org

Validate with it

 1 You can also use Chronic to validate malformed date strings:
 2 
 3 class Meeting < ActiveRecord::Base
 4 
 5   def validation
 6     errors.add :meeting_date, 'is not a valid date' if Chronic.parse(meeting_date.to_s).nil?
 7   end
 8 
 9 end

Ressources (Sites I’ve looked at and borrowed the code snippets) for writing this article

Install Mongrel on Ubuntu 6.06 Dapper

written September 13 2006 by
{ Kommen }
Comments 13

As I mentioned in my last post, RadRails 0.7.1 now supports Mongrel. So I decided to use Mongrel instead of Webrick for development on my notebook. But it was a bit tricky and took me a bit of googling to get it.

As Joe wrote in his post about installing Mongrel on MacOS X, I’ll describe how to install it on Ubuntu, assuming you already have Ruby and Ruby on Rails up and running.

Because Mongrel is partly written in C/C++ for more performance, you have to install the build-essential package. It will install all needed packages so that you can compile C/C++ applications.

sudo apt-get install build-essential
(You can also use the synaptic package manager to install it, if you prefer a GUI)

You also need the @ ruby1.8-dev@ package. When you try to install Mongrel without this installed, it will complain with this errormessage:
extconf.rb:1:in `require’: no such file to load — mkmf (LoadError)
from extconf.rb:1

Install the package with this command:
sudo apt-get install ruby1.8-dev

Then just use gem to install Mongrel:
sudo gem install mongrel —include-dependencies

Gem will ask you, which version of Mongrel you want to install. Choose the latest ruby verion.
Then you’ll see some output from the C/C++ compiler.


Ok, you’re done! Now you can start the server with mongrel_rails in your Railsapp directory.

NOTE: Even without the build-essential package installed, Mongrel will install and say that installation was successful. But when you try to start the server, you’ll get an error message like this:
** Starting Mongrel listening at 0.0.0.0:3000
/usr/local/ruby-1.8.4/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/
mongrel.rb:666:in `register’: undefined method `resolve’ for
nil:Mongrel::URIClassifier (NoMethodError)

State of Web Development 2006

written September 5 2006 by
{ Kommen }
Comments 0

SitePoint just released their results of a survey where over 5000 Web Developers participated.
They asked the developers which technologies they use and which they plan to use in the next 12 month.

Just one thing: It sounds promising for Ruby :)

You can download the PDF from the SitePoint hompage via:
http://www.sitepoint.com/report2006/

Migrations in Ruby on Rails

written September 5 2006 by
{ Kommen }
Comments 8

This is all about how to use Migrations in Ruby on rails to make your work even more productive.

I’m developing with Ruby on Rails since 8 month now, coming from Java and PHP.
But only a few days ago I discovered one powerful feature of Ruby on Rails: Migrations.

I think there are a lot of others (like I was) who develop with Rails, but don’t know how to use migrations and how helpful they are.

For those, here is a litte introduction.

This article is continued. Click to read more!

Exception Notifier - Ruby on Rails plugin

written August 31 2006 by
{ Kommen }
Comments 26

Yesterday I came over Exception Notifier.

I found it really useful because it is really easy to install and you can instantly react to Application Errors. Your customers don’t have to notify you because you get a bunch of information to track the error via email.

This article is continued. Click to read more!
You've reached the end of this page. Feel free to dig into the archives of this blog or subscribe to our newsfeed.