Skip to content

Commit

Permalink
Merge pull request #286 from aashikam/gradle
Browse files Browse the repository at this point in the history
Remove usages of regex module
  • Loading branch information
anuruddhal authored Dec 12, 2023
2 parents 4c473ca + e70c39e commit 01cd9cb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
38 changes: 28 additions & 10 deletions ballerina/Dependencies.toml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,15 @@ dependencies = [
{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "lang.error"
version = "0.0.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"}
]

[[package]]
org = "ballerina"
name = "lang.int"
Expand Down Expand Up @@ -214,6 +223,9 @@ dependencies = [
{org = "ballerina", name = "lang.value"},
{org = "ballerina", name = "observe"}
]
modules = [
{org = "ballerina", packageName = "log", moduleName = "log"}
]

[[package]]
org = "ballerina"
Expand Down Expand Up @@ -254,26 +266,30 @@ dependencies = [
{org = "ballerina", name = "io"},
{org = "ballerina", name = "jballerina.java"}
]
modules = [
{org = "ballerina", packageName = "os", moduleName = "os"}
]

[[package]]
org = "ballerina"
name = "regex"
version = "1.4.3"
name = "task"
version = "2.5.0"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "lang.string"}
]
modules = [
{org = "ballerina", packageName = "regex", moduleName = "regex"}
{org = "ballerina", name = "time"}
]

[[package]]
org = "ballerina"
name = "task"
version = "2.5.0"
name = "test"
version = "0.0.0"
scope = "testOnly"
dependencies = [
{org = "ballerina", name = "jballerina.java"},
{org = "ballerina", name = "time"}
{org = "ballerina", name = "lang.error"}
]
modules = [
{org = "ballerina", packageName = "test", moduleName = "test"}
]

[[package]]
Expand Down Expand Up @@ -326,7 +342,9 @@ dependencies = [
{org = "ballerina", name = "lang.array"},
{org = "ballerina", name = "lang.int"},
{org = "ballerina", name = "lang.regexp"},
{org = "ballerina", name = "regex"},
{org = "ballerina", name = "log"},
{org = "ballerina", name = "os"},
{org = "ballerina", name = "test"},
{org = "ballerinai", name = "observe"},
{org = "ballerinax", name = "client.config"}
]
Expand Down
4 changes: 2 additions & 2 deletions ballerina/utils.bal
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import ballerina/http;
import ballerina/jballerina.java as java;
import ballerina/regex;
import ballerina/lang.regexp;

isolated function sendRequestWithPayload(http:Client httpClient, string path, json jsonPayload = ())
returns @tainted json | error {
Expand Down Expand Up @@ -147,7 +147,7 @@ isolated function prepareDriveUrl(string? pageToken = ()) returns string {
public function createRandomUUIDWithoutHyphens() returns string {
string? stringUUID = java:toString(createRandomUUID());
if (stringUUID is string) {
return regex:replaceAll(stringUUID, "-", "");
return regexp:replaceAll(re `-`, stringUUID, "");
} else {
return "";
}
Expand Down

0 comments on commit 01cd9cb

Please sign in to comment.