Skip to content

Commit

Permalink
Update rubric to not depend on deprecated file streams.
Browse files Browse the repository at this point in the history
  • Loading branch information
jecisc committed Aug 17, 2019
1 parent 30a3122 commit e13f2f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 23 deletions.
28 changes: 10 additions & 18 deletions src/Rubric/RubTextAreaExamples.class.st
Expand Up @@ -188,25 +188,17 @@ RubTextAreaExamples class >> profileSourcesFileViewing [
"The big test to check that a TextArea is able to compose and ''quickly'' show
a big file content "

"self profileSourcesFileViewing"

<script>
| contents |

contents := nil.

self
show: 'Wait a moment loading text, the sources file is huge' translated
while: [
contents := (FileStream readOnlyFileNamed: Smalltalk sourcesFile basename) contents
].

TimeProfiler spyAllOn: [
RubEditingArea new
beWrapped;
width: 600;
updateTextWith: contents;
openInWorld
]
"Do not profile reading of source file."
contents := Smalltalk sourcesFile contents.

TimeProfiler
spyAllOn: [ RubEditingArea new
beWrapped;
width: 600;
updateTextWith: contents;
openInWorld ]
]

{ #category : #examples }
Expand Down
7 changes: 2 additions & 5 deletions src/Rubric/RubTextEditor.class.st
Expand Up @@ -1994,11 +1994,8 @@ RubTextEditor >> saveContentsInFile [
suggestedName ifNil: [suggestedName := labelToUse , '.text'].
fileName := UIManager default request: 'File name?'
initialAnswer: suggestedName.
fileName isEmptyOrNil
ifFalse:
[(FileStream newFileNamed: fileName)
nextPutAll: stringToSave;
close]
fileName isEmptyOrNil
ifFalse: [ fileName asFileReference writeStreamDo: [ :out | out nextPutAll: stringToSave ] ]
]

{ #category : #scrolling }
Expand Down

0 comments on commit e13f2f4

Please sign in to comment.