Skip to content

Commit

Permalink
Applying @morplenauta feedback, removing non-Smalltalk syntax from We…
Browse files Browse the repository at this point in the history
…b module
  • Loading branch information
ajlopez committed Dec 2, 2012
1 parent fba5814 commit 0fc27e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 14 deletions.
2 changes: 2 additions & 0 deletions Src/AjTalk.Tests/AssertTests/Library.st
Expand Up @@ -354,3 +354,5 @@ import: aName
Object subclass: #Block nativeType: @AjTalk.Language.Block
!

Object subclass: #StringBuilder nativeType: @System.Text.StringBuilder
!
7 changes: 0 additions & 7 deletions Src/AjTalk.Tests/AssertTests/WebTests.st
Expand Up @@ -119,13 +119,6 @@ canvas := Web.Canvas new.

Web.Canvas define: #Html tag: 'html'.

"
Smalltalk !!GetNames do: [ :name | @System.Console !!WriteLine: name ].
Web !!GetNames do: [ :name | @System.Console !!WriteLine: name ].

Web.Canvas !!GetInstanceMethods do: [:mth | @System.Console !!WriteLine: mth !!Name ].
"

canvas html: 'Example'.

[canvas asString = '<html>Example</html>'] assert.
Expand Down
14 changes: 7 additions & 7 deletions Src/AjTalk.Tests/modules/Web/Canvas.st
Expand Up @@ -10,7 +10,7 @@
define: aSymbol tag: aTag
| newclass currentenv |
currentenv := Environment current.
self !!Scope setCurrent.
self scope setCurrent.

newclass := Brush subclass: aSymbol
instanceVariableNames: ''
Expand All @@ -20,15 +20,15 @@ define: aSymbol tag: aTag

newclass class compile: 'new ^self new: ' , $' , aTag , $'.

self compile: (aSymbol !!ToLower) , '
self compile: (aSymbol toLower) , '
| brush |
brush := ' , aSymbol , ' new.
brush canvas: self.
^brush'.

self compile: (aSymbol !!ToLower) , ': content
self compile: (aSymbol toLower) , ': content
| brush |
brush := self ' , (aSymbol !!ToLower) , '.
brush := self ' , (aSymbol toLower) , '.
brush with: content.
^brush'.

Expand All @@ -38,11 +38,11 @@ define: aSymbol tag: aTag
!Canvas methods!

initialize
builder := @System.Text.StringBuilder !!new
builder := StringBuilder new
!

render: anObject
builder !!Append: (anObject !!ToString)
builder append: (anObject toString)
!

paragraph
Expand Down Expand Up @@ -88,7 +88,7 @@ div: content
!

asString
^builder !!ToString
^builder toString
! !

!Object methods!
Expand Down

0 comments on commit 0fc27e6

Please sign in to comment.