-
Markdown
2007-06-16 I finally got around to installing the Markdown plugin for Wordpress, which I really should have done earlier.
Markdown is my favorite text format, clean and readable. Read up on the Markdown syntax to understand why.
-
Not speaking at RailsConf Europe
2007-06-15 I just got a mail confirming that I will not speak at RailsConf Europe this fall. I had submitted a proposal named “Version Control in Rails using Mercurial” which was going to show the benefits of using a distributed version control system when developing a Rails app. My opening line would have been “Hi, I am Marcus and I have been Subversion free for six months”.
For some weird reason, so many people in the Rails community - and the open source community as whole - still talk about Subversion as something great. It is not. Subversion is decent at best if you are comfortable knowing that you are using second or third best tools, but believe me, it is a crap choice knowing the alternatives in distributed version control.
-
Stockholm is not Portland
2007-05-18 Sitting in Stockholm reading blogs, it feels like being home on a friday night knowing that there is a great party going on and you are not going.
-
Ruby DSL's vs YAML vs XML
2007-05-14 I am using Ruby based DSL’s for a number of tasks in my current project. But one day it struck me - am I using the right tool for the job, could there be a better, more simple solution?
Some DSL’s I use are simply declarative and look something like this:
quiz "Let's ask stuff" do question "What is 1+1?" do alternative "2", :correct => true alternative "3" end question "Vad is 2+3" do alternative "1" alternative "Infinity" alternative "Don't know" alternative "5", :correct => true end end
I find that quite readable, but it requires me to maintain code that handle the DSL. So I figured, what if I used YAML? It is simple, and using it would mean less code to maintain.
-
Neal Ford: Static Typing is Communist Bureaucracy
2007-05-09 Last time I quoted Neal I for some reason ended up on TheServerSide
- why they did not link to Neal directly is beyond me. Oh well, he is obviously on a roll, I totally love this one:
(Via Planet TW.)
-
Rails, PostgreSQL and Time
2007-05-09 I just noticed that the mapping between PostgreSQL’s Time Without TimeZone column type maps to Rubys standard Time class. Which gives the following behavior in script/console:
:::ruby >> t = TimeEntry.find(1) >> t.time => Sat Jan 01 23:00:00 +0100 2000 >> t.time = Time.now => Wed May 09 19:02:07 +0200 2007 >> t.save => true >> t = TimeEntry.find(1) >> t.time => Sat Jan 01 19:02:07 +0100 2000
Am I very anal to find this … sloppy?
-
Why the Term 'Architect' Doesn't Cut It Anymore
2007-04-30 Some time ago, there was a lengthy debate on the Agile Sweden mailing list regarding the term “Architect”, and what it means. My position is that the term has become synonymous with the paper or PowerPoint architect, and I therefore try to stay clear of it. Other people haad other opinions.
Neal Ford has changed his title, and describes why in a brilliant way:
Neal Ford: From Architect to Wrangler: […] “The title of ‘Architect’ for software developers has gotten so diluted that its meaningless anymore. In fact, its almost pejorative because so many ‘paper’ architects give it a bad name. I’ve gotten ‘Oh, dude, I’m so sorry’ looks from people when I tell them I’m an architect, assuming that I’ve had a head injury or something and can’t do real development work anymore.
-
has_many :through and callbacks
2007-04-27 Reading this a little bit earlier would have saved me a lot of time. In short: callbacks such as
:before_add
does not work withhas_many :through
, and the documentation does not tell you that. To get callbacks, add them to the join model. -
Another Mercurial Convert
2007-04-17 Paul Duncan is another Mercurial convert, and explains his choice of VCS very well
-
RSpec, Autotest and views
2007-04-17 The current incarnation of autotest seems to assume that you are using integrated views. If not, you can modify the rspec_rails_autotest.rb file to run the view specs as well:
:::ruby # when %r%^app/views/layouts/(.*)\.rhtml% then # ["spec/views/layouts/#{$1}_spec.rb"] when %r%^app/views/(.*)\.rhtml$% then ["spec/views/#{$1}_view_spec.rb"]
Your view spec must be postfixed with “_view_spec.rb” for it to work
Update This works out of the box now.