nifty-generators
nifty-generators copied to clipboard
Update nifty_layout to be compatible with Rails 3.1 directory estructure and SCSS
This pull request has 3 main points:
- 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.
- I added the corresponding cucumber scenarios and cleaned up a bit (hope for better).
- 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
andhaml + 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.
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?
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.
That should work, you can just check if it starts with "3.0". There may be better ways, haven't looked.
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 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:
- When I set the development_dependency 'rails' to '~>3.0' the nifty_layout_3.1.feature fails (line nos 13 and 21).
- 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?