Skip to content

Commit

Permalink
#2 fixed replacing tag value (#3)
Browse files Browse the repository at this point in the history
* #2 fixed replacing tag value
* Updated documentation
  • Loading branch information
szikszail authored Mar 25, 2022
1 parent 8f792a0 commit 10ca130
Show file tree
Hide file tree
Showing 11 changed files with 8,970 additions and 808 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 1.0.1 - 2022-03-25

### Added

- Added test case to ensure replace works with comments

### Fixed

- Fixed tag values not replaced ([#2](https://github.com/gherking/gpc-replacer/issues/2))

## 1.0.0 - 2022-02-03

Implemented precompiler
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This GherKing Precompiler is responsible to replace keys in feature files with g
```javascript
'use strict';
const compiler = require('gherking');
const Replacer = require('gpc-replacer');
const { default: Replacer } = require('gpc-replacer');

let ast = await compiler.load('./features/src/login.feature');
ast = compiler.process(
Expand All @@ -32,7 +32,7 @@ await compiler.save('./features/dist/login.feature', ast, {
```typescript
'use strict';
import {load, process, save} from "gherking";
import Replacer = require("gpc-replacer");
import Replacer, { ReplacerConfig } from "gpc-replacer";

let ast = await load("./features/src/login.feature");
ast = process(
Expand All @@ -59,21 +59,23 @@ replaced by.
In case the config file is not available, or its format is incorrect
the Replacer throws an error.

It replaces strings given in a format '${to_replace}' in the input
It replaces strings given in a format `${to_replace}` in the input
feature.
It can find and replace such strings in the following parts of a

It can find and replace such strings in the textual parts of a
feature file:

* Feature: name, description
* Rule: name, description
* Background: name, description
* Scenario Outline: name, decription
* Scenario: name, description
* Step: text
* Tag: name
* Examples: name
* Document string: content
* Data table: header name, cell values
* **Document**: comments
* **Feature**: name, description, comments
* **Rule**: name, description, comments
* **Background**: name, description, comments
* **Scenario Outline**: name, decription, comments
* **Scenario**: name, description, comments
* **Step**: text, comment
* **Tag**: name, value, comments
* **Examples**: name, comments
* **Doc String**: content, comment
* **Data Table**, **Table Rows**: cell values, comments

See examples for the input files and an output in the test/data folder.

Expand Down
29 changes: 0 additions & 29 deletions Replacer.md

This file was deleted.

Loading

0 comments on commit 10ca130

Please sign in to comment.