Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conflict of constant ::Rails #1

Closed
sakuro opened this issue Aug 25, 2010 · 8 comments
Closed

conflict of constant ::Rails #1

sakuro opened this issue Aug 25, 2010 · 8 comments

Comments

@sakuro
Copy link

sakuro commented Aug 25, 2010

Haml refers toplevel constant Rails without :: in haml/util.rb to define rails_root and rails_env.

Unfortunately haml-rails defines a constant named Haml::Rails and this causes an error:
haml-3.0.17/lib/haml/util.rb:273:in rails_root': undefined methodroot' for Haml::Rails:Module (NoMethodError)

@indirect
Copy link
Member

Sadly, there is no way to fix this without patching Haml or renaming Haml::Rails.

Happily, nex3 has invited me to submit Haml::Rails as a patch to Haml itself, which should resolve that particular problem.

@sakuro
Copy link
Author

sakuro commented Aug 25, 2010

how nice!

@nex3
Copy link

nex3 commented Aug 25, 2010

Is it worth me fixing this in Haml, or is the integration going to happen quickly enough that it won't matter?

@indirect
Copy link
Member

Well, referring to the top-level Rails constant by ::Rails is always a good idea... Haml breaking if someone ever defines a Haml::Rails class seems not that great. I was planning on just adding that as part of my patch (which unfortunately looks like it's going to take until next week, sorry. Work deadlines snuck up on me.)

@dnagir
Copy link

dnagir commented Aug 29, 2010

Ops. Rails again breaks things :) What would be a temporary workaround?

@sakuro
Copy link
Author

sakuro commented Aug 29, 2010

s/Rails/::Rails/g in haml/util.rb of haml gem.

@sakuro
Copy link
Author

sakuro commented Aug 30, 2010

nex3/haml@1746cb1

@dnagir
Copy link

dnagir commented Aug 30, 2010

Thanks a lot.
Cheers.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants