Subversion 1.4.4 upgrade
Adam had recently got a MacBookPro. We no longer have to mess with InstantRails on Windows. It also means he can use native Subversion and SVK. However, the OSX-native package uses Subversion 1.4. Our servers uses Subversion 1.3.x. To be fully compatible, that would mean compiling a custom copy of Subversion 1.3.
After reading about the feature additions for Subversion 1.4, I decided it would be much easier for me to upgrade the server and my dev laptop to 1.4. Gentoo masks 1.4.4, but most Subversion upgrades are fairly transparent. There are two main benefits from the upgrade I wanted. Subversion 1.4 claims to be better at storing and transmitting binary data. We version a lot of raw data, so this would work out well. Subversion 1.4 also has a svnsync command that works like SVK's svn mirroring. It lets you move or clone a repository. Maybe Linus Torvald's acerbic comments about Subversion has been getting noticed.
Gotcha: Defining a controller action called 'process'
Early in the morning on #rubyonrails, someone came into channel asking for help. He said that, inexplicably, on controller out of his several controllers stopped functioning. When asked for a log, he gave this pastie.
This is very puzzling. I even looked at the code around line 330 in ActionController:base
327 class << self
328 # Factory for the standard create, process loop where the controller is discarded after processing.
329 def process(request, response) #:nodoc:
330 new.process(request, response)
331 end
When asked about what his controller looked like, he gave this pastie.
Can you spot the error?
Rails BugTracker
I just cracked open a Rails Bug Tracker. The screenshots look good, and the project looks mature. I've been shopping for a native Rails bug tracker for use with our company, Isshen, LLC. This project looks like something I can quickly install and start using, despite its status as "Beta" on Rubyforge.
Suspicion first filled me when I saw that the project had a "Win32 source" download. That does not make any sense. A Rails app is fairly OS-agnostic. The download is distributed in a zip file. When opened, the source itself is packaged as a RAR. And there was a database.sql schema.
The schema was bad. It looked like something I would have written before I encountered Rails. There were three migration scripts in the Rails source. There was one that says "create_object". Huh?
Curious, I opened up app/model. No dice. There were three models ... and a file called mysqlconnection.rb. Why would a Rails app need that for? I got real suspicious.
And this suspicion was confirmed when I looked at the controllers. Each controller action would create a new mysqlconnection, generate the SQL query on the fly, and then render the template.
Essentially, the Rails Bug Tracker is a superficial port of a PHP program. And that PHP program wasn't even written using MVC architecture.
Wow.
Friends in business
My good friend James Hill, owner of Libre Systems, Ltd. in Manchester, UK sent me this article about his recently-established, growing Taxi Academy. He started this with Kashef Ahmed when they discovered the shortage of taxi drivers. At the time, James was working on a related startup idea -- that's another story to tell.
Contrary to what the article says, James doesn't actually drive a cab. His day job involves working as a system admin for a Manchester ISP. From across the Atlantic, we more or less egged each other on to form our startups. Like a number of other entrepreneurs, we didn't actually get to where we had set out to go. We meandered -- going through partners, products, and services. Seeing your friends grow keeps you on your toes -- you congratulate them and share in their success, while at the same time moving forward with your own plans so that you won't embarrass yourself in front of your peer.
About a month ago, he has asked me to help him complete an internal CRM for his Taxi Academy. He wanted it done in Rails, and got stuck on a particularly hard has_and_belongs_to_many join. In retrospect, I could have used a has_many :through association. while it is not much to look at, I wrote it in about three days.
I also got a ping from my local friends, UG Wilson and Travis Warlick of Operis Systems, LLC about Ruby Rock Stars. And from there, a short hop to RentACoder where I started picking up projects -- including the about-to-be completed modification to Typo called Flouzo.
A year and a half ago, I discovered Paul Graham's seed funder, YCombinator. I devoured his writings. I've since stumbled across people who severely disagree with his opinions, though I don't think they are people who have sold a company for $49 million. Paul Graham places a great deal of weight on who is founding the company with you, and where you are located. If the environment is saturated with startups, you're much more likely remember why you even tried at all, as you stare into the LCD screen full of code with grit-filled, hyper-caffeinated, severely-dehydrated eyes at 4 in the morning. It is for that, I'm grateful for my friends in business.
Useful tricks with script/console
One of my favorite tools for Rails is script/console. It lets me test out snippets of code to make sure things work the way they are supposed to work. I found two useful things this morning:
Tab completion
Tab completion works in script/console.
script/console
user = User.find :first
user.up[tab]
You have no idea how happy that makes me.
reload!
After I found out about tab completion, I found myself making some heavy code changes, and testing them out in the console. I kept having to quit and restart the console. Out on a lark, I hit 'r' and hit tab ... and found 'reload!'. I always wanted that command, but I had thought it was 'reload' not 'reload!'. Go figure.
Rails Plugins
This was brought up at #rubyonrails -- someone's idea of the top 11 Rails plugins.
There are a few missing from there:
Technoweenie (Rick Olsen)'s acts_as_authenticated and restful_authentication. These plugins do not tell you how to authenticate anything. Rather, you install the plugin then generate authentication code. From there, you modify it as you see fit.
Technoweenie also wrote attachment_fu
Rather than acts_as_taggable, I use acts_as_taggable_on_steroids, which is based on acts_as_taggable. Neither supports multiple tags per model, and the acts_as_taggable_on_steroids author invited me to write a patch, should I write one.
The largest repository of Rails plugins I've found is located at http://agilewebdevelopment.com/plugins.
How to do http + ssh with Subversion on Windows
Ruby beautifier
I use jEdit for Ruby on Rails development. I only need three things from it:
- Project Viewer / File tree panel (like on TextMate)
- Search in directory. The "find" command is OK, but the jEdit HyperSearch will take me directly to the line number in the file.
- Autoformatting and autoindenting.
I am not particular to syntax highlighting. I don't need to have integrated SQL, log windows, or Subversion/SVK integration -- I use Tilda, a drop-down Gnome terminal bound to function keys.
jEdit 4.2final does (1) and (2) well. It does not do (3) well. I may get fed up enough to find a new editor soon to work with Ruby on Rails. Now, I can work with the broken autocompletions, but I have difficulty working with the broken autoindents. It looks fine when I see it in jEdit, but the resulting text does not output correctly. Probably because I did not set the indent options properly. Update: Yep, need to set "soft indent" and emulate indents with spaces.
Fortunately, there is a command-line script that will beautify Ruby scripts. It may not work in all the weird cases, but I can bind it to a rake task and apply it to the entire app/ directory.
LightBox
Someone at #rubyonrails mentioned LightBox, a Javascript library for doing in-page popups. It looks nice and gaudy -- I may replace the less flashy in-page popup we have on our Calendar app.
I'd definitely change the style a bit. I can't stand the Web Tweeny-bopper look.
Branching and Merging with SVK
Originally posted on a private mailing list.
Talking with a guy on #ledgersmb, I asked him about how well SVK and SVN worked together. I had previously used SVK for disconnected commits, but had not had the nerve to set up an SVK server.
It turns out, you don't need to set up a SVK server, per se, to take advantage of SVK's branching and merging.
Older posts: 1 2