Skip to content

Commit 8a8b121

Browse files
Merge pull request #111 from PowerShellWeb/turtle-fix
Turtle 0.1.3
2 parents ec789b6 + a806802 commit 8a8b121

File tree

9 files changed

+74
-18
lines changed

9 files changed

+74
-18
lines changed

CHANGELOG.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
## Turtle 0.1.2:
1+
## Turtle 0.1.3
2+
3+
* Fixing `Get-Turtle` inline sets (#108, #107)
4+
* Fixing `.PNG/JPEG/WEBP` to no longer try to use msedge (#110)
5+
* Adding `Turtle.get/set_FillRule` to get or set the fill rule for the turtle. (#109)
6+
7+
---
8+
9+
## Turtle 0.1.2
210

311
* `Get-Turtle/Turtle` can now get or set properties or methods
412
* New Methods:
@@ -9,7 +17,9 @@
917
* `Turtle.Save()` calls Save-Turtle
1018
* Explicitly exporting commands from module
1119

12-
## Turtle 0.1.1:
20+
---
21+
22+
## Turtle 0.1.1
1323

1424
* Updates:
1525
* `Turtle.get/set_ID` allows for turtle identifiers
@@ -28,7 +38,7 @@
2838

2939
---
3040

31-
## Turtle 0.1:
41+
## Turtle 0.1
3242

3343
* Initial Release
3444
* Builds a Turtle Graphics engine in PowerShell

Commands/Get-Turtle.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,19 +165,19 @@ function Get-Turtle {
165165
}
166166

167167
# If the output is not a turtle object, we can output it.
168-
# NOTE: This will lead to multiple types of output in the pipeline.
168+
# NOTE: This may lead to multiple types of output in the pipeline.
169169
# Luckily, this should be one of the few cases where this does not annoy too much.
170-
# Properties being returned will largely be strings or numbers.
171-
if (-not ($stepOutput.pstypenames -eq 'Turtle')) {
170+
# Properties being returned will largely be strings or numbers, and these will always output directly.
171+
if ($null -ne $stepOutput -and -not ($stepOutput.pstypenames -eq 'Turtle')) {
172172
# Output the step
173173
$stepOutput
174174
# and set the output turtle to false.
175175
$outputTurtle = $false
176-
} else {
176+
} elseif ($null -ne $stepOutput) {
177177
# Set the current turtle to the step output.
178178
$currentTurtle = $stepOutput
179179
# and output it later (presumably).
180-
$outputTurtle = $true
180+
$outputTurtle = $true
181181
}
182182
}
183183

Turtle.psd1

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@{
22
# Version number of this module.
3-
ModuleVersion = '0.1.2'
3+
ModuleVersion = '0.1.3'
44
# Description of the module
55
Description = "Turtles in a PowerShell"
66
# Script module or binary module file associated with this manifest.
@@ -37,7 +37,15 @@
3737
# A URL to the license for this module.
3838
LicenseURI = 'https://github.com/PowerShellWeb/Turtle/blob/main/LICENSE'
3939
ReleaseNotes = @'
40-
## Turtle 0.1.2:
40+
## Turtle 0.1.3
41+
42+
* Fixing `Get-Turtle` inline sets (#108, #107)
43+
* Fixing `.PNG/JPEG/WEBP` to no longer try to use msedge (#110)
44+
* Adding `Turtle.get/set_FillRule` to get or set the fill rule for the turtle. (#109)
45+
46+
---
47+
48+
## Turtle 0.1.2
4149
4250
* `Get-Turtle/Turtle` can now get or set properties or methods
4351
* New Methods:
@@ -48,7 +56,9 @@
4856
* `Turtle.Save()` calls Save-Turtle
4957
* Explicitly exporting commands from module
5058
51-
## Turtle 0.1.1:
59+
---
60+
61+
## Turtle 0.1.1
5262
5363
* Updates:
5464
* `Turtle.get/set_ID` allows for turtle identifiers
@@ -67,7 +77,7 @@
6777
6878
---
6979
70-
## Turtle 0.1:
80+
## Turtle 0.1
7181
7282
* Initial Release
7383
* Builds a Turtle Graphics engine in PowerShell

Turtle.types.ps1xml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,6 +1488,28 @@ if (-not $this.'.Fill') {
14881488
}
14891489
</SetScriptBlock>
14901490
</ScriptProperty>
1491+
<ScriptProperty>
1492+
<Name>FillRule</Name>
1493+
<GetScriptBlock>
1494+
if (-not $this.'.PathAttribute') {
1495+
$this | Add-Member -MemberType NoteProperty -Name '.PathAttribute' -Value ([Ordered]@{}) -Force
1496+
}
1497+
if ($this.'.PathAttribute'.'fill-rule') {
1498+
return $this.'.PathAttribute'.'fill-rule'
1499+
} else {
1500+
'nonzero'
1501+
}
1502+
</GetScriptBlock>
1503+
<SetScriptBlock>
1504+
param(
1505+
[ValidateSet('nonzero', 'evenodd')]
1506+
[string]
1507+
$fillRule = 'nonzero'
1508+
)
1509+
$this.PathAttribute = [Ordered]@{'fill-rule' = $fillRule.ToLower()}
1510+
1511+
</SetScriptBlock>
1512+
</ScriptProperty>
14911513
<ScriptProperty>
14921514
<Name>Heading</Name>
14931515
<GetScriptBlock>
@@ -1570,7 +1592,7 @@ if ($VerbosePreference -ne 'SilentlyContinue') {
15701592
<ScriptProperty>
15711593
<Name>JPEG</Name>
15721594
<GetScriptBlock>
1573-
$chromiumNames = 'chromium','chrome','msedge'
1595+
$chromiumNames = 'chromium','chrome'
15741596
foreach ($browserName in $chromiumNames) {
15751597
$chromiumCommand =
15761598
$ExecutionContext.SessionState.InvokeCommand.GetCommand($browserName,'Application')
@@ -1881,7 +1903,7 @@ $this | Add-Member -MemberType NoteProperty -Force -Name '.PatternTransform' -Va
18811903
<ScriptProperty>
18821904
<Name>PNG</Name>
18831905
<GetScriptBlock>
1884-
$chromiumNames = 'chromium','chrome','msedge'
1906+
$chromiumNames = 'chromium','chrome'
18851907
foreach ($browserName in $chromiumNames) {
18861908
$chromiumCommand =
18871909
$ExecutionContext.SessionState.InvokeCommand.GetCommand($browserName,'Application')
@@ -2136,7 +2158,7 @@ $this | Add-Member -MemberType NoteProperty -Force -Name '.ViewBox' -Value $view
21362158
<ScriptProperty>
21372159
<Name>WEBP</Name>
21382160
<GetScriptBlock>
2139-
$chromiumNames = 'chromium','chrome','msedge'
2161+
$chromiumNames = 'chromium','chrome'
21402162
foreach ($browserName in $chromiumNames) {
21412163
$chromiumCommand =
21422164
$ExecutionContext.SessionState.InvokeCommand.GetCommand($browserName,'Application')

Types/Turtle/get_FillRule.ps1

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
if (-not $this.'.PathAttribute') {
2+
$this | Add-Member -MemberType NoteProperty -Name '.PathAttribute' -Value ([Ordered]@{}) -Force
3+
}
4+
if ($this.'.PathAttribute'.'fill-rule') {
5+
return $this.'.PathAttribute'.'fill-rule'
6+
} else {
7+
'nonzero'
8+
}

Types/Turtle/get_JPEG.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$chromiumNames = 'chromium','chrome','msedge'
1+
$chromiumNames = 'chromium','chrome'
22
foreach ($browserName in $chromiumNames) {
33
$chromiumCommand =
44
$ExecutionContext.SessionState.InvokeCommand.GetCommand($browserName,'Application')

Types/Turtle/get_PNG.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$chromiumNames = 'chromium','chrome','msedge'
1+
$chromiumNames = 'chromium','chrome'
22
foreach ($browserName in $chromiumNames) {
33
$chromiumCommand =
44
$ExecutionContext.SessionState.InvokeCommand.GetCommand($browserName,'Application')

Types/Turtle/get_WEBP.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$chromiumNames = 'chromium','chrome','msedge'
1+
$chromiumNames = 'chromium','chrome'
22
foreach ($browserName in $chromiumNames) {
33
$chromiumCommand =
44
$ExecutionContext.SessionState.InvokeCommand.GetCommand($browserName,'Application')

Types/Turtle/set_FillRule.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
param(
2+
[ValidateSet('nonzero', 'evenodd')]
3+
[string]
4+
$fillRule = 'nonzero'
5+
)
6+
$this.PathAttribute = [Ordered]@{'fill-rule' = $fillRule.ToLower()}

0 commit comments

Comments
 (0)