From 91f15dc69000bbc593ebd3d819513bb05c9253da Mon Sep 17 00:00:00 2001 From: Jim Weirich Date: Mon, 27 Sep 2010 14:09:38 -0400 Subject: [PATCH] Simplified output for running against multiple rubies. --- rakelib/run.rake | 1 + src/edgecase.rb | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/rakelib/run.rake b/rakelib/run.rake index 6d52f61..a219178 100644 --- a/rakelib/run.rake +++ b/rakelib/run.rake @@ -2,6 +2,7 @@ RUBIES = ENV['KOAN_RUBIES'] || %w(ruby-1.8.7-p299,ruby-1.9.2-p0,jruby-1.5.2,jrub task :runall do chdir('src') do + ENV['SIMPLE_KOAN_OUTPUT'] = 'true' sh "rvm #{RUBIES} path_to_enlightenment.rb" end end diff --git a/src/edgecase.rb b/src/edgecase.rb index 1d7ef5f..424e159 100644 --- a/src/edgecase.rb +++ b/src/edgecase.rb @@ -58,6 +58,11 @@ class Object end module EdgeCase + class << self + def simple_output + ENV['SIMPLE_KOAN_OUTPUT'] == 'true' + end + end module Color #shamelessly stolen (and modified) from redgreen @@ -185,6 +190,18 @@ module EdgeCase end def end_screen + if EdgeCase.simple_output + boring_end_screen + else + artistic_end_screen + end + end + + def boring_end_screen + puts "Mountains are again merely mountains" + end + + def artistic_end_screen completed = <<-ENDTEXT ,, , ,, : ::::, :::,