Skip to content
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

Use lodash directly and add include and exclude option #13

Closed
wants to merge 6 commits into from
Closed

Use lodash directly and add include and exclude option #13

wants to merge 6 commits into from

Conversation

XhmikosR
Copy link
Contributor

@XhmikosR XhmikosR commented Apr 7, 2014

This fixes #9.

I'll rebase this when the other PR is merged.

@XhmikosR XhmikosR changed the title Use lodash directly and add exclude option Use lodash directly and add include and exclude option Apr 8, 2014
@XhmikosR
Copy link
Contributor Author

XhmikosR commented Apr 8, 2014

Added include option too.


replace({
regex: data.pattern
, replacement: data.replacement
, paths: _.isArray(data.path) ? data.path : [data.path]
, include: _.isArray(data.include) ? _(data.include).toString() : data.include
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than passing an empty string for include and exclude when the user doesn't specify them, how about we pass in undefined?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if that's any better... But it's your call :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW,

  1. jshint fails due to line length. Maybe I should move the checks in lines 26-27 instead.
  2. include and exclude are mutually exclusive. Not sure if we should add a check for that but "replace" itself doesn't show anything in that case.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if that's any better... But it's your call :)

You're right, I took a look at the replace source code and either way should work.

jshint fails due to line length. Maybe I should move the checks in lines 26-27 instead.

Or you can remove that jshint option. Either way works for me.

include and exclude are mutually exclusive. Not sure if we should add a check for that but "replace" itself doesn't show anything in that case.

I'll leave that up to you. I don't have a preference.

@XhmikosR
Copy link
Contributor Author

@jharding: I removed maxlen. I didn't add a check or anything for include/exclude; I guess someone can add it later :)

I think it's ready to merge. If you could add some tests that would be perfect.

@jharding
Copy link
Owner

Great. Thanks for being so responsive. I'll add some tests and get this merged as soon as I can.

@XhmikosR XhmikosR mentioned this pull request Sep 13, 2014
@XhmikosR
Copy link
Contributor Author

@jharding: bump

@XhmikosR
Copy link
Contributor Author

@jharding: any news? It's been 9 months :/

@cvrebert
Copy link

Would really love to be able to use exclude for twbs/bootstrap#16075

@XhmikosR
Copy link
Contributor Author

Branch rebased; I updated dependencies including lodash itself.

@cvrebert
Copy link

cvrebert commented Apr 8, 2015

@XhmikosR What do you think about just vendoring this task into Bootstrap's /grunt/, given the lack of action here?

@XhmikosR
Copy link
Contributor Author

XhmikosR commented Apr 8, 2015

I was thinking to use our own fork, but that would work too, sure.

@cvrebert
Copy link

cvrebert commented Apr 8, 2015

@XhmikosR I'm fine with either approach; just want to get this finally resolved soon 😅 . Think you'll have time to setup the fork in the near future?

@XhmikosR
Copy link
Contributor Author

XhmikosR commented Apr 9, 2015

@cvrebert: done. We can use it like

"grunt-sed": "twbs/grunt-sed#twbs"

@XhmikosR XhmikosR closed this Jun 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignore node_modules?
3 participants