scm and haml

7 views
Skip to first unread message

Matt Harrison

unread,
Dec 26, 2008, 7:57:49 PM12/26/08
to ha...@googlegroups.com
Hi list,

This isn't a big problem but I've been curious about this for a while now.

I've got haml installed on a number of projects, all hosted in svn
repos. Every now and then, the vendor/plugins/haml/init.rb will show
changes and want to be committed, and I can't work out why.

A typical diff from svn will show something like this:

Index: vendor/plugins/haml/init.rb
===================================================================
--- vendor/plugins/haml/init.rb (revision 92)
+++ vendor/plugins/haml/init.rb (working copy)
@@ -4,5 +4,4 @@
require 'haml' # From gem
end

-# Load Haml and Sass
Haml.init_rails(binding)


Now I can see what is changed, but I have no idea why. This usually
happens around every 10 commits, not that that helps much but it shows
it's not constant and it's not rare.

I've taken to writing commit logs like "HAML doing it's thing" which
make me smile, but would probably confuse anyone else hugely.

Does anyone have any ideas about why this happens? Am I the only one
this happens to or do other people see this?

Thanks and happy holidays,

Matt

Evgeny

unread,
Dec 26, 2008, 8:06:17 PM12/26/08
to ha...@googlegroups.com
I noticed this too, and the cause I think would be different HAML versions. Perhaps you have a frozen gem and a locally installed one, or something?

Matt Harrison

unread,
Dec 26, 2008, 8:11:36 PM12/26/08
to ha...@googlegroups.com
Evgeny wrote:
> I noticed this too, and the cause I think would be different HAML
> versions. Perhaps you have a frozen gem and a locally installed one, or
> something?

Well I'm glad I'm not the only one to have seen this :)

According to "gem list --local":

haml (2.0.2)

Is the only version installed. I do have some frozen gems, but they
aren't haml (calendar date select and will_paginate).

Ah, I've just thought...I do have Ruby Enterprise Edition installed next
to the standard ruby on my solaris box. The REE installation does happen
to have haml 2.0.6 installed.

But: I only got REE installed this week, and I've been having the
problem for....ever since I first used haml with rails, whenever 2.0.2
came out.

I'm uninstalling the 2.0.2 from the standard ruby install and see how
that goes.

Thanks

Matt

Matt Harrison

unread,
Dec 26, 2008, 8:23:35 PM12/26/08
to ha...@googlegroups.com
Unfortunately, that didn't work.

I removed the old 2.0.2 gem and commited "haml doing it's thing" for
hopefully the last time. Then I did a revision or two fixing some page
layout problems. Now however haml is back, this time with exactly the
opposite change:

Index: vendor/plugins/haml/init.rb
===================================================================
--- vendor/plugins/haml/init.rb (revision 97)
+++ vendor/plugins/haml/init.rb (working copy)
@@ -4,4 +4,5 @@


require 'haml' # From gem
end

+# Load Haml and Sass
Haml.init_rails(binding)

It seems weird for haml to keep adding and removing a single comment
line, whatever the reason...but maybe I've just been having too much
xmas alcohol :P

I'll leave it for now and see if anyone has an idea and proves me too
drunk for rails work :D

Thanks

Matt

Nathan Weizenbaum

unread,
Dec 26, 2008, 9:25:52 PM12/26/08
to ha...@googlegroups.com
Whenever Haml notices a discrepancy between the init.rb file stored in the gem and the init.rb file installed in the Rails application, it updates the installed file. This helps make sure that Haml is always loaded properly. init.rb isn't changed very often, though (one change was added prior to 2.0.0 and another, the comment in your patch below, prior to 2.0.4) so the only explanation that I can come up with is that you're occasionally loading different versions of the gem. I'd reccommend making sure you only have the most recent version (2.0.6) installed anywhere.

- Nathan

Matt Harrison

unread,
Dec 27, 2008, 1:48:52 PM12/27/08
to ha...@googlegroups.com
Nathan Weizenbaum wrote:
> Whenever Haml notices a discrepancy between the init.rb file stored in
> the gem and the init.rb file installed in the Rails application, it
> updates the installed file. This helps make sure that Haml is always
> loaded properly. init.rb isn't changed very often, though (one change
> was added prior to 2.0.0 and another, the comment in your patch below,
> prior to 2.0.4) so the only explanation that I can come up with is that
> you're occasionally loading different versions of the gem. I'd
> reccommend making sure you only have the most recent version (2.0.6)
> installed anywhere.

I've just done

% find / -name *haml*

And that has shown something. There are still files in
/var/ruby/1.8/gem_home relating to haml, even though I have uninstalled
the gem for haml from that ruby installation. I am removing all that
rubbish and I'll see how it goes.

Incidentally, there are some other haml gem installations but they are
frozen and specific to other applications that are hosted on the same
dev server. Could those unpacked gems be interfering even though they
are inside another app's vendor/gems directory?

Thanks

Matt

Matt Harrison

unread,
Dec 28, 2008, 8:02:17 PM12/28/08
to ha...@googlegroups.com
Matt Harrison wrote:
> Nathan Weizenbaum wrote:
>> Whenever Haml notices a discrepancy between the init.rb file stored in
>> the gem and the init.rb file installed in the Rails application, it
>> updates the installed file. This helps make sure that Haml is always
>> loaded properly. init.rb isn't changed very often, though (one change
>> was added prior to 2.0.0 and another, the comment in your patch below,
>> prior to 2.0.4) so the only explanation that I can come up with is that
>> you're occasionally loading different versions of the gem. I'd
>> reccommend making sure you only have the most recent version (2.0.6)
>> installed anywhere.
>
> I've just done
>
> % find / -name *haml*
>
> And that has shown something. There are still files in
> /var/ruby/1.8/gem_home relating to haml, even though I have uninstalled
> the gem for haml from that ruby installation. I am removing all that
> rubbish and I'll see how it goes.

Well clearing out the files from old gems that weren't removed when the
gem was uninstalled seems to have done the trick :)

I will have to remember in future that uninstalling a gem does not
remove all traces, but at least it appears I've got that annoyance silenced.

Thanks for the hints

Matt

Evgeny

unread,
Dec 29, 2008, 4:29:55 AM12/29/08
to ha...@googlegroups.com
You mean it leaves traces even after you do "gem clean" ?
Reply all
Reply to author
Forward
0 new messages