Skip to content

Commit

Permalink
Removed references to IKanServe... Added some ioke dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
felipero committed Apr 18, 2009
1 parent 6bf2f72 commit 097ca27
Show file tree
Hide file tree
Showing 37 changed files with 2,854 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>


<project basedir="." default="jar" name="ikido"> <project basedir="." default="sample-app" name="ikido">
<description> <description>
Ikido is a micro-framework for web apps Ikido is a micro-framework for web apps
</description> </description>
Expand Down
Binary file removed lib/ikanserve.jar
Binary file not shown.
Binary file modified lib/ioke.jar
Binary file not shown.
9 changes: 9 additions & 0 deletions lib/ioke/blank_slate.ik
@@ -0,0 +1,9 @@

BlankSlate = Origin mimic do(
create = method(callback,
bs = BlankSlate mimic
callback call(bs)
bs removeAllMimics!
bs
)
)
55 changes: 55 additions & 0 deletions lib/ioke/debugger.ik
@@ -0,0 +1,55 @@

IokeDebugger = Origin mimic do(
NoSuchRestart = Condition Error mimic

currentlyRunning = []

invoke = method(condition, context,
newDebugger = self with(condition: condition, context: context)
newDebugger runDebugSession
)

runDebugSession = method(
IokeDebugger currentlyRunning << self
len = IokeDebugger currentlyRunning length


newIo = io mimic
newIo prompt = " dbg:#{len}> "

ensure(
loop(
restarts = availableRestarts(self condition)

"The following restarts are available:" println
restarts each(ix, re, out println(" %s: %-20s (%s)" format(ix, re name, re report call(re))))
out println

value = Message fromText(newIo gets)
if((value name == :"internal:createNumber") && (value next name == :"."),
restartToInvoke = value evaluateOn(condition context)
if(restarts[restartToInvoke],
argumentNames = restarts[restartToInvoke] argumentNames
restartArguments = argumentNames map(name,
newIo prompt = " dbg:#{len}:#{name}> "
argVal = Message fromText(newIo gets) evaluateOn(condition context)
out println(" +> #{cell(:argVal) inspect}")
out println

cell(:argVal)
)

out println
invokeRestart(restarts[restartToInvoke], *restartArguments)
)
error!(IokeDebugger NoSuchRestart, number: restartToInvoke),

out println(" +> #{value evaluateOn(condition context) inspect}")
out println)
)

invokeRestart(:abort),

IokeDebugger currentlyRunning = IokeDebugger currentlyRunning[0..-2])
)
)
7 changes: 7 additions & 0 deletions lib/ioke/dokgen.ik
@@ -0,0 +1,7 @@

DokGen = Origin mimic

use("dokgen/collector")
use("dokgen/generator")
use("dokgen/runner")

116 changes: 116 additions & 0 deletions lib/ioke/dokgen/collector.ik
@@ -0,0 +1,116 @@

DokGen do(
KindsToAvoid = [DokGen, JavaGround]

collect = method(
current, collected,
visited set,
idGenerator fn(current, fn(current++)) call(0),

cell(:current) cells each(c,
unless((KindsToAvoid include?(c value)),
if(kindName?(c key),
if(!(visited include?(c value kind)),
visited << c value kind
collected collectedKinds[c value kind] = [c value, {}]
collect(c value, collected, visited, idGenerator)),

id = idGenerator call
if(code?(c value),
fname = c value message filename
(collected collectedFiles[fname] ||= []) << [cell(:current), c key, c value, id])
(collected collectedCells[c key asText] ||= []) << [cell(:current), c key, c value, id, {}]))))

kindName? = method(name,
if((#/^[A-Z]/ =~ name) || ([:nil, :true, :false] include?(name)),
true,
false))

code? = method(val,
((cell(:val) kind?("DefaultMethod")) ||
(cell(:val) kind?("LexicalBlock")) ||
(cell(:val) kind?("DefaultMacro")) ||
(cell(:val) kind?("LexicalMacro")) ||
(cell(:val) kind?("DefaultSyntax"))))

collectSpecs = method(specsPattern, collectedSpecs, collected,
use("ispec")

ISpec Options shouldRun? = false
ISpec shouldExit? = false

FileSystem[specsPattern] each(f, use(f))

ISpec specifications each(spec,
collectSpec(spec, collectedSpecs)
)

collectedSpecs each(cspec,
unless(cspec value cell?(:dokgenSpecAlreadyCollected),
;; also check cells in the sub thingy

fixed = false
segments = cspec key split(" ")
kindName = "%[%s %]" format(segments[0..-2])[0..-2]

cellForSegment = collected collectedCells[segments[-1]]
if(cellForSegment,
place = cellForSegment find(x, (x[0] kind == kindName) || ((x[0] kind == "Ground") && kindName == "") || ((x[0] kind == "IokeGround") && kindName == ""))

if(place,
place[4][cspec key] = cspec value
cspec value dokgenSpecAlreadyCollected = true
fixed = true
)
)

segments = segments[0..-2]

cellForKind = collected collectedKinds[cspec key]
if(cellForKind,
cellForKind[1][cspec key] = cspec value
cspec value dokgenSpecAlreadyCollected = true
fixed = true
)

while(!fixed && (segments length > 0),
kindName = "%[%s %]" format(segments)[0..-2]
kindNameX = "%[%s %]" format(segments[0..-2])[0..-2]

cellForSegment = collected collectedCells[segments[-1]]
if(cellForSegment,
place = cellForSegment find(x, (x[0] kind == kindNameX) || ((x[0] kind == "Ground") && kindNameX == ""))

if(place,
place[4][cspec key] = cspec value
cspec value dokgenSpecAlreadyCollected = true
fixed = true
)
)

unless(fixed,
cellForKind = collected collectedKinds[kindName]

if(cellForKind,
cellForKind[1][cspec key] = cspec value
cspec value dokgenSpecAlreadyCollected = true
fixed = true
)
)

segments = segments[0..-2]
)
)
)
)

collectSpec = method(spec, collectedSpecs,
theList = (collectedSpecs[spec fullName] ||= [])

spec specs each(sp,
if(sp[0] == :description,
collectSpec(sp[1], collectedSpecs),
if(sp[0] == :test,
theList << [sp[1], sp[2]],
theList << [sp[1]]))))
)

0 comments on commit 097ca27

Please sign in to comment.