nifty-generators icon indicating copy to clipboard operation
nifty-generators copied to clipboard

Update nifty_layout to be compatible with Rails 3.1 directory estructure and SCSS

Open pablox-cl opened this issue 13 years ago • 5 comments

This pull request has 3 main points:

  1. Rails 3.1 has a slightly different directory structure, being the most relevant the location of the stylesheets, now in app/assets and this fork reflect those changes.
  2. I added the corresponding cucumber scenarios and cleaned up a bit (hope for better).
  3. Now SASS a new syntax (SCSS), so I added an option (--scss) to the nifty:layout generator to made possible to chose between the three (erb + css, haml + sass and haml + scss). Please, be free to change the option for whatever you find it's better.

Regards,

PS.- I don't have too much experience in collaborating in other people projects so spare me if I did something wrong.

pablox-cl avatar Jun 19 '11 06:06 pablox-cl

This looks really great, thank you! We should probably make this dynamic so it only happens when one is using Rails 3.1 that way it doesn't break Rails 3.0. What do you think?

ryanb avatar Jul 02 '11 17:07 ryanb

On 2 July 2011 13:50, ryanb [email protected] wrote:

This looks really great, thank you! We should probably make this dynamic so it only happens when one is using Rails 3.1 that way it doesn't break Rails 3.0. What do you think?

Oh, you're right, I didn't take that in mind =P. I guess the Rails::VERSION::STRING should be enough to be able to differentiate between 3.0.x and 3.1.x, right?

If it's okay I'll do it.

pablox-cl avatar Jul 03 '11 00:07 pablox-cl

That should work, you can just check if it starts with "3.0". There may be better ways, haven't looked.

ryanb avatar Jul 04 '11 18:07 ryanb

Sorry to keep you waiting :P.

I've added the cucumber feature corresponding to the changes mlitwiniuk added. I created a new file for it, although it's almost the same. I bet there's a way to have them bot on the same file, but the ways I could come up were too complex and would be against cucumber philosophy (afaik).

Since we're using two rails versions now, I tried that both versions (3.0.x and 3.1.x) would stay on different gemsets using rvm, but for some reason I couldn't. They kept going back to the main gemset and being installed there. So, if Rails >=3.1.0 isn't installed the nifty_layout_3.1 feature is going to fail.

Any suggestion, commentary would be welcome :)

pablox-cl avatar Sep 03 '11 19:09 pablox-cl

@PaBLoX-CL I downloaded your Git repository ,did bundle then rake. I did so while keeping both versions(3.0.11 and 3.1.0) on different gemsets, but the feature would still fail. There were two cases:

  1. When I set the development_dependency 'rails' to '~>3.0' the nifty_layout_3.1.feature fails (line nos 13 and 21).
  2. When I set the development_dependency 'rails' to '~>3.1' the nifty_layout.feature fails(line nos. 13 and 21).

@ryanb @PaBLoX-CL How to tackle this?

jatinganhotra avatar Jan 17 '12 10:01 jatinganhotra