Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: Enabling the REBOL community

From: al:bri:xtra at: 9-May-2001 20:55

> 2) IIRC Andrew Martin did nice component/module system. I don't know it's
URL though ... but it would be good to look into it imo. It's attached, as there's a lot of new comers recently. Place it into the directory $/Rebol/Scripts/Units/ then put: do %../Scripts/Units/Units.r in your %User.r file for each of your Rebol variants in the directories: %/Rebol/Core. and: %/Rebol/View/ I must get an update onto my site and finish my eText and the Index web site builder (creates a web site from plain text files). Andrew Martin ICQ: 26227169 -><- -- Attached file included as plaintext by Listar -- -- File: Units.r [ Rebol [ Name: 'Units Title: "Units" File: %Units.r Author: "Andrew Martin" eMail: [Al--Bri--xtra--co--nz] Date: 20/April/2001 Home: Version: 1.3.0 History: [ 1.3.0 {Added /Directory to allow specifying a base directory} 1.2.0 {Changed allowed file extensions from string! to file! data-type.} 1.1.0 "Allowed 'Unit to take blocks of filenames." 1.0.0 "Original" ] ] Unit!: make object! [ Units: make block! 0 Do-Once: func [Filename [file!]][ throw-on-error [ Filename: clean-path Filename all [ not found? find Units Filename ( do Filename append Units Filename true ) ] ] ] set 'Unit func [[catch] Filename [file! block!] /Directory Dir [file! url!]][ throw-on-error [ if none? Dir [ Dir: %. ] either block? Filename [ foreach File Filename [ Do-Once Dir/:File ] ][ Do-Once Dir/:Filename ] ] ] ] Units: function [ Directory [file!] Units [word!] Filter [block!] ][ Unit Original-Directory Headers Files Script Header ][ Original-Directory: what-dir Headers: make block! 0 error? try [ change-dir Directory Unit: make object! compose [ Directory: what-dir (to set-word! Units) make block! 0 ] Files: read %. foreach File Files [ if all [ not dir? File any [ found? find/tail File %.r found? find/tail File ] ][ Script: load/header File Header: first Script if all bind bind Filter 'Header 'File [ do Script append Headers reduce [to set-word! Header/Name Header] ] ] ] ] change-dir Original-Directory set in Unit Units make object! Headers Unit ] Patches: Units %../Patches/ 'Patch [ not none? in Header 'File Header/File = File not none? in Header 'Patch Header/Patch = Header/Name ] Enhancements: Units %../Enhancements/ 'Enhancement [ not none? in Header 'File Header/File = File not none? in Header 'Enhancement Header/Enhancement = Header/Name ] ]