Last active
March 9, 2019 01:37
-
-
Save Octogonapus/b0d62e6fdc06d8d9fd18a6e638b88bf6 to your computer and use it in GitHub Desktop.
Writes a Guice injector graph to a .dot file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import arrow.core.Either | |
import arrow.core.right | |
import com.google.common.collect.ImmutableList | |
import com.neuronrobotics.bowlerbuilder.view.cad.cadengine.util.GuiceGrapher | |
import com.neuronrobotics.bowlerkernel.hardware.Script | |
class WriteGuiceGraphScript : Script() { | |
override fun runScript(args: ImmutableList<Any?>): Either<String, Any?> { | |
val filename = if (args.size == 1 && args.first() is String) | |
args.first() as String | |
else | |
"guice-graph.dot" | |
GuiceGrapher.graph(filename, injector) | |
return Unit.right() | |
} | |
override fun stopScript() { } | |
} | |
WriteGuiceGraphScript::class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment