ILDiskDirectory

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ILDiskDirectory

thiago_sl
Hi list,

I've finished a very simple port of ILDiskDirectory to Pharo (attched), like Nicolas said [1] (thanks!! ).
The directory is 'mounted' using SpFilename, from Sports package [2]

Tested with:
 - Debian SO  ( !! windows test needed !!)
 - Pharo v1.3 [3]
 - Iliad v0.9.1.2 [4]

Usage:
  a - ILFileHandler addDirectory: ((ILDiskDirectory new) directory: (SpFilename named: '/path/to/my/static/files')).
 
  b - MyILApplication >> updatePage: aPage
         ...
        aPage head stylesheet href: '/myStyleFromDiskDirectory.css'.  " <-- added "

Thiago Lino

[1] http://groups.google.com/group/iliad/browse_thread/thread/07d956f03121be24
[2] http://www.squeaksource.com/SPort
[3] http://www.pharo-project.org
[4] http://www.squeaksource.com/IliadDev
Reply | Threaded
Open this post in threaded view
|

Re: ILDiskDirectory

sebastianconcept
lovely :)
 


Em segunda-feira, 5 de março de 2012 10h58min48s UTC-3, Thiago Lino escreveu:
Hi list,

I've finished a very simple port of ILDiskDirectory to Pharo (attched), like Nicolas said [1] (thanks!! ).
The directory is 'mounted' using SpFilename, from Sports package [2]

Tested with:
 - Debian SO  ( !! windows test needed !!)
 - Pharo v1.3 [3]
 - Iliad v0.9.1.2 [4]

Usage:
  a - ILFileHandler addDirectory: ((ILDiskDirectory new) directory: (SpFilename named: '/path/to/my/static/files')).
 
  b - MyILApplication >> updatePage: aPage
         ...
        aPage head stylesheet href: '/myStyleFromDiskDirectory.css'.  " <-- added "

Thiago Lino

[1] http://groups.google.com/group/iliad/browse_thread/thread/07d956f03121be24
[2] http://www.squeaksource.com/SPort
[3] http://www.pharo-project.org
[4] http://www.squeaksource.com/IliadDev
Reply | Threaded
Open this post in threaded view
|

Re: ILDiskDirectory

thiago_sl
In reply to this post by thiago_sl
sorry, now here goes the ILDiskDirectory class :

'From Pharo1.3 of 16 June 2011 [Latest update: #13315] on 2 March 2012 at 9:24:53 pm'!
ILDirectory subclass: #ILDiskDirectory
instanceVariableNames: 'directory'
classVariableNames: ''
poolDictionaries: ''
category: 'Iliad-Core-DIrectories'!
!ILDiskDirectory commentStamp: 'ThiagoLino 3/2/2012 21:22' prior: 0!
An ILDiskDirectory allows files to be served by Iliad directly from directories.
I shouldn''t be used in production.

Instance Variables:
directory a SpFilename instance!


!ILDiskDirectory methodsFor: 'accessing' stamp: 'ThiagoLino 3/2/2012 15:20'!
directory
^ directory! !

!ILDiskDirectory methodsFor: 'accessing' stamp: 'ThiagoLino 3/2/2012 21:24'!
directory: aDirectory
directory := aDirectory
! !

!ILDiskDirectory methodsFor: 'accessing' stamp: 'ThiagoLino 3/2/2012 21:22'!
fileContentsFor: aString 
| file |
file := self directory construct: aString .
file exists ifFalse: [ ^nil ].
^  file


    ! !

Reply | Threaded
Open this post in threaded view
|

Re: ILDiskDirectory

Bernat Romagosa
Great stuff Thiago, I'll take a look at it later, thanks! :)

2012/3/5 Thiago Lino <[hidden email]>
sorry, now here goes the ILDiskDirectory class :

'From Pharo1.3 of 16 June 2011 [Latest update: #13315] on 2 March 2012 at 9:24:53 pm'!
ILDirectory subclass: #ILDiskDirectory
instanceVariableNames: 'directory'
classVariableNames: ''
poolDictionaries: ''
category: 'Iliad-Core-DIrectories'!
!ILDiskDirectory commentStamp: 'ThiagoLino 3/2/2012 21:22' prior: 0!
An ILDiskDirectory allows files to be served by Iliad directly from directories.
I shouldn''t be used in production.

Instance Variables:
directory a SpFilename instance!


!ILDiskDirectory methodsFor: 'accessing' stamp: 'ThiagoLino 3/2/2012 15:20'!
directory
^ directory! !

!ILDiskDirectory methodsFor: 'accessing' stamp: 'ThiagoLino 3/2/2012 21:24'!
directory: aDirectory
directory := aDirectory
! !

!ILDiskDirectory methodsFor: 'accessing' stamp: 'ThiagoLino 3/2/2012 21:22'!
fileContentsFor: aString 
| file |
file := self directory construct: aString .
file exists ifFalse: [ ^nil ].
^  file


    ! !




--
Bernat Romagosa.
Reply | Threaded
Open this post in threaded view
|

Re: ILDiskDirectory

Nicolas Petton
In reply to this post by thiago_sl
coool!

nico


On Mon, 2012-03-05 at 05:58 -0800, Thiago Lino wrote:

> Hi list,
>
> I've finished a very simple port of ILDiskDirectory to Pharo
> (attched), like Nicolas said [1] (thanks!! ).
> The directory is 'mounted' using SpFilename, from Sports package [2]
>
> Tested with:
>  - Debian SO  ( !! windows test needed !!)
>  - Pharo v1.3 [3]
>  - Iliad v0.9.1.2 [4]
>
> Usage:
>   a - ILFileHandler addDirectory: ((ILDiskDirectory new) directory:
> (SpFilename named: '/path/to/my/static/files')).
>  
>   b - MyILApplication >> updatePage: aPage
>          ...
>         aPage head stylesheet href: '/myStyleFromDiskDirectory.css'.
> " <-- added "
>
> Thiago Lino
>
> [1]
> http://groups.google.com/group/iliad/browse_thread/thread/07d956f03121be24
> [2] http://www.squeaksource.com/SPort
> [3] http://www.pharo-project.org
> [4] http://www.squeaksource.com/IliadDev


Reply | Threaded
Open this post in threaded view
|

Re: ILDiskDirectory

sebastien audier
Great


--
Sébastien AUDIER


Applications web, consulting, design,
site Internet, Promotion de projets.