Permalink
Browse files

Removed references to IKanServe... Added some ioke dependencies

  • Loading branch information...
1 parent 6bf2f72 commit 097ca278760d3d139e8b9cdadac1eb0baa3a5e22 @felipero committed Apr 18, 2009
Showing with 2,854 additions and 9 deletions.
  1. +1 −1 build.xml
  2. BIN lib/ikanserve.jar
  3. BIN lib/ioke.jar
  4. +9 −0 lib/ioke/blank_slate.ik
  5. +55 −0 lib/ioke/debugger.ik
  6. +7 −0 lib/ioke/dokgen.ik
  7. +116 −0 lib/ioke/dokgen/collector.ik
  8. +242 −0 lib/ioke/dokgen/generator.ik
  9. +50 −0 lib/ioke/dokgen/htmlGenerator/CellFrame.ik_template
  10. +59 −0 lib/ioke/dokgen/htmlGenerator/FileFile.ik_template
  11. +50 −0 lib/ioke/dokgen/htmlGenerator/FileFrame.ik_template
  12. +115 −0 lib/ioke/dokgen/htmlGenerator/KindFile.ik_template
  13. +50 −0 lib/ioke/dokgen/htmlGenerator/KindFrame.ik_template
  14. +51 −0 lib/ioke/dokgen/htmlGenerator/Readme.ik_template
  15. +51 −0 lib/ioke/dokgen/htmlGenerator/stationary/README.html
  16. +174 −0 lib/ioke/dokgen/htmlGenerator/stationary/dokgen-style.css
  17. +25 −0 lib/ioke/dokgen/htmlGenerator/stationary/index.html
  18. +64 −0 lib/ioke/dokgen/htmlGenerator/templates.ik
  19. +37 −0 lib/ioke/dokgen/runner.ik
  20. +238 −0 lib/ioke/iopt.ik
  21. +185 −0 lib/ioke/iopt/action.ik
  22. +108 −0 lib/ioke/iopt/commandLine.ik
  23. +12 −0 lib/ioke/iopt/conditions.ik
  24. +156 −0 lib/ioke/iopt/doc.ik
  25. +2 −0 lib/ioke/iopt/help.ik
  26. +35 −0 lib/ioke/iopt/help/plain.ik
  27. +19 −0 lib/ioke/ispec.ik
  28. +12 −0 lib/ioke/ispec/conditions.ik
  29. +51 −0 lib/ioke/ispec/describeContext.ik
  30. +184 −0 lib/ioke/ispec/expectations.ik
  31. +25 −0 lib/ioke/ispec/extendedDefaultBehavior.ik
  32. +187 −0 lib/ioke/ispec/formatter.ik
  33. +102 −0 lib/ioke/ispec/reporter.ik
  34. +229 −0 lib/ioke/ispec/runner.ik
  35. +110 −0 lib/ioke/text_scanner.ik
  36. +0 −2 src/ioke/iks_load.ik
  37. +43 −6 test/ikido_spec.ik
View
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
-<project basedir="." default="jar" name="ikido">
+<project basedir="." default="sample-app" name="ikido">
<description>
Ikido is a micro-framework for web apps
</description>
View
Binary file not shown.
View
Binary file not shown.
View
@@ -0,0 +1,9 @@
+
+BlankSlate = Origin mimic do(
+ create = method(callback,
+ bs = BlankSlate mimic
+ callback call(bs)
+ bs removeAllMimics!
+ bs
+ )
+)
View
@@ -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])
+ )
+)
View
@@ -0,0 +1,7 @@
+
+DokGen = Origin mimic
+
+use("dokgen/collector")
+use("dokgen/generator")
+use("dokgen/runner")
+
@@ -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]]))))
+)
Oops, something went wrong.

0 comments on commit 097ca27

Please sign in to comment.