Skip to content

Commit

Permalink
Improve portability
Browse files Browse the repository at this point in the history
  • Loading branch information
gcotelli committed Aug 31, 2023
1 parent 61b0822 commit b32cf26
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
7 changes: 4 additions & 3 deletions source/Hyperspace-Extensions/ZnMimeType.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ Extension { #name : #ZnMimeType }
{ #category : #'*Hyperspace-Extensions' }
ZnMimeType >> accepts: aMimeType [

^ (aMimeType main = '*' or: [ aMimeType main = self main ])
and: [ aMimeType sub = '*'
or: [ self sub = aMimeType sub or: [ (self sub splitOn: $+) includes: aMimeType sub ] ] ]
^ (aMimeType main = '*' or: [ aMimeType main = self main ]) and: [
aMimeType sub = '*' or: [
self sub = aMimeType sub or: [
($+ split: self sub) includes: aMimeType sub ] ] ]
]

{ #category : #'*Hyperspace-Extensions' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ ZnRequestHyperspaceExtensionsTest >> testQuery [

request := ZnRequest query: self googleUrl / 'search'.

self assert: request method equals: #QUERY.
self assert: request method equals: 'QUERY'.
output := String streamContents: [ :s | request writeOn: s ].

self
Expand Down
2 changes: 1 addition & 1 deletion source/Hyperspace-Model/PortAvailabilityChecker.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ PortAvailabilityChecker >> isAvailableForTCP: portNumber [
^ [
| socket |

socket := Socket newTCP.
socket := ZnNetworkingUtils default socketClass newTCP.
ZnNetworkingUtils default setServerSocketOptions: socket.
socket listenOn: portNumber.
[
Expand Down
3 changes: 2 additions & 1 deletion source/Hyperspace-Model/WebLink.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,8 @@ WebLink >> quoteValueWhenNeeded: aString [
"Values including ; or , needs to be quoted"

self assertNotEmpty: aString.
^ ( aString includesAnyOf: ';,' ) then: [ '"<1s>"' expandMacrosWith: aString ]
^ ((aString includes: $;) or: [ aString includes: $, ])
then: [ '"<1s>"' expandMacrosWith: aString ]
otherwise: [ aString ]
]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : #ZnNetworkingUtils }

{ #category : #'*Hyperspace-Pharo-Extensions' }
ZnNetworkingUtils >> socketClass [

^ Socket
]

0 comments on commit b32cf26

Please sign in to comment.