Skip to content

Commit

Permalink
Making some progress!
Browse files Browse the repository at this point in the history
  • Loading branch information
jdp committed Oct 29, 2009
1 parent cf8b106 commit df4dd83
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
35 changes: 31 additions & 4 deletions io/Boid.io
Original file line number Diff line number Diff line change
@@ -1,6 +1,33 @@
#!/usr/bin/env io

BoidException := Exception clone

boidDir = System getEnvironmentVariable("BOIDDIR")
ifNil(boidDir, BoidException raise("BOIDDIR variable not set"))
Boid := Object clone do(

orient := method(
self boidDir := System getEnvironmentVariable("BOIDDIR")
self boidDir ifNil(fail("BOIDDIR environment variable not set"))
Directory with(boidDir) exists ifFalse(fail("`#{boidDir}' does not exist" interpolate))
self binDir := boidDir .. "/active/bin"
Directory with(binDir) exists ifFalse(fail("`#{binDir}' does not exist" interpolate))
self ioDir := boidDir .. "/active/io"
Directory with(ioDir) exists ifFalse(fail("`#{ioDir}' does not exist" interpolate))
)

publicize := method(
Importer addSearchPath(ioDir)
)

fail := method(msg,
"boid: #{msg}" interpolate println
System exit(1)
)

check := method(
"Boid operational. Let's party." println
)

startup := method(
orient
publicize
)

)
1 change: 1 addition & 0 deletions protos
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BoidException Boid

0 comments on commit df4dd83

Please sign in to comment.