-
Notifications
You must be signed in to change notification settings - Fork 133
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
Pass raw params to less parser #116
Conversation
I'm just starting out with ruby so if someone would help me with writing tests for this, I would appreciate it. |
This is not a failure of this diff, so I suppose this should not block it from merging, #117 created. |
@simi ? can we merge this? |
@ilyapoz can you provide some usecase and mention this change in readme and changelog? |
@simi did that |
Great! I have one idea. What about to write README section as universal way how to pass custom args to lessc and mention this one (relativeUrls) as example? |
@ilyapoz awesome! It will be really nice to add test. I can handle the ruby part. Can you just post me bare lessc command with for example --relativeUrls and some basic file and how it looks with and without that parameter? I'll handle the rest. |
nah, too late, I got it :) |
Cool that we added the tests, now it seems that default behavior is dependent on ruby versions (probably less.rb gem version, but I'm not sure). If you have any ideas, I would appreciate it. Meanwhile I must probably dig into less.rb history and take a closer look. |
Actually strictly speaking this tests less.rb behavior, not parameters passing, but for ppl using this gem as a blackbox this test should be useful. |
I think this is suspicious, I must be not understanding something about the language or the test setup process as I managed to create an unstable test case. |
@@ -45,6 +45,18 @@ class BasicsSpec < Less::Rails::Spec | |||
|
|||
end | |||
|
|||
describe 'relative path setting must be effective' do | |||
it 'must use relavite paths by default' do | |||
Rails.application.config.less.raw.relativeUrls = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to clean this parameter after test.
@ilyapoz it was set here cowboyd/less.rb@4e72e0c#diff-0937a07e2f5bb236b1e021c5e94f047aR5 in less.rb 2.3.0. Maybe it will make sense to test I think we should bump to 2.8 since it is adding new feature. But I can do it when I'll releasing. |
I digged deeper and |
In less.js it defaults to false, in less.rb to true (just to summarise). |
So basically I think that it's a good idea to fix implicit guarantees (default behavior) in tests, whether it's a good or bad behavior. Because some users might rely on that, so why not state it in the tests. |
@ilyapoz sonuds reasonable. |
Merged! |
close #94