Skip to content

Commit

Permalink
skip haml / sass tests when they fail to load due to stupid bullshit
Browse files Browse the repository at this point in the history
Both haml and sass have the retarded behavior of trying to read a
VERSION file outside their lib directory. Installing haml or sass
like a sane person (i.e. into a shared lib directory) and they fail
on require with ENOENT.

Ugh.
  • Loading branch information
rtomayko committed Mar 16, 2010
1 parent 8a7dd92 commit e1638a4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/haml_test.rb
@@ -1,4 +1,6 @@
require File.dirname(__FILE__) + '/helper'

begin
require 'haml'

class HAMLTest < Test::Unit::TestCase
Expand Down Expand Up @@ -88,3 +90,6 @@ def haml_app(&block)
assert_match(/^<!DOCTYPE html PUBLIC (.*) HTML 4.01/, body)
end
end
rescue
warn "#{$!.to_s}: skipping haml tests"
end
6 changes: 6 additions & 0 deletions test/sass_test.rb
@@ -1,4 +1,6 @@
require File.dirname(__FILE__) + '/helper'

begin
require 'sass'

class SassTest < Test::Unit::TestCase
Expand Down Expand Up @@ -77,3 +79,7 @@ def sass_app(&block)
assert_equal "#sass {\n background-color: #FFF;\n color: #000;\n}\n", body
end
end

rescue
warn "#{$!.to_s}: skipping sass tests"
end

13 comments on commit e1638a4

@sr
Copy link
Member

@sr sr commented on e1638a4 Mar 16, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't remember how many times I did echo 42 > $RIPDIR/VERSION back in the Rip 1.0 era

@rtomayko
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speaking of, I have something to show you sr :) Give me a day or so and I'll ping you about it.

@rkh
Copy link
Member

@rkh rkh commented on e1638a4 Mar 16, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't creating a ticket/patch for Haml appropriate?

@rtomayko
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raggi
Copy link
Contributor

@raggi raggi commented on e1638a4 Mar 16, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

quite right too.

@josh
Copy link
Contributor

@josh josh commented on e1638a4 Mar 20, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should fork sinatra/haml, fix the issue and have sinatra depend on your fork until haml gets its shit together.

we'll be doing the same for rails. any gem that does stupid shit, we'll not depend on or fork our own rails/ version.

@rtomayko
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Problem with that is I don't want to maintain forks for all these gems over time. I'm accumulating a pretty big list. Almost all are reading some kind of VERSION file from the package root. I don't have a better idea, unfortunately.

@josh
Copy link
Contributor

@josh josh commented on e1638a4 Mar 20, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Many maintainers are intelligent people that get it. We only have to deal with a few stubborn people like haml.

Fixed 2 out of lib references today:

http://github.com/mperham/memcache-client/commit/c8ec03928eab469ddb77a744a082574f7a9dff73
http://github.com/svenfuchs/i18n/commit/b2f038663b55727ac2327e6f07a46ba5d69d600c

We should be activate about resolving these issues.

@raggi
Copy link
Contributor

@raggi raggi commented on e1638a4 Mar 20, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something seems wrong about telling people what to do with their file arrangements... I take it you guys are the ones that are right?

@josh
Copy link
Contributor

@josh josh commented on e1638a4 Mar 20, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raggi I don't care how people organize their stuff for development. They can use whatever tools they want. It becomes a problem when their development decisions affect my runtime.

@raggi
Copy link
Contributor

@raggi raggi commented on e1638a4 Mar 20, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's released as a gem, does it not work as a gem? who's fault is it, really?

@josh
Copy link
Contributor

@josh josh commented on e1638a4 Mar 21, 2010

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I talked with Nathan today. I think I have a possible fix: http://github.com/nex3/haml/issues/issue/105

@cldwalker
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, jeweler encourages keeping VERSION files outside of lib/ as all version-related rake tasks assume such a setup. It wasn't until 1.3.0 that jeweler didn't force this setup on a user.

Please sign in to comment.