Scrimmage / karma-slim-preprocessor

Compiles slim to html for karma tests
MIT License
5 stars 6 forks source link

Allowing multiple command line options #6

Closed rosstroha closed 6 years ago

rosstroha commented 6 years ago

Hi! Thanks for writing this karma plugin! I am planning on using it in another project but there is some missing functionality that I need.

This PR is to allow multiple command line options to be given to the child process without breaking changes to current users of the plugin.

Previously, when giving multiple options in the karma configuration file like this `slimrbOption: '-l { "foosball": true } -r slim/smart'

... the child process would be given an array of options formatted like this:

[
'-l { "foosball": true } -r slim/smart',
'some/file.slim'
]

Instead, it will simply accept and array of options and be given an array formatted like this:

[
'-l { "foosball": true }', 
'-r slim/smart',
'some/file.slim'
]
ratbeard commented 6 years ago

Thanks for the PR @rosstroha. I don't have a project setup using this plugin anymore, so I couldn't test, but does this form not work?

[
'-l { "foosball": true } -r slim/smart',
'some/file.slim'
]

It doesn't look like a breaking change to me, as the old string style is still handled.

rosstroha commented 6 years ago

@ratbeard It doesn't seem to like it as a single string

When the options is set like this: slimrbOption: '--trace -r slim/smart'

The error returned is ... slim-3.0.8/lib/slim/command.rb:18:in 'run': invalid option: --trace -r slim/smart (OptionParser::InvalidOption)

rosstroha commented 6 years ago

It doesn't look like a breaking change to me, as the old string style is still handled.

Woops, I totally forgot a word when writing the PR. My bad! I've edited it.

ratbeard commented 6 years ago

No problem. Looks good, thanks for contributing 🏖

Travis keeps erroring out on npm install :\

Hmm I don't have write access any more to this repo. Will merge it in a few.