I did some profiling and benchmarking of couchdb and ruby.

The sad conclusion from my tests is that right now, all current ruby couchdb libraries are only useful in low-traffic or dev environments.

The culprit is Net::HTTP. In short, it's unbelievably slow. (we're talking two orders of magnitude compared to direct hits via ab).

Read the rest of this entry

This is cross-posted as a comment on YC news. This post has some additions/edits.

Here's why I love ramaze: multi-app, multi-db app, ~50 lines, one file, zero proprietary plugins, rake tasks, generators, etc. No bending of the framework whatsoever. Use require, use modules, pure ruby, pure joy. :)

Here's the code:

Read the rest of this entry

Prelude

I want to start out this post with a big thank you to Jeremy Evans, the author of Scaffolding Extensions (SE) and the maintainer of the Sequel ORM. He is an exemplar of an OSS project leader. I've contacted him regarding both SE and Sequel via forums, bug trackers, irc, mailing lists, and on every single occasion, he's been extremely responsive and helpful. These are big reasons to use software he's involved with, especially in the often "just read the source and specs" Ruby documentation culture. (In fact, he should publish what he does to run his projects so that other OSS project owners can learn from him).

Scaffolding Extensions rock

Scaffolding Extensions rock for developing apps and for building admin interfaces (or even for allowing users to edit only their own data). They are very ORM and web framework agnostic, and offer powerful and flexible customization options. There are, however, a few pitfalls when you start using SE.

Read the rest of this entry

...and a valuable programming lesson

Preface

This post got longer than anticipated, because I refactored my code in the middle of writing this very post. The refactored code is at the bottom. Explanations are carelessly strewn about.

Main

I was going to write a post about how great Ramaze is and about how I have some ideas for coding conventions that could help with code reuse, sharing, and multi-app capabilities without requiring any new framework-specific code.

But not now - I need to write shorter posts to get some writing out the door at all. Therefore, I'm just posting some code that implements a simple (primitive?) content management system to keep any site copy in markdown (or textile) format.

Read the rest of this entry

Many websites are composed of several fairly independent apps that would still benefit from tighter integration than running them as separate apps. Here's a typical site: core site, forum, blog/cms (or photo management app, etc).

The typical Rails response to multi-app integration is one of the following two: 1. "Just run them as separate apps on different subdomains and share the database." or 2. "Use the app as the base and add your own code to it." I have integrated several Rails apps, and it is dirty and inefficient, a real pain in the ass, especially compared to the joy of doing most other things with Ruby/Rails. The failure of multi-app Rails is documented by the plethora of hacks used to emulate multi-app behaviors: generators, engines, appable plugins, and the multi-app routing plugin.

The point of this post is not to rip on rails, it's just what I'm primarily using, and I would love to see other Ruby web frameworks such as merb, ramaze, and the micro-frameworks think about multi-app while they can still make major changes. Ruby is powerful enough to elegantly enable multi-app configurations.

Read the rest of this entry

I was so excited to play around with merb again. I just checked, and the first version of merb I used to prototype an app was 0.0.8 about a year ago. But I was so bummed out that after wanting to be all proper and upgrading all my gems, merb stopped working, no errors, no logs, no debug info, nothing.

After asking on IRC (impossibly late at night) without any luck, I dove into the (beautifully clear and manageable) source and figured out that the ‘parsetree’ gem was required, but not installed. So a quick sudo gem install parsetree, was all that I needed, and I’m back in business.

After I realized that parsetree was to blame, a quick search brought up the same problem addressed and solved on the Ruby mailing list: http://www.ruby-forum.com/topic/132766. But without knowing that the problem is parsetree related, how would you find this post. So again, for the crawlers merb 0.4.1 stops after “Compiling routes..”

I can’t wait to get some real work done now. :)

After an extensive hunt for a low-hassle solution for testing my local development rails applications in Internet Explorer using Parallels, I finally found this post.

This is by far the most straightforward way and clearest writeup to get this development plumbing out of the way. It uses Bonjour for Windows so that you can access your rails apps with something like mymachine.local:3000. Done! Now back to actual coding.

Subtlety is a beautiful thing. Just enter the repository’s url and add the resulting subtlety link to your feed reader. I’ve never enjoyed reading changesets so much. I actually follow projects now without missing anything.

I was running a mysql 4.1 db that kept screwing up my unicode, so I decided why not double version numbers and move to postgresql 8.2. Great idea in theory, but a pain in the ass in practice. The sql dumps of the different DBMS are incompatible, especially booleans causing trouble. The scripts I found were pretty much useless, so I was stuck until I came across the idea of using rails to export the db to yaml and then re-import it into the new db.

Read the rest of this entry