Simplified output for running against multiple rubies.
authorJim Weirich <jim.weirich@gmail.com>
Mon, 27 Sep 2010 18:09:38 +0000 (14:09 -0400)
committerJim Weirich <jim.weirich@gmail.com>
Mon, 27 Sep 2010 18:09:38 +0000 (14:09 -0400)
rakelib/run.rake
src/edgecase.rb

index 6d52f61..a219178 100644 (file)
@@ -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
index 1d7ef5f..424e159 100644 (file)
@@ -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
                                   ,,   ,  ,,
                                 :      ::::,    :::,