Skip to content

Instantly share code, notes, and snippets.

@JoshCheek
Last active May 6, 2017 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JoshCheek/32b07650aacd7de3586eddc1f9809ddc to your computer and use it in GitHub Desktop.
Save JoshCheek/32b07650aacd7de3586eddc1f9809ddc to your computer and use it in GitHub Desktop.
Clojure koans output hilighter
#!/usr/bin/env ruby -p
# Output hilighter for the Clojure koans:
# https://github.com/functional-koans/clojure-koans
# written against git commit
# 9b3efbb0268794c6f5e5516589bb17ed78000602
gsub /^clojure\.lang\.ExceptionInfo:\s+(.*)$/,
"\e[41;37;1m \\1 \e[0m"
gsub Regexp.new("#{ENV['PWD']}(?:/(src/koans/))?(.*)(:)?(?:\.\.\.|(\\d+))"),
"\\1\e[32m\\2\e[39m\\3\e[34m\\4\e[0m"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment