Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add test for #301. Implies some changes to zip package for now embedd…
…ed as extensions in Pharo Launcher. + baseline cleanup (no more need for Pharo 6)
- Loading branch information
Showing
8 changed files
with
95 additions
and
36 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
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
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
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,30 @@ | ||
Extension { #name : #Archive } | ||
|
||
{ #category : #'*PharoLauncher-ZipArchive' } | ||
Archive >> addDirectory: aFileReference [ | ||
^self addDirectory: aFileReference as: aFileReference path pathString | ||
|
||
] | ||
|
||
{ #category : #'*PharoLauncher-ZipArchive' } | ||
Archive >> addDirectory: aFileReference as: anotherFileName [ | ||
| newMember | | ||
newMember := self memberClass newFromDirectory: aFileReference. | ||
self addMember: newMember. | ||
newMember localFileName: anotherFileName. | ||
^newMember | ||
] | ||
|
||
{ #category : #'*PharoLauncher-ZipArchive' } | ||
Archive >> addFile: aFileReference [ | ||
^self addFile: aFileReference as: aFileReference path pathString | ||
] | ||
|
||
{ #category : #'*PharoLauncher-ZipArchive' } | ||
Archive >> addFile: aFileReference as: anotherFileName [ | ||
| newMember | | ||
newMember := self memberClass newFromFile: aFileReference. | ||
newMember localFileName: anotherFileName. | ||
self addMember: newMember. | ||
^newMember | ||
] |
11 changes: 11 additions & 0 deletions
11
src/PharoLauncher-ZipArchive/ZipArchiveMember.extension.st
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,11 @@ | ||
Extension { #name : #ZipArchiveMember } | ||
|
||
{ #category : #'*PharoLauncher-ZipArchive' } | ||
ZipArchiveMember class >> newFromDirectory: aFileReference [ | ||
^ZipDirectoryMember newFromDirectory: aFileReference | ||
] | ||
|
||
{ #category : #'*PharoLauncher-ZipArchive' } | ||
ZipArchiveMember class >> newFromFile: aFileReference [ | ||
^ZipNewFileMember newFromFile: aFileReference | ||
] |
20 changes: 20 additions & 0 deletions
20
src/PharoLauncher-ZipArchive/ZipDirectoryMember.extension.st
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,20 @@ | ||
Extension { #name : #ZipDirectoryMember } | ||
|
||
{ #category : #'*PharoLauncher-ZipArchive' } | ||
ZipDirectoryMember >> localFileName: aString [ | ||
|
||
self localFileNameFrom: aString asFileReference | ||
] | ||
|
||
{ #category : #'*PharoLauncher-ZipArchive' } | ||
ZipDirectoryMember >> localFileNameFrom: aFileReference [ | ||
|
||
super localFileName: (aFileReference basename copyWith: $/). | ||
aFileReference exists ifFalse: [ ^ self ]. | ||
self modifiedAt: aFileReference entry modificationTime. | ||
] | ||
|
||
{ #category : #'*PharoLauncher-ZipArchive' } | ||
ZipDirectoryMember class >> newFromDirectory: aFileReference [ | ||
^(self new) localFileNameFrom: aFileReference; yourself | ||
] |
21 changes: 21 additions & 0 deletions
21
src/PharoLauncher-ZipArchive/ZipNewFileMember.extension.st
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,21 @@ | ||
Extension { #name : #ZipNewFileMember } | ||
|
||
{ #category : #'*PharoLauncher-ZipArchive' } | ||
ZipNewFileMember >> from: aFileReference [ | ||
|
||
| entry | | ||
"Now get the size, attributes, and timestamps, and see if the file exists" | ||
stream := aFileReference binaryReadStream. | ||
self localFileName: (externalFileName := aFileReference path pathString). | ||
entry := aFileReference entry. | ||
compressedSize := uncompressedSize := entry size. | ||
desiredCompressionMethod := compressedSize > 0 ifTrue: [ CompressionDeflated ] ifFalse: [ CompressionStored ]. | ||
self flag: 'When we replace Files with FileSystem, the following line won''t have to jump throught hoops (FS returns aDateAndTime)'. | ||
self modifiedAt: entry modificationTime. | ||
|
||
] | ||
|
||
{ #category : #'*PharoLauncher-ZipArchive' } | ||
ZipNewFileMember class >> newFromFile: aFileReference [ | ||
^(self new) from: aFileReference | ||
] |
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 @@ | ||
Package { #name : #'PharoLauncher-ZipArchive' } |