links for 2008-06-06

Friday, June 6th, 2008

links for 2008-05-24

Saturday, May 24th, 2008

links for 2008-05-16

Friday, May 16th, 2008

links for 2008-04-04

Friday, April 4th, 2008

Rails is moving from SVN to Git

Thursday, April 3rd, 2008

A year ago I was frustrated over Rails’ close ties to Subversion. But as Rails is moving from SVN to Git, the future is looking bright. The only bastion left I can think of is RubyForge.

Things I Have Actually Used

Monday, March 31st, 2008

Robby Russell is a constant source of information on Ruby and Rails, I have used his instruction on how to set up Rails and PostgreSQL on Mac a number of times. It is therefore fun to see that I have actually used 3 out of the 5 things he wants to know more about::

RSpec User Stories

We were very early adopters of this one, we started using it the same day it hit trunk in a useable form. Everyone should start using it today - I cannot speak highly enough of it. The only thing I miss is a Fit-style table approach to rules, but I have my own thoughts about that one.

Using Selenium with RSpec

We have used the now outdated spec/ui library at WeMind. Today we use RSpec Stories almost exclusively for acceptance testing. My position is to use Selenium only where you really need it, for example to test Javascript functionality.

JQuery

I have used it for the dynamic hiding of speaker info for Agila Sverige. Not at all enough to judge a library by, but it feels a lot sweeter than Prototype/RJS.

JSSpec (BDD for Javascript)

Yeah, I wanna know more about this as well.

Using the Google Charts API with Rails

Same here.

Other than that I would love to try out:

  • Seaside - I have dabbled with it but nothing worth mentioning.
  • CouchDB

Google spidering, page caching and absolute links

Friday, March 14th, 2008

We just deployed this weeks release of Somnklubb.se. Right after deploying I clicked through the site to see that everything seemed OK. After a while I noticed that all links referred to our site by IP-address. Why was that?

This site has been deployed weekly for a good nine months without any problems, so there had to be something new. We called Mathias at our most awesome hosting partner GlobalInn to see if he had made any changes to the server. He had not. We started diffing routes.rb et al, to see if we had by any chance tripped up anything.

The anchor tags containing the links were all generated by link_to using named routes - the _url version. We have done this out of bad habit, we should of course use _pathversion that generates relative url’s instead. But I did not want to change that right before a release, and I still wanted to know what caused the error.

Mathias and I discussed the different sources of errors. Finally it dawned on us: the pages are all page cached and the host name has to come from the incoming request. Meaning, if the first request to hit the page will create the cached page. If it accesses the site using the IP-address, all links will be cached using the IP address. But who uses the IP address? And what had changed since the last deploy?

Last week we started using Google Analytics for this site, and supposedly the Javascript on the page causes their spiders to start crawling fast enough to be the first one on the page after a redeploy. Using the IP address.

So the lesson learned is to use relative links, especially when page caching.

The Lazyweb

Thursday, March 6th, 2008

Yesterday I twittered that I was trying to find a version of Ruby that both cc.rb and Rails likes. Last night, Wordpress plugin Twittertools posted yesterdays twitters to this blog. And this morning, I have an answer from Alexey Verkhovsky what the good versions are. Gotta love the lazyweb.

How To Automigrate the Test Database Using Merb, Datamapper and RSpec

Saturday, February 16th, 2008

I am creating a small site using Merb, DataMapper and RSpec, all in all a very enjoyable experience. I did however have problem getting the test database to be automigrated when running the specs, as I am used to in Rails.

As Google did not help, I turned to #merb on IRC, and got immediate help.

Two alternatives:

  1. Run rake MERB_ENV=test dm:db:automigrate before running rake specs
  2. Insert DataMapper::Base.auto_migrate! into your spec/spec_helper.rb

Big thanks to topfunky, afrench and jdempsey for the help.

git Is Winning The DVCS Battle With git-svn

Saturday, February 9th, 2008

I’ve been using distributed version control for over a year now, and if it is up to me, I will never use a centralized VCS again.

When I evaluated the alternatives last year, I choose Mercurial as the DVCS we are using at WeMind. The reasons were:

  1. Usability - git was quite obscure back then
  2. Speed - bazaar and monotone was quite slow
  3. Large enough uptake - OpenSolaris and Mozilla started using Mercurial at the same time.
  4. Runs on all platforms, if we ever employed someone who wants to use Windows
  5. Built in Python which could be a good think if I ever wanted to extend it

A year later we are happy with Mercurial, but the landscape has changed. In particular I am seeing a huge growth of people using git, especially within the Ruby community. Which in itself is something I am happy about.

The biggest reason I see for git’s resurgence is git-svn. It allows people to start using git locally while still having Subversion as the backend, and when everyones ready the switch is easy.

There is a hgsvn in the Mercurial world, but it is read only, so you cannot push your changes back to Subversion. I strongly believe that the Mercurial community should focus on this if it wants to regain its momentum.

Git still has weak support for Windows, but that seems to be a non-issue in the Ruby world.

I am pretty agnostic about which DVCS will be the dominant one. The most important thing is that people are moving away from the centralized VCS’s.

For a great post on the subject, read what Dave Dribin has to say about it

links for 2008-02-06

Wednesday, February 6th, 2008

links for 2008-01-16

Wednesday, January 16th, 2008

links for 2008-01-11

Friday, January 11th, 2008

Tool Support Should Be Loosely Coupled

Monday, December 17th, 2007

I just read the following in a month old post on the RSpec list:

As someone who uses an IDE, I find dealing with multiple SCMs is a real
pain, and one of the cool things about Ruby has been that
(traditionally) nearly everything’s in Subversion

It might be that Rails will have hard time keeping up with new stuff, both technically and culturally, since it tied really close knots with everything that was cool 2005.

Choice Is Good

Thursday, December 13th, 2007

I was happy to note that Dion Almaer commented on my blog post on Merb. Dion is one of my favorite bloggers/podcasters and I value what he writes highly.

But I disagree with him on this one. The problem with using Java for web application development was never one of too much choice. In fact, it was because of that choice that Java became a player in the server side market at all. Sun alone never had the answer to what was needed for server side development, instead the open source world stepped in and made incremental corrections.

The same thing is happening to the Rails world. The core team cannot create a framework that is a one-size-fits-all. The initial Rails proposal is great for a large number of webapps, but it is other things around it like plugins and JRuby that is making Rails a viable choice for all.

My Java tools of choice was usually Tomcat/Jetty, FreeMarker, iBatis, WebWork tied together with Spring or PicoContainer. What I hated was having some frankensteinian-enterprise-architect-design-by-comittee-lets-not-be-different stack forced upon me with a fullblown J2EE server, EJB’s, Struts or the JSF monster, sprinkled with an Eclipse-only development environment. And I hope dearly that Rails development is not going the same way where people question you on your choice of tools and wonder why you are not using MySQL and TextMate like the rest.

There is one choice that I do not miss though - directory layout. I am truly happy every time I do not have to choose it.

Instead of not having to choose, the most important difference I’ve experienced is that Java as a language together with the Servlet/J2EE spec induces a lot of accidental complexity, which is almost non-existent in the Ruby/Rails world. It is that which enables the increased velocity many development teams experience when switching to Ruby.

Rails Marketing Is Really Good

Saturday, December 8th, 2007

DHH’s post about the Rails 2.0 is incredibly well written. It is almost as he is showing off a unknown past as a PR agent when he talks about Rails not supporting commercial databases out of the box:

But that doesn’t mean the commercial databases are left out in the cold. Rather, they’ve now been set free to have an independent release schedule from the main Rails distribution.

This sort of well formulated marketing has been known to render some sour remarks from the rest of the open source web framework world. My belief is though that when they ask themselves “Why are people so attracted to Rails, my framework of choice is just as good or even better”, sentences like the one above are probably a large part of the answer.

Merb, Leaner And Meaner Than Rails

Saturday, December 8th, 2007

I have used Rails on a daily basis for almost a year now, and before that I was a night time hangaround. While I am definitely a happier programmer using Rails than anything built on Java, I still feel that it can get better.

First of all I want more things to be plugins. And really, they should not be plugins at all but gems instead.

Why plugins? We use RSpec instead of Test/Unit, HAML instead of erb and are seriously looking into JQuery instead of Prototype. And of course, we are using Mercurial instead of Subversion. All of this is of course possible to use in Rails, but a lot of things are sort of made for the default choice, such as generators generating tests, and plugins having the -x switch for Subversion. And I am pretty sure that this is the way DHH wants it.

So, when 2.0 is now released, I see that the Rails community as a whole does not see the same problems as I do. If they did, they would have done more like the stuff above, instead of sexy migrations and ActiveResource.

This is where Merb becomes really interesting. I have looked at it before not understanding its value, but now I see a framework that does everything I want Rails to do. Gems as plugins and very agnostic about templating languages, Javascript frameworks and even ORM frameworks - almost a heresy in Rails. I will definitely think about using it instead of Rails in the future.

links for 2007-10-10

Wednesday, October 10th, 2007

links for 2007-09-26

Wednesday, September 26th, 2007

Delphi and JBuilder as role models for Rails development?

Thursday, September 20th, 2007

Chatting over a beer with Ola Bini last year, we discussed the possibilities for JRuby. My dream was to run a Ruby IDE on top of JRuby to get a Smalltalk like environment, because Smalltalk is still the best programming environment I have ever used.

Now that 3rdRail, running on JRuby, is released, should I get my hopes up? Some people are actually very excited about it, but when Delphi and JBuilder are referred to as some sort of pinnacle of development it seriously makes me wonder.