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

Allow array of trees #188

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

Conversation

SparshithNR
Copy link
Contributor

@SparshithNR SparshithNR commented Dec 19, 2019

  • Avoids need for merging trees before calling Filter
    This change will do the following code work
const Filter = require('broccoli-persistent-filter');
//BrocFile.js

class Awk extends Filter {
  constructor(inputNode, search, replace, options) {
    options = options || {};
    super(inputNode, {
      annotation: options.annotation
    });
    this.search = search;
    this.replace = replace;
    this.extensions = ['txt'];
    this.targetExtension = 'txt';
  }
  processString(content, relativePath) {
    return content.replace(this.search, this.replace);
  };
}
//before current change we use to run a mergeTree and then run Awk filter
// i.e. let mergedTree = new MergeTree(['fixture','fixture_2']);
// module.exports = new Awk(mergedTree, 'test', 'real');
// now we can pass whole array of inputTrees 
module.exports = new Awk(['fixture','fixture_2'], 'test', 'real');

@SparshithNR
Copy link
Contributor Author

This PR is the next step to #187 .

@SparshithNR
Copy link
Contributor Author

SparshithNR commented May 12, 2020

@chriseppstein @stefanpenner Please have a look at this change.

Copy link
Contributor

@chriseppstein chriseppstein left a comment

Choose a reason for hiding this comment

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

Looks good. I have raised one serious issue regarding the error metadata being returned.

index.ts Outdated Show resolved Hide resolved
index.ts Outdated Show resolved Hide resolved
test/filter-test.js Show resolved Hide resolved
@chriseppstein
Copy link
Contributor

@SparshithNR @stefanpenner Is there anything remaining to do in order to land this? It would be good if we could realize the gains of all the underlying changes.

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