dnagir / ruby-haml-js

HAML-JS Tile and Rails 3.1 Template
MIT License
86 stars 13 forks source link

hamljs processor broken? #14

Closed tblom closed 11 years ago

tblom commented 11 years ago

The gem appears to be broken in some way.

The example given in your docs (.comment div with two divs nested inside) does not produce the correct output -- the nesting does not work. Instead an empty .comment div is followed by the .author and .text divs.

dnagir commented 11 years ago

Reproducible example please?

tblom commented 11 years ago

Thanks for your response. I'm not certain on best practice to repro this for you, so I simply create a fresh rails app (rails 3.2.13), added the "haml" and "ruby-haml-js" gems to the Gemfile in the assets section, and created a simple template in javascripts/backbone/templates/test.jst.hamljs.

That template reproduces the example from your docs.

If you then navigate to localhost:3000 and look at the template that has been served (test.js) you will see that the "author" and "text" divs are not nested within the "comment" div as they should be -- the comment div is closed before the others are added.

template is here: https://github.com/tblom/hamljs_test/blob/master/app/assets/javascripts/backbone/templates/test.jst.hamljs

Here is the output template function, which you can see in the debug of the browser when the root page is served: (sorry, not sure how to paste formatted code, so here is an attached image)

screen shot 2013-09-01 at 10 53 37 pm

tblom commented 11 years ago

Sorry, did not mean to close the issue.

tblom commented 11 years ago

public github repo containing all source for the simple test rails project here:

https://github.com/tblom/hamljs_test

dnagir commented 11 years ago

I'd suggest to use 2 spaces for indentation instead of 2 tabs. That is the convention everyone is using.

If you'll still have problems then report it to https://github.com/creationix/haml-js - the official javascript implementation of HAML.

tblom commented 11 years ago

I don't understand why you have closed this issue.

I have followed your documentation, and provided a reproducible example in which your own example test template fails.

Your comment re: spaces vs, tabs -- I did not use 2 tabs, I used one, but the result is the same with 2 spaces.

I'll try elsewhere to find help, but I'd suggest if this gem is outdated and you're not willing to look at issues, it may be best to discontinue hosting it.

dnagir commented 11 years ago

The issue is closed because the problem isn't related to Ruby gem implementation and lays somewhere in the original HAML-JS one (which I do not maintain).

But I suggested you a potential solution. Do the following:

Did you try those things? Did it work?

With your winging attitude, not listening to what is being told, I don't have an incentive to help. You are always free to submit a pull request with a fix if you know much about working on OSS projects.

All the best.

tblom commented 11 years ago

Hi Dmytrii -

As stated in my last response I tried your "two spaces" suggestion and it made no difference.

When you asked for an example to repro, I gave one.

So I was surprised to see you close the issue. It isn't obvious to me the issue is with haml-js, but I'll give that a try.

I only expected a bit more information from someone hosting a gem. Sorry to offend.

-Thomas

On Sep 2, 2013, at 7:20 PM, Dmytrii Nagirniak notifications@github.com wrote:

The issue is closed because the problem isn't related to Ruby gem implementation and lays somewhere in the original HAML-JS one (which I do not maintain).

But I suggested you a potential problem. Do the following:

Did you try those things? Did it work?

With your winging attitude, not listening to what is being told, I don't have an incentive to help. You are always free to submit a pull request with a fix if you know everything.

All the best.

— Reply to this email directly or view it on GitHubhttps://github.com/dnagir/ruby-haml-js/issues/14#issuecomment-23683981 .