[rspec-devel] discovering rails version

David Chelimsky dchelimsky at gmail.com
Sun Apr 22 01:33:34 EDT 2007


Hi all,

Edge rails has been using new template extensions (.erb instead of
.rhtml), which means that Spec::Rails' generators need to find out
what version of rails you are running so it can do the right thing. A
couple of weeks ago, Rails::VERSION::STRING was returning 1.2.0 in
edge. Ironically, rspec was able to use that information temporarily
to distinguish edge from the published versions, since 1.2.0 was
retracted when 1.2.1 was released.

So I posted a request to rails trac () to change the version number to
something larger that 1.2.3 so the generator can ask if
Rails::VERSION::STRING <= 1.2.3 to decide what kind of template to
generate.

As it turns out, a change to the version was committed in the last few
days. Unfortunately it was changed to 1.2.3, which means that the real
1.2.3 AND edge (the imposter) are both identifying themselves as
1.2.3, which means that Spec::Rails' generators can't know to do the
right thing for edge, which means that rspec:pre_commit fails against
edge unless you manually change railties/lib/rails/version.rb to say
1.2.4. I've done this locally, but since we don't commit rails to
rspec's svn, if you're doing any work on rspec you'll have to make
this change locally to get pre_commit to pass edge rails.

So I posted an additional plea (with a patch) to rails trac to make
the version 1.2.4, but I understand that the rails team is busy and
don't expect this to be fixed very quickly, if at all.

So - any suggestions as to a different way of determining the rails version?

Thanks,
David


More information about the rspec-devel mailing list