code: purgatorio

ref: 5edeca01b0622463a65c126ebcc29314013fd928
dir: /usr/inferno/lib/plumbing/

View raw version
# these are in order from most specific to least,
# since first rule that fires wins.

# image files go to wm/view
kind is text
data matches '[a-zA-Z0-9_\-./]+'
data matches '([a-zA-Z0-9_\-./]+)\.(jpg|jpeg|gif|bit|png)'
data isfile     $0
plumb to view
plumb start /dis/wm/view.dis -i $file

# sounds go to auplay
kind is text
data matches '[a-zA-Z0-9_\-./]+'
data matches '([a-zA-Z0-9_\-./]+)\.(iaf|wav)'
data isfile     $0
plumb alwaysstart auplay
plumb start /dis/auplay.dis $file

# URLs go to wm/charon
kind is text
data matches '(https?|ftp|file|gopher|mailto|news|nntp|telnet|wais|prospero)://[a-zA-Z0-9_@]+([.:][a-zA-Z0-9_@]+)*/?[a-zA-Z0-9_?#~&/\-]+([:.][a-zA-Z0-9_?#~&/\-]+)*'
plumb to web
plumb start /dis/charon.dis $0

# file URLs go to wm/charon
kind is text
data matches '[a-zA-Z0-9_/\-]+\.html?'
data isfile $0
data set file://localhost$file
plumb to web
plumb start /dis/charon.dis $data

# .m files are looked up in /module and passed to wm/brutus
kind is text
data matches '([a-zA-Z0-9]+\.m)(:[0-9]+)?'
data isfile     /module/$1
data set        /module/$0
plumb to edit
plumb start /dis/wm/brutus.dis $file$2

# existing files, possibly tagged by line number, go to wm/brutus
kind is text
data matches '([.a-zA-Z0-9_/\-]+[a-zA-Z0-9_/\-])(:[0-9]+)?'
data isfile     $1
plumb to edit
plumb start /dis/wm/brutus.dis $file$2

# existing files go to brutus
kind is text
data matches '[a-zA-Z0-9_./\-]+'
data isdir      $0
plumb alwaysstart dir # nasty plumbing hack
plumb start /dis/wm/dir.dis $dir

# man pages
kind is text
data matches '([a-zA-Z\-]+)\(([0-9]+)\)'
plumb alwaysstart man # nasty plumbing hack
plumb start /dis/wm/man.dis $2 $1