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

Directory parameter extension - RegEx #114

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

kdybicz
Copy link
Collaborator

@kdybicz kdybicz commented Feb 28, 2017

  • Introducing output directory extension using RegEx
  • Splitting tests groups into separate ones
  • Upgrading ava dependency to 0.18.2
  • Updating configtest (in progress)
  • Updating README.md (in progress)

lib/ImageData.js Outdated
if ( typeof directory === "object" && directory.regex && directory.regex.find ) {
const regex = new RegExp(directory.regex.find);
const output = this.dirName.replace(regex, directory.regex.replace || "");
return path.join(output, prefix + fileName + suffix + extension);
Copy link
Owner

Choose a reason for hiding this comment

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

I think RegExp is bad idea a bit.

Because:

  • Now configuration is json format. so we have to write regexp as string.
  • Configuration seems to become complicated.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, I agree with complexity part, at least partially. It's because I think that better flexibility always will introduce more complexity, in one or different form. Also, keep in mind that we are not replacing old simple approach, we are just adding extension to it. So the RegEx configuration could be used only by more advanced users. But I guess I must agree, that this could increase number of incoming questions and bugs :)

If you feel that the path-template approach is simpler, we can start from there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Owner

@ysugimoto ysugimoto Mar 7, 2017

Choose a reason for hiding this comment

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

OK, now we can use path-template approach.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, I plan to do that

@kdybicz
Copy link
Collaborator Author

kdybicz commented Mar 27, 2017

Please don't merge it yet, It's not fully finished :)

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.

2 participants