Skip to content

Commit

Permalink
feat: Porting Ruby Template to Language Function (Fixes #622)
Browse files Browse the repository at this point in the history
  • Loading branch information
James Brundage committed Nov 12, 2023
1 parent d9ab132 commit c21aa50
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 69 deletions.
27 changes: 27 additions & 0 deletions Commands/Languages/Ruby/Ruby-Language.ps.ps1
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})"
}
69 changes: 0 additions & 69 deletions Transpilers/Templates/Ruby.Template.psx.ps1

This file was deleted.

0 comments on commit c21aa50

Please sign in to comment.