Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into 333-defaultOptionWIP
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Sep 6, 2024
2 parents 18b78f0 + 91e1e27 commit 5cb5e66
Show file tree
Hide file tree
Showing 6 changed files with 86 additions and 6 deletions.
75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ array("foo")
# {"name":"value"} => ["name", "value"]
```

[Example in Playground](https://metafacture.org/playground/?example=array)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+array+{")

##### `call_macro`
Expand Down Expand Up @@ -359,6 +361,8 @@ hash("foo")
# ["name", "value"] => {"name":"value"}
```

[Example in Playground](https://metafacture.org/playground/?example=hash)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+hash+{")

##### `move_field`
Expand All @@ -383,6 +387,8 @@ Parses a text into an array or hash of values.
parse_text("<sourceField>", "<parsePattern>")
```

[Example in Playground](https://metafacture.org/playground/?example=parse_text)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+parse_text+{")

##### `paste`
Expand Down Expand Up @@ -453,6 +459,8 @@ Creates (or replaces) a field with a random number (less than the specified maxi
random("<targetField>", "<maximum>")
```

[Example in Playground](https://metafacture.org/playground/?example=random)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+random+{")

##### `remove_field`
Expand Down Expand Up @@ -523,6 +531,8 @@ set_hash("<targetFieldName>")
set_hash("<targetFieldName>", "subfieldName": "<subfieldValue>"[, ...])
```

[Example in Playground](https://metafacture.org/playground/?example=set_hash)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+set_hash+{")

##### `timestamp`
Expand All @@ -539,6 +549,8 @@ Options:
timestamp("<targetField>"[, format: "<formatPattern>"][, timezone: "<timezoneCode>"][, language: "<languageCode>"])
```

[Example in Playground](https://metafacture.org/playground/?example=timestamp)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+timestamp+{")

##### `vacuum`
Expand Down Expand Up @@ -587,6 +599,8 @@ Counts the number of elements in an array or a hash and replaces the field value
count("<sourceField>")
```

[Example in Playground](https://metafacture.org/playground/?example=count)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+count+{")

##### `downcase`
Expand All @@ -609,6 +623,8 @@ Only keeps field values that match the regular expression pattern. Works only wi
filter("<sourceField>", "<regexp>")
```

[Example in Playground](https://metafacture.org/playground/?example=filter)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+filter+{")

##### `flatten`
Expand Down Expand Up @@ -645,6 +661,8 @@ Returns the index position of a substring in a field and replaces the field valu
index("<sourceField>", "<substring>")
```

[Example in Playground](https://metafacture.org/playground/?example=index)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+index+{")

##### `isbn`
Expand Down Expand Up @@ -770,6 +788,8 @@ Reverses the character order of a string or the element order of an array.
reverse("<sourceField>")
```

[Example in Playground](https://metafacture.org/playground/?example=reverse)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+reverse+{")

##### `sort_field`
Expand Down Expand Up @@ -806,6 +826,8 @@ Replaces a string with its substring as defined by the start position (offset) a
substring("<sourceField>", "<startPosition>", "<length>")
```

[Example in Playground](https://metafacture.org/playground/?example=substring)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+substring+{")

##### `sum`
Expand All @@ -816,6 +838,8 @@ Sums numbers in an array and replaces the field value with this number.
sum("<sourceField>")
```

[Example in Playground](https://metafacture.org/playground/?example=sum)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+sum+{")

##### `to_json`
Expand All @@ -831,6 +855,8 @@ Options:
to_json("<sourceField>"[, pretty: "<boolean>"][, error_string: "<errorValue>"])
```

[Example in Playground](https://metafacture.org/playground/?example=to_json)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+to_json+{")

##### `to_base64`
Expand All @@ -841,6 +867,8 @@ Replaces the value with its Base64 encoding.
to_base64("<sourceField>")
```

[Example in Playground](https://metafacture.org/playground/?example=to_base64)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+to_base64+{")

##### `trim`
Expand Down Expand Up @@ -898,6 +926,8 @@ E.g.:
uri_encode("path.to.field", plus_for_space:"false", safe_chars:"")
```

[Example in Playground](https://metafacture.org/playground/?example=uri_encode)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+uri_encode+{")

### Selectors
Expand Down Expand Up @@ -948,6 +978,8 @@ end

Iterates over each _named_ element of an array (like [`do list`](#do-list) with a variable name). If multiple arrays are given, iterates over the _corresponding_ elements from each array (i.e., all elements with the same array index, skipping elements whose arrays have already been exhausted).

[Example in Playground](https://metafacture.org/playground/?example=do+list_as)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixBind.java+"+list_as+{")

```perl
Expand Down Expand Up @@ -1059,24 +1091,32 @@ end

Executes the functions if/unless the field contains the value. If it is an array or a hash all field values must contain the string.

[Example in Playground](https://metafacture.org/playground/?example=all_contain)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+all_contain+{")

##### `any_contain`

Executes the functions if/unless the field contains the value. If it is an array or a hash one or more field values must contain the string.

[Example in Playground](https://metafacture.org/playground/?example=any_contain)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+any_contain+{")

##### `none_contain`

Executes the functions if/unless the field does not contain the value. If it is an array or a hash none of the field values may contain the string.

[Example in Playground](https://metafacture.org/playground/?example=none_contain)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+none_contain+{")

##### `str_contain`

Executes the functions if/unless the first string contains the second string.

[Example in Playground](https://metafacture.org/playground/?example=str_contain)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+str_contain+{")

#### `equal`
Expand All @@ -1085,24 +1125,32 @@ Executes the functions if/unless the first string contains the second string.

Executes the functions if/unless the field value equals the string. If it is an array or a hash all field values must equal the string.

[Example in Playground](https://metafacture.org/playground/?example=all_equal)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+all_equal+{")

##### `any_equal`

Executes the functions if/unless the field value equals the string. If it is an array or a hash one or more field values must equal the string.

[Example in Playground](https://metafacture.org/playground/?example=any_equal)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+any_equal+{")

##### `none_equal`

Executes the functions if/unless the field value does not equal the string. If it is an array or a hash none of the field values may equal the string.

[Example in Playground](https://metafacture.org/playground/?example=none_equal)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+none_equal+{")

##### `str_equal`

Executes the functions if/unless the first string equals the second string.

[Example in Playground](https://metafacture.org/playground/?example=str_equal)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+str_equal+{")

#### `exists`
Expand All @@ -1112,6 +1160,9 @@ Executes the functions if/unless the field exists.
```perl
if exists("<sourceField>")
```

[Example in Playground](https://metafacture.org/playground/?example=exists)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+exists+{")

#### `in`
Expand All @@ -1120,6 +1171,8 @@ Executes the functions if/unless the field value [is contained in](https://perld

_Also aliased as [`is_contained_in`](#is_contained_in)._

[Example in Playground](https://metafacture.org/playground/?example=in)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+in+{")

#### `is_contained_in`
Expand All @@ -1130,30 +1183,40 @@ _Alias for [`in`](#in)._

Executes the functions if/unless the field value is an array.

[Example in Playground](https://metafacture.org/playground/?example=is_array)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+is_array+{")

#### `is_empty`

Executes the functions if/unless the field value is empty.

[Example in Playground](https://metafacture.org/playground/?example=is_empty)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+is_empty+{")

#### `is_false`

Executes the functions if/unless the field value equals `false` or `0`.

[Example in Playground](https://metafacture.org/playground/?example=is_false)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+is_false+{")

#### `is_hash`

_Alias for [`is_object`](#is_object)._

[Example in Playground](https://metafacture.org/playground/?example=is_hash)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+is_hash+{")

#### `is_number`

Executes the functions if/unless the field value is a number.

[Example in Playground](https://metafacture.org/playground/?example=is_number)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+is_number+{")

#### `is_object`
Expand All @@ -1166,12 +1229,16 @@ _Also aliased as [`is_hash`](#is_hash)._

Executes the functions if/unless the field value is a string (and not a number).

[Example in Playground](https://metafacture.org/playground/?example=is_string)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+is_string+{")

#### `is_true`

Executes the functions if/unless the field value equals `true` or `1`.

[Example in Playground](https://metafacture.org/playground/?example=is_true)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+is_true+{")


Expand All @@ -1181,24 +1248,32 @@ Executes the functions if/unless the field value equals `true` or `1`.

Executes the functions if/unless the field value matches the regular expression pattern. If it is an array or a hash all field values must match the regular expression pattern.

[Example in Playground](https://metafacture.org/playground/?example=all_match)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+all_match+{")

##### `any_match`

Executes the functions if/unless the field value matches the regular expression pattern. If it is an array or a hash one or more field values must match the regular expression pattern.

[Example in Playground](https://metafacture.org/playground/?example=any_match)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+any_match+{")

##### `none_match`

Executes the functions if/unless the field value does not match the regular expression pattern. If it is an array or a hash none of the field values may match the regular expression pattern.

[Example in Playground](https://metafacture.org/playground/?example=none_match)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+none_match+{")

##### `str_match`

Executes the functions if/unless the string matches the regular expression pattern.

[Example in Playground](https://metafacture.org/playground/?example=str_match)

[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixConditional.java+"+str_match+{")

## Xtext
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ subprojects {
'jquery': '3.3.1-1',
'junit_jupiter': '5.8.2',
'junit_platform': '1.4.2',
'metafacture': '6.0.0',
'metafacture': '6.1.2',
'mockito': '2.27.0',
'requirejs': '2.3.6',
'slf4j': '1.7.21',
Expand All @@ -55,7 +55,7 @@ subprojects {
}

group = 'org.metafacture'
version = '1.0.1-SNAPSHOT'
version = '1.1.3-SNAPSHOT'

apply plugin: 'checkstyle'
apply plugin: 'eclipse'
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=a4b4158601f8636cdeeab09bd76afb640030bb5b144aafe261a5e8af027dc612
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionSha256Sum=5b9c5eb3f9fc2c94abaea57d90bd78747ca117ddbbf96c859d3741181a12bf2a
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
7 changes: 5 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down

0 comments on commit 5cb5e66

Please sign in to comment.