-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored constants from installation
- Loading branch information
Showing
11 changed files
with
74 additions
and
62 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
packages/Spellcheck-Core.package/SPCHunspellAPIDecorator.class/class/awesomeLibraryName.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,3 @@ | ||
library | ||
awesomeLibraryName | ||
^ 'MyAwesomeLibrary.so' |
3 changes: 3 additions & 0 deletions
3
packages/Spellcheck-Core.package/SPCHunspellAPIDecorator.class/class/gitDictionaryURL.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,3 @@ | ||
library | ||
gitDictionaryURL | ||
^ SPCHunspellAPIDecorator gitURL, 'build-support/dictionaries/' |
3 changes: 3 additions & 0 deletions
3
packages/Spellcheck-Core.package/SPCHunspellAPIDecorator.class/class/gitURL.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,3 @@ | ||
library | ||
gitURL | ||
^'https://raw.githubusercontent.com/hpi-swa-teaching/SpellChecking/dev/' |
9 changes: 9 additions & 0 deletions
9
...k-Core.package/SPCHunspellAPIDecorator.class/instance/downloadDictionaries.ofLanguage..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,9 @@ | ||
library installation | ||
downloadDictionaries: aString ofLanguage: aLanguage | ||
|
||
| resourceDirectory | | ||
resourceDirectory := self class ressourceDirectory directoryNamed: 'dictionaries'. | ||
resourceDirectory createDirectory: aLanguage. | ||
resourceDirectory := resourceDirectory directoryNamed: aLanguage. | ||
self downloadFileTo: resourceDirectory fromURL: self class gitDictionaryURL, aLanguage, '/', aString, '.dic' toFileNamed: aString, '.dic' inBinary: false. | ||
self downloadFileTo: resourceDirectory fromURL: self class gitDictionaryURL, aLanguage, '/', aString, '.aff' toFileNamed: aString, '.aff' inBinary: false. |
38 changes: 8 additions & 30 deletions
38
...es/Spellcheck-Core.package/SPCHunspellAPIDecorator.class/instance/downloadDictionaries.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 |
---|---|---|
@@ -1,40 +1,18 @@ | ||
library installation | ||
downloadDictionaries | ||
| resourceDir aStream | | ||
| resourceDir | | ||
resourceDir := self class ressourceDirectory. | ||
(resourceDir directoryExists: 'dictionaries') ifFalse: [ | ||
'Fetching SpellChecking dependencies' displayProgressAt: Sensor cursorPoint from: 0 to: 6 during: [ :bar | | ||
'Fetching SpellChecking dependencies' displayProgressAt: Sensor cursorPoint from: 0 to: 3 during: [ :bar | | ||
resourceDir createDirectory: 'dictionaries'. | ||
resourceDir := resourceDir directoryNamed: 'dictionaries'. | ||
resourceDir createDirectory: 'english'. | ||
resourceDir := resourceDir directoryNamed: 'english'. | ||
self downloadFileTo: resourceDir fromURL: 'https://github.com/hpi-swa-teaching/SpellChecking/raw/libraries-install-squeak/en_US.dic' toFileNamed: 'en_US.dic' inBinary: false. | ||
self downloadDictionaries: 'en_US' ofLanguage: 'english'. | ||
bar value: 1. | ||
self downloadFileTo: resourceDir fromURL: 'https://github.com/hpi-swa-teaching/SpellChecking/raw/libraries-install-squeak/en_US.aff' toFileNamed: 'en_US.aff' inBinary: false. | ||
|
||
self downloadDictionaries: 'de_DE' ofLanguage: 'german'. | ||
bar value: 2. | ||
resourceDir := FileDirectory forFileName: resourceDir pathName. | ||
resourceDir createDirectory: 'german'. | ||
resourceDir := resourceDir directoryNamed: 'german'. | ||
self downloadFileTo: resourceDir fromURL: 'https://github.com/hpi-swa-teaching/SpellChecking/raw/libraries-install-squeak/de_DE.dic' toFileNamed: 'de_DE.dic' inBinary: false. | ||
|
||
self downloadDictionaries: 'sq_SQ' ofLanguage: 'squeak'. | ||
bar value: 3. | ||
self downloadFileTo: resourceDir fromURL: 'https://github.com/hpi-swa-teaching/SpellChecking/raw/libraries-install-squeak/de_DE.aff' toFileNamed: 'de_DE.aff' inBinary: false. | ||
bar value: 4. | ||
resourceDir := FileDirectory forFileName: resourceDir pathName. | ||
resourceDir createDirectory: 'squeak'. | ||
resourceDir := resourceDir directoryNamed: 'squeak'. | ||
self downloadFileTo: resourceDir fromURL: 'https://raw.githubusercontent.com/hpi-swa-teaching/SpellChecking/dev/build-support/dictionaries/squeak/sq_SQ.dic' toFileNamed: 'sq_SQ.dic' inBinary: false. | ||
bar value: 5. | ||
self downloadFileTo: resourceDir fromURL: 'https://raw.githubusercontent.com/hpi-swa-teaching/SpellChecking/dev/build-support/dictionaries/squeak/sq_SQ.aff' toFileNamed: 'sq_SQ.aff' inBinary: false. | ||
bar value: 6. | ||
] | ||
]. | ||
resourceDir := self class ressourceDirectory directoryNamed: 'dictionaries'. | ||
(resourceDir directoryExists: 'custom') ifFalse: [ | ||
resourceDir createDirectory: 'custom'. | ||
resourceDir := resourceDir directoryNamed: 'custom'. | ||
resourceDir newFileNamed: 'cu_CU.aff'. | ||
aStream := FileStream fileNamed: SPCSpellChecker defaultCustomDictionaryPath. | ||
aStream nextPutAll: '0'. | ||
aStream lf. | ||
aStream close | ||
] | ||
self initializeCustomDictionary. |
14 changes: 14 additions & 0 deletions
14
...llcheck-Core.package/SPCHunspellAPIDecorator.class/instance/initializeCustomDictionary.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,14 @@ | ||
library installation | ||
initializeCustomDictionary | ||
|
||
| aStream resourceDir | | ||
resourceDir := self class ressourceDirectory directoryNamed: 'dictionaries'. | ||
(resourceDir directoryExists: 'custom') ifFalse: [ | ||
resourceDir createDirectory: 'custom'. | ||
resourceDir := resourceDir directoryNamed: 'custom'. | ||
resourceDir newFileNamed: 'cu_CU.aff'. | ||
aStream := FileStream fileNamed: SPCSpellChecker defaultCustomDictionaryPath. | ||
aStream nextPutAll: '0'. | ||
aStream lf. | ||
aStream close | ||
] |
28 changes: 13 additions & 15 deletions
28
...check-Core.package/SPCHunspellAPIDecorator.class/instance/installLibrariesForLinux.in..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 |
---|---|---|
@@ -1,20 +1,18 @@ | ||
library installation | ||
installLibrariesForLinux: anInteger in: anEntry | ||
| subdir | | ||
| subdir urlAddition | | ||
subdir := anEntry. | ||
(anInteger = 64) ifTrue: [ | ||
(subdir fileExists: 'libhunspell-1.6.so.0') ifFalse: [ | ||
self downloadFileTo: subdir fromURL: 'https://github.com/hpi-swa-teaching/SpellChecking/raw/dev/64bit-libhunspell-1.6.so.0' toFileNamed: 'libhunspell-1.6.so.0' inBinary: true. | ||
] | ||
] | ||
ifFalse: [ | ||
(subdir fileExists: 'libhunspell-1.6.so.0') ifFalse: [ | ||
self downloadFileTo: subdir fromURL: 'https://github.com/hpi-swa-teaching/SpellChecking/raw/dev/libhunspell-1.6.so.0' toFileNamed: 'libhunspell-1.6.so.0' inBinary: true | ||
]. | ||
urlAddition := ''. | ||
(subdir fileExists: self class moduleName) ifFalse:[ | ||
(anInteger = 64) ifTrue: [ | ||
urlAddition :='64bit-' | ||
] ifFalse: [ | ||
(subdir fileExists: 'libstdc++.so.6') ifFalse: [ | ||
self downloadFileTo: subdir fromURL: 'https://github.com/hpi-swa-teaching/SpellChecking/raw/dev/libstdc%2B%2B.so.6' toFileNamed: 'libstdc++.so.6' inBinary: true | ||
] | ||
self downloadFileTo: subdir fromURL: (self class gitURL,'libstdc%2B%2B.so.6') toFileNamed: 'libstdc++.so.6' inBinary: true | ||
] | ||
]. | ||
(subdir fileExists: 'MyAwesomeLibrary.so') ifFalse: [ | ||
self downloadFileTo: subdir fromURL: 'https://github.com/hpi-swa-teaching/SpellChecking/raw/dev/MyAwesomeLibrary.so' toFileNamed: 'MyAwesomeLibrary.so' inBinary: true | ||
] | ||
self downloadFileTo: subdir fromURL: (self class gitURL, urlAddition, self class moduleName) toFileNamed: self class moduleName inBinary: true | ||
]. | ||
(subdir fileExists: self class awesomeLibraryName) ifFalse: [ | ||
self downloadFileTo: subdir fromURL: (self class gitURL, self class awesomeLibraryName) toFileNamed: self class awesomeLibraryName inBinary: true | ||
] |
4 changes: 2 additions & 2 deletions
4
...check-Core.package/SPCHunspellAPIDecorator.class/instance/installLibrariesForMacOS.in..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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
library installation | ||
installLibrariesForMacOS: anInteger in: anEntry | ||
|
||
(anEntry fileExists: 'libhunspell-darwin-x86-32.dylib') ifFalse: [ | ||
self downloadFileTo: (anEntry) fromURL: 'https://raw.githubusercontent.com/hpi-swa-teaching/SpellChecking/dev/libhunspell-darwin-x86-32.dylib' toFileNamed: 'libhunspell-darwin-x86-32.dylib' inBinary: true | ||
(anEntry fileExists: self class moduleName) ifFalse: [ | ||
self downloadFileTo: anEntry fromURL: self class gitURL, self class moduleName toFileNamed: self class moduleName inBinary: true | ||
] |
19 changes: 9 additions & 10 deletions
19
...eck-Core.package/SPCHunspellAPIDecorator.class/instance/installLibrariesForWindows.in..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 |
---|---|---|
@@ -1,13 +1,12 @@ | ||
library installation | ||
installLibrariesForWindows: anInteger in: anEntry | ||
|
||
(anInteger = 64) ifTrue: [ | ||
(anEntry fileExists: 'libhunspellx64.dll') ifFalse: [ | ||
self downloadFileTo: anEntry fromURL: 'https://raw.githubusercontent.com/hpi-swa-teaching/SpellChecking/dev/libhunspellx64.dll' toFileNamed: 'libhunspellx64.dll' inBinary: true | ||
] | ||
] | ||
ifFalse: [ | ||
(anEntry fileExists: 'libhunspellx64.dll') ifFalse: [ | ||
self downloadFileTo: anEntry fromURL: 'https://raw.githubusercontent.com/hpi-swa-teaching/SpellChecking/dev/libhunspellx32.dll' toFileNamed: 'libhunspellx64.dll' inBinary: true | ||
] | ||
] | ||
| downloadURL | | ||
(anEntry fileExists: self class moduleName) ifFalse: [ | ||
(anInteger = 64) ifTrue: [ | ||
downloadURL := self class gitURL, self class moduleName | ||
] ifFalse: [ | ||
downloadURL := self class gitURL, 'libhunspellx32.dll' | ||
]. | ||
self downloadFileTo: anEntry fromURL: downloadURL toFileNamed: self class moduleName inBinary: true | ||
]. |
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
Large diffs are not rendered by default.
Oops, something went wrong.