-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Porting Ruby Template to Language Function (Fixes #622)
- Loading branch information
James Brundage
committed
Nov 12, 2023
1 parent
d9ab132
commit c21aa50
Showing
2 changed files
with
27 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
Language function Ruby { | ||
<# | ||
.SYNOPSIS | ||
Ruby Language Definition. | ||
.DESCRIPTION | ||
Allows PipeScript to generate Ruby. | ||
PipeScript can be embedded in a multiline block that starts with ```=begin{``` and ends with } (followed by ```=end```) | ||
#> | ||
[ValidatePattern('\.rb$')] | ||
param() | ||
|
||
|
||
# We start off by declaring a number of regular expressions: | ||
|
||
$startComment = '(?>[\r\n]{1,3}\s{0,}=begin[\s\r\n]{0,}\{)' | ||
$endComment = '(?>}[\r\n]{1,3}\s{0,}=end)' | ||
|
||
$ignoreEach = '[\d\.]+', | ||
'""', | ||
"''" | ||
|
||
$IgnoredContext = "(?<ignore>(?>$($ignoreEach -join '|'))\s{0,}){0,1}" | ||
|
||
$startPattern = "(?<PSStart>${IgnoredContext}${startComment})" | ||
$endPattern = "(?<PSEnd>${endComment}${IgnoredContext})" | ||
} |
This file was deleted.
Oops, something went wrong.