Skip to content

Commit

Permalink
Merge pull request #20 from unrvld/feature/fix-prefix-parsing
Browse files Browse the repository at this point in the history
Fix resolving of endpoint
  • Loading branch information
stefanolsen authored Jun 9, 2024
2 parents de226da + 7470e13 commit 882edb0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-visitor-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:
workflow_dispatch:

env:
BUILD_NO: 2.0.0.${{ github.run_number }}
BUILD_NO_PRE: 2.0.0-rc.${{ github.run_number }}
BUILD_NO: 2.0.1.${{ github.run_number }}
BUILD_NO_PRE: 2.0.1-rc.${{ github.run_number }}

jobs:
build:
Expand Down
11 changes: 3 additions & 8 deletions src/UNRVLD.ODP.VisitorGroups/Criteria/StandardPrefixer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ namespace UNRVLD.ODP.VisitorGroups.Criteria
{
public class StandardPrefixer : IPrefixer
{
private readonly Regex prefixRegex;

public StandardPrefixer()
{
prefixRegex = new Regex(@"^\[(.+)\] - (.+)$", RegexOptions.Compiled);
}
private static readonly Regex PrefixRegex = new(@"^\[(.+)\] - (.+)$", RegexOptions.Compiled);

public string Prefix(string value, string prefix)
{
Expand All @@ -19,9 +14,9 @@ public string Prefix(string value, string prefix)

public (string? prefix, string value) SplitPrefix(string value)
{
var match = prefixRegex.Match(value);
var match = PrefixRegex.Match(value);

return match.Success ? (match.Groups[1].Value, match.Groups[2].Value) : (string.Empty, value);
return match.Success ? (match.Groups[1].Value, match.Groups[2].Value) : (null, value);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<PackageId>UNRVLD.ODP.VisitorGroups</PackageId>
<RepositoryUrl>https://github.com/made-to-engage/ODP.VisitorGroups</RepositoryUrl>
<Version>2.0.0</Version>
<Version>2.0.1</Version>
<Authors>Andrew Markham; David Knipe</Authors>
<Owners>Made to Engage;UNRVLD</Owners>
<Title>UNRVLD - Optimizely Visitor Groups</Title>
Expand Down

0 comments on commit 882edb0

Please sign in to comment.