awinogradov / bem-on-rails

BEM methodology for Rails applications
65 stars 7 forks source link

Block and Mods generated in different folders #14

Closed richardpeng closed 9 years ago

richardpeng commented 9 years ago

When I run:

thor bem:create -b test

I get assets generated in the 'bem' folder:

  create  bem/myapp/test/test.html.haml
  create  bem/myapp/test/test.css.sass
  create  bem/myapp/test/test.coffee
  create  bem/myapp/test/test.md
  append  bem/myapp/.bem/assets/stylesheets/level.css.sass
  append  bem/myapp/.bem/assets/javascripts/level.js

But when I run:

thor bem:create -b test -m large

The assets are generated in the wrong folder 'mods':

  create  mods/myapp/test/mods/_large/_large.html.haml
  create  mods/myapp/test/mods/_large/_large.css.sass
  create  mods/myapp/test/mods/_large/_large.coffee
  create  mods/myapp/test/mods/_large/_large.md
  append  bem/myapp/.bem/assets/stylesheets/level.css.sass
  append  bem/myapp/.bem/assets/javascripts/level.js

The uncommented line in bem.rb is:

BEM[:level] = BEM[:app]

What am I doing wrong?

awinogradov commented 9 years ago

This is not bug, man. This is another conception. This right. When i was write this i think this conception will be better, because many mods in plain list look like trash:) now i do not think so. And bem-on-rails have issue #3 for compatibility with canonic BEM conception.

richardpeng commented 9 years ago

Shouldn't the mods be generated under the bem root folder like this?

create  bem/myapp/test/mods/_large/_large.html.haml

and not like the above:

create  mods/myapp/test/mods/_large/_large.html.haml

When I run the rake task, I get these lines in level.css.sass:

//= require ../../../../myapp/test/test.css.sass
//= require ../../../../myapp/test/bem/large/large.css.sass
awinogradov commented 9 years ago

Oh! I understand! Can you share your env? I test on it in the next few days.

richardpeng commented 9 years ago

I'm using Mac OSX 10.10.1, ruby-2.1.3, rails 4.1.6

awinogradov commented 9 years ago

Ok, i test it. Now you can create folders by your hands :)

awinogradov commented 9 years ago

I apologize for the long wait, but I can check all only on weekends

awinogradov commented 9 years ago

Hey, @richardpeng ! I catch it:) Sorry for long time testing. I have many work :( I fix it today or tomorrow. Also i will close #3 . Thank you for your report!

richardpeng commented 9 years ago

Thanks for fixing this!