Changeset 1368

Show
Ignore:
Timestamp:
02/25/08 18:16:39
Author:
rsz
Message:

cleanup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • HTTP/Cache.lua

    r1302 r1368  
    2626local self = setmetatable( _M, {} ) 
    2727local meta = getmetatable( self ) 
     28 
     29-------------------------------------------------------------------------------- 
     30-- Utilities 
     31-------------------------------------------------------------------------------- 
    2832 
    2933local function Read( aPath, aContent, aTime ) 
     
    6367end 
    6468 
     69-------------------------------------------------------------------------------- 
     70-- Metamethods 
     71-------------------------------------------------------------------------------- 
     72 
    6573function meta:__call( aPath, aContent, aTime ) 
    6674    local aModification = lfs.attributes( aPath, 'modification' ) 
     
    7482    return Write( aPath, aContent, aTime ) 
    7583end 
     84 
     85function meta:__concat( aValue ) 
     86    return tostring( self ) .. tostring( aValue ) 
     87end 
     88 
     89function meta:__tostring() 
     90    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     91end 
  • HTTP/Data.lua

    r1290 r1368  
    3434local self = setmetatable( _M, {} ) 
    3535local meta = getmetatable( self ) 
     36 
     37-------------------------------------------------------------------------------- 
     38-- Utilities 
     39-------------------------------------------------------------------------------- 
     40 
    3641local encoders = {} 
    3742 
     
    123128encoders[ 'table' ] = EncodeTable 
    124129 
     130-------------------------------------------------------------------------------- 
     131-- Metamethods 
     132-------------------------------------------------------------------------------- 
     133 
    125134function meta:__call( anObject ) 
    126135    if type( anObject ) == 'table' then 
     
    147156end 
    148157 
     158function meta:__concat( aValue ) 
     159    return tostring( self ) .. tostring( aValue ) 
     160end 
     161 
     162function meta:__tostring() 
     163    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     164end 
     165 
  • HTTP/File.lua

    r1338 r1368  
    3535self.separator = package.path:match( '(%p)%?%.' ) or '/' 
    3636 
     37-------------------------------------------------------------------------------- 
     38-- Utilities 
     39-------------------------------------------------------------------------------- 
     40 
    3741local function Reader( aPath ) 
    3842    return assert( io.open( aPath, 'rb' ) ) 
     
    9397end 
    9498 
     99-------------------------------------------------------------------------------- 
     100-- Metamethods 
     101-------------------------------------------------------------------------------- 
     102 
    95103function meta:__call( ... ) 
    96104    local aPath = table.concat( { ... }, self.separator ) 
     
    104112     
    105113    return aFile 
     114end 
     115 
     116function meta:__concat( aValue ) 
     117    return tostring( self ) .. tostring( aValue ) 
     118end 
     119 
     120function meta:__tostring() 
     121    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
    106122end 
    107123 
  • HTTP/Nanoki.lua

    r1367 r1368  
    145145    local aService = nil 
    146146     
     147    --HTTP[ '/' ] = WikiMainService() 
    147148    HTTP[ '/a' ] = WikiAbout() 
    148149    HTTP[ '/etc/(.+)' ] = HTTPFile( 'etc/' ) 
    149150     
     151    Environment( HTTPRequest.AddressFilter, 'forwarded', Forwarded( ... ) ) 
    150152    HTTPResponse.filter[ #HTTPResponse.filter + 1 ] = ServerFilter 
    151     Environment( HTTPRequest.AddressFilter, 'forwarded', Forwarded( ... ) ) 
    152153    HTTPRequest.secure = Secure( ... ) 
    153154     
  • HTTP/NaturalComparator.lua

    r1296 r1368  
    8282end 
    8383 
     84function meta:__concat( aValue ) 
     85    return tostring( self ) .. tostring( aValue ) 
     86end 
     87 
    8488function meta:__tostring() 
    8589    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
  • HTTP/Template.lua

    r1130 r1368  
    2929local self = setmetatable( _M, {} ) 
    3030local meta = getmetatable( self ) 
     31 
     32-------------------------------------------------------------------------------- 
     33-- Utilities 
     34-------------------------------------------------------------------------------- 
    3135 
    3236local contents = setmetatable( {}, { __mode = 'k' } ) 
     
    6468end 
    6569 
     70-------------------------------------------------------------------------------- 
     71-- Metamethods 
     72-------------------------------------------------------------------------------- 
     73 
    6674function meta:__call( aContent ) 
    6775    local aTemplate = {} 
     
    8189     
    8290    return self( aContent ) 
     91end 
     92 
     93function meta:__concat( aValue ) 
     94    return tostring( self ) .. tostring( aValue ) 
     95end 
     96 
     97function meta:__tostring() 
     98    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
    8399end 
    84100 
  • HTTP/Token.lua

    r1365 r1368  
    107107end 
    108108 
     109function meta:__concat( aValue ) 
     110    return tostring( self ) .. tostring( aValue ) 
     111end 
     112 
     113function meta:__tostring() 
     114    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     115end 
     116 
    109117function self:__call() 
    110118    return ID( context[ self ] ) 
  • HTTP/Trie.lua

    r1303 r1368  
    2828local meta = getmetatable( self ) 
    2929 
    30 local paths = setmetatable( {}, { __mode = 'k' } ) 
    31  
    3230-------------------------------------------------------------------------------- 
    3331-- Utilities 
    3432-------------------------------------------------------------------------------- 
     33 
     34local paths = setmetatable( {}, { __mode = 'k' } ) 
    3535 
    3636local function SetPath( self, aPath ) 
     
    8989function meta:__index( aKey ) 
    9090    return Key( aKey ) 
     91end 
     92 
     93function meta:__concat( aValue ) 
     94    return tostring( self ) .. tostring( aValue ) 
     95end 
     96 
     97function meta:__tostring() 
     98    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
    9199end 
    92100 
  • HTTP/Unidecode.lua

    r1076 r1368  
    1111-- import dependencies 
    1212local io = require( 'io' ) 
     13local math = require( 'math' ) 
     14local string = require( 'string' ) 
    1315 
     16local assert = assert 
    1417local getmetatable = getmetatable 
    1518local pairs = pairs 
     
    1922local require = require 
    2023local setmetatable = setmetatable 
     24local tostring = tostring 
     25 
     26-------------------------------------------------------------------------------- 
     27-- Unidecode 
     28-- as per Sean M. Burke's Text::Unidecode 
     29-- http://search.cpan.org/~sburke/Text-Unidecode-0.04/lib/Text/Unidecode.pm 
     30-- http://interglacial.com/~sburke/tpj/as_html/tpj22.html 
     31-------------------------------------------------------------------------------- 
     32 
     33module( 'Unidecode' ) 
     34_VERSION = '1.0' 
     35 
     36local self = setmetatable( _M, {} ) 
     37local meta = getmetatable( self ) 
    2138 
    2239-------------------------------------------------------------------------------- 
     
    89106 
    90107-------------------------------------------------------------------------------- 
    91 -- Unidecode 
    92 -- as per Sean M. Burke's Text::Unidecode 
    93 -- http://search.cpan.org/~sburke/Text-Unidecode-0.04/lib/Text/Unidecode.pm 
    94 -- http://interglacial.com/~sburke/tpj/as_html/tpj22.html 
     108-- Utilities 
    95109-------------------------------------------------------------------------------- 
    96110 
    97 module( 'Unidecode' ) 
    98 _VERSION = '1.0' 
    99  
    100 local self = setmetatable( _M, {} ) 
    101 local meta = getmetatable( self ) 
    102111local data = setmetatable( {}, {} ) 
    103112local metadata = getmetatable( data ) 
     
    128137end 
    129138 
     139-------------------------------------------------------------------------------- 
     140-- Metamethods 
     141-------------------------------------------------------------------------------- 
     142 
    130143function meta:__call( aValue ) 
    131144    if aValue then 
     
    136149end 
    137150 
     151function meta:__concat( aValue ) 
     152    return tostring( self ) .. tostring( aValue ) 
     153end 
     154 
     155function meta:__tostring() 
     156    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     157end 
  • HTTP/Wiki.lua

    r1338 r1368  
    130130        end 
    131131 
     132        aNewContent = WikiContent( aNewName ) 
     133         
    132134        WikiDate[ aNewContent.creation ] = aNewContent.name 
    133135        WikiRecent[ aNewContent.modification ] = aNewContent.name 
  • HTTP/WikiAbout.lua

    r1287 r1368  
    7676end 
    7777 
     78function meta:__concat( aValue ) 
     79    return tostring( self ) .. tostring( aValue ) 
     80end 
     81 
    7882function meta:__tostring() 
    7983    local Nanoki = require( 'Nanoki' ) 
  • HTTP/WikiContent.lua

    r1349 r1368  
    435435function meta:__index( aKey ) 
    436436    return Name( aKey, 0 ) 
     437end 
     438 
     439function meta:__concat( aValue ) 
     440    return tostring( self ) .. tostring( aValue ) 
     441end 
     442 
     443function meta:__tostring() 
     444    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
    437445end 
    438446 
  • HTTP/WikiContentService.lua

    r1346 r1368  
    398398end 
    399399 
     400function meta:__concat( aValue ) 
     401    return tostring( self ) .. tostring( aValue ) 
     402end 
     403 
     404function meta:__tostring() 
     405    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     406end 
     407 
    400408function self:__concat( aValue ) 
    401409    return tostring( self ) .. tostring( aValue ) 
  • HTTP/WikiControlService.lua

    r1357 r1368  
    309309end 
    310310 
     311function meta:__concat( aValue ) 
     312    return tostring( self ) .. tostring( aValue ) 
     313end 
     314 
     315function meta:__tostring() 
     316    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     317end 
     318 
    311319function self:__concat( aValue ) 
    312320    return tostring( self ) .. tostring( aValue ) 
  • HTTP/WikiDateNavigation.lua

    r1212 r1368  
    187187 
    188188    return aNavigation 
     189end 
     190 
     191function meta:__concat( aValue ) 
     192    return tostring( self ) .. tostring( aValue ) 
     193end 
     194 
     195function meta:__tostring() 
     196    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
    189197end 
    190198 
  • HTTP/WikiDateService.lua

    r1327 r1368  
    212212end 
    213213 
     214function meta:__concat( aValue ) 
     215    return tostring( self ) .. tostring( aValue ) 
     216end 
     217 
     218function meta:__tostring() 
     219    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     220end 
     221 
    214222function self:__concat( aValue ) 
    215223    return tostring( self ) .. tostring( aValue ) 
  • HTTP/WikiDiffService.lua

    r1361 r1368  
    218218end 
    219219 
     220function meta:__concat( aValue ) 
     221    return tostring( self ) .. tostring( aValue ) 
     222end 
     223 
     224function meta:__tostring() 
     225    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     226end 
     227 
    220228function self:__concat( aValue ) 
    221229    return tostring( self ) .. tostring( aValue ) 
  • HTTP/WikiEditorService.lua

    r1362 r1368  
    374374end 
    375375 
     376function meta:__concat( aValue ) 
     377    return tostring( self ) .. tostring( aValue ) 
     378end 
     379 
     380function meta:__tostring() 
     381    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     382end 
     383 
    376384function self:__call( aName, aContext ) 
    377385    return Save( aName, aContext ) 
  • HTTP/WikiFeed.lua

    r1310 r1368  
    1818local setmetatable = setmetatable 
    1919local tostring = tostring 
     20 
     21-------------------------------------------------------------------------------- 
     22-- WikiFeed 
     23-------------------------------------------------------------------------------- 
     24 
     25module( 'WikiFeed' ) 
     26_VERSION = '1.0' 
     27 
     28local self = setmetatable( _M, {} ) 
     29local meta = getmetatable( self ) 
    2030 
    2131-------------------------------------------------------------------------------- 
     
    7080 
    7181-------------------------------------------------------------------------------- 
    72 -- WikiFeed 
     82-- Metamethods 
    7383-------------------------------------------------------------------------------- 
    74  
    75 module( 'WikiFeed' ) 
    76 _VERSION = '1.0' 
    77  
    78 local self = setmetatable( _M, {} ) 
    79 local meta = getmetatable( self ) 
    8084 
    8185function meta:__call( anIterator, aGenerator, aContext ) 
     
    8589     
    8690    return aFeed 
     91end 
     92 
     93function meta:__concat( aValue ) 
     94    return tostring( self ) .. tostring( aValue ) 
     95end 
     96 
     97function meta:__tostring() 
     98    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
    8799end 
    88100 
  • HTTP/WikiFileService.lua

    r1327 r1368  
    409409end 
    410410 
     411function meta:__concat( aValue ) 
     412    return tostring( self ) .. tostring( aValue ) 
     413end 
     414 
     415function meta:__tostring() 
     416    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     417end 
     418 
    411419function self:__concat( aValue ) 
    412420    return tostring( self ) .. tostring( aValue ) 
  • HTTP/WikiIndexNavigation.lua

    r1167 r1368  
    126126end 
    127127 
     128function meta:__concat( aValue ) 
     129    return tostring( self ) .. tostring( aValue ) 
     130end 
     131 
     132function meta:__tostring() 
     133    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     134end 
     135 
    128136function self:__concat( aValue ) 
    129137    return tostring( self ) .. tostring( aValue ) 
  • HTTP/WikiIndexService.lua

    r1327 r1368  
    178178end 
    179179 
     180function meta:__concat( aValue ) 
     181    return tostring( self ) .. tostring( aValue ) 
     182end 
     183 
     184function meta:__tostring() 
     185    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     186end 
     187 
    180188function self:__concat( aValue ) 
    181189    return tostring( self ) .. tostring( aValue ) 
  • HTTP/WikiMessage.lua

    r1239 r1368  
    3030local meta = getmetatable( self ) 
    3131 
     32-------------------------------------------------------------------------------- 
     33-- Utilities 
     34-------------------------------------------------------------------------------- 
     35 
    3236local types = { info = 'info', warning = 'warning', error = 'error' } 
    3337local tags = { info = 'span', warning = 'em', error = 'strong' } 
     38 
     39-------------------------------------------------------------------------------- 
     40-- Metamethods 
     41-------------------------------------------------------------------------------- 
    3442 
    3543function meta:__call( aText, aType ) 
     
    3947     
    4048    return aMessage 
     49end 
     50 
     51function meta:__concat( aValue ) 
     52    return tostring( self ) .. tostring( aValue ) 
     53end 
     54 
     55function meta:__tostring() 
     56    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
    4157end 
    4258 
  • HTTP/WikiPath.lua

    r1255 r1368  
    6767end 
    6868 
     69function meta:__concat( aValue ) 
     70    return tostring( self ) .. tostring( aValue ) 
     71end 
     72 
     73function meta:__tostring() 
     74    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     75end 
     76 
    6977function self:__newindex( aKey, aValue ) 
    7078    AddComponent( self, aValue ) 
  • HTTP/WikiPreview.lua

    r1304 r1368  
    5151end 
    5252 
     53function meta:__concat( aValue ) 
     54    return tostring( self ) .. tostring( aValue ) 
     55end 
     56 
     57function meta:__tostring() 
     58    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     59end 
     60 
    5361function self:__tostring() 
    5462    local markdown = require( 'markdown' ) 
  • HTTP/WikiRecent.lua

    r1338 r1368  
    7777end 
    7878 
     79function meta:__concat( aValue ) 
     80    return tostring( self ) .. tostring( aValue ) 
     81end 
     82 
     83function meta:__tostring() 
     84    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     85end 
     86 
    7987function meta:__index( aKey ) 
    8088    return Wiki.NameIterator( Directory() ) 
     
    9098    error( ( 'Invalid parameters: %q = %q' ):format( tostring( aKey ), tostring( aValue ) ) ) 
    9199end 
    92  
    93 function meta:__concat( aValue ) 
    94     return tostring( self ) .. tostring( aValue ) 
    95 end 
    96  
    97 function meta:__tostring() 
    98     return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
    99 end 
  • HTTP/WikiRecentService.lua

    r1350 r1368  
    221221end 
    222222 
     223function meta:__concat( aValue ) 
     224    return tostring( self ) .. tostring( aValue ) 
     225end 
     226 
     227function meta:__tostring() 
     228    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     229end 
     230 
    223231function self:__concat( aValue ) 
    224232    return tostring( self ) .. tostring( aValue ) 
  • HTTP/WikiRevisionService.lua

    r1314 r1368  
    194194end 
    195195 
     196function meta:__concat( aValue ) 
     197    return tostring( self ) .. tostring( aValue ) 
     198end 
     199 
     200function meta:__tostring() 
     201    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     202end 
     203 
    196204function self:__concat( aValue ) 
    197205    return tostring( self ) .. tostring( aValue ) 
  • HTTP/WikiSearchService.lua

    r1327 r1368  
    200200end 
    201201 
     202function meta:__concat( aValue ) 
     203    return tostring( self ) .. tostring( aValue ) 
     204end 
     205 
     206function meta:__tostring() 
     207    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     208end 
     209 
    202210function self:__concat( aValue ) 
    203211    return tostring( self ) .. tostring( aValue ) 
  • HTTP/WikiService.lua

    r1360 r1368  
    3131module( 'WikiService' ) 
    3232_VERSION = '1.0' 
     33 
     34local self = setmetatable( _M, {} ) 
     35local meta = getmetatable( self ) 
    3336 
    3437-------------------------------------------------------------------------------- 
     
    302305end 
    303306 
     307-------------------------------------------------------------------------------- 
     308-- Metamethods 
     309-------------------------------------------------------------------------------- 
     310 
     311function meta:__concat( aValue ) 
     312    return tostring( self ) .. tostring( aValue ) 
     313end 
     314 
     315function meta:__tostring() 
     316    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     317end 
  • HTTP/WikiVersionService.lua

    r1332 r1368  
    103103end 
    104104 
     105function meta:__concat( aValue ) 
     106    return tostring( self ) .. tostring( aValue ) 
     107end 
     108 
     109function meta:__tostring() 
     110    return ( '%s/%s' ):format( self._NAME, self._VERSION ) 
     111end 
     112 
    105113function self:__concat( aValue ) 
    106114    return tostring( self ) .. tostring( aValue ) 
  • HTTP/etc/custom-screen.css

    r1342 r1368  
    44ul          { list-style-type: circle; } 
    55p img       { float: none; margin: 0 0 0 0; padding: 0 0 0 0; } 
    6 a:link      { color: #555; text-decoration: none; } 
    7 a:visited   { color: #777; text-decoration: none; } 
    8 a:hover     { color: #333; text-decoration: none; } 
    9 a:active    { color: #111; text-decoration: none; } 
     6a:link      { color: rgb( 153, 153, 153 ); text-decoration: none; } 
     7a:visited   { color: rgb( 102, 102, 102 ); text-decoration: none; } 
     8a:hover     { color: rgb( 051, 051, 051 ); text-decoration: none; } 
     9a:active    { color: rgb( 204, 204, 204 ); text-decoration: none; } 
    1010 
    1111.box        { border: 1px solid #999999; }