Permalink
Browse files

make rails runs more 1.9 compat, add the VERBOSE=1 option [quite usef…

…ul to make sure things aren't amuck]
  • Loading branch information...
1 parent 839dcb0 commit 05bfbf606a04baa59cc24888e6c1937f0eb91502 @rdp rdp committed Jun 14, 2009
View
8 README
@@ -15,12 +15,10 @@ Examples:
rake bench:file FILE=rbs/micro-benchmarks/bm_app_tak.rb
rake bench:dir DIR=rbs/micro-benchmarks
rake bench:to_csv
- rake bench:pattern PATTERN=rbs/micro-benchmarks/bm_gc*
- rake VM=/bin/ruby_special ITERATIONS=3 TIMEOUT=5
-
The :to_csv task creates a .csv spreadsheet of the results. Quite handy for comparing your results over time.
-
-The VM example runs '/bin/ruby_special' as the VM, 3 iterations instead of the default (5)5, 5 second timeout (per script) instead of the default 300s
+ rake bench:pattern PATTERN=rbs/micro-benchmarks/bm_gc*
+ rake VM=/bin/ruby_special ITERATIONS=3 TIMEOUT=5 VERBOSE=1
+This example runs '/bin/ruby_special' as the VM, 3 iterations instead of the default (5), 5 second timeout (per script) instead of the default 300s, and outputs all messages instead of swallowing them (the default).
DIRECTORY STRUCTURE
@@ -0,0 +1 @@
+require 'csv'
@@ -0,0 +1 @@
+require 'fileutils'
@@ -6,7 +6,7 @@
# Specifies gem version of Rails to use when vendor/rails is not present
RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
-
+$: << "../19_compat" if RUBY_VERSION >= '1.9' # 1.9 compat libs
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')
require File.join(File.dirname(__FILE__), '../vendor/plugins/engines/boot')
@@ -73,4 +73,4 @@
# Globals
ERROR_EMPTY = 'Please fill in this field.'
-ERROR_NUMBER = 'Please enter only numbers (0-9) in this field.'
+ERROR_NUMBER = 'Please enter only numbers (0-9) in this field.'
@@ -1,5 +1,6 @@
# currently we need a lotta gems
# require them up front just in case they're not installed
+$:.unshift '19_compat' if RUBY_VERSION >= '1.9'
require 'rubygems'
for gem in ["RedCloth", "fastercsv", "mime/types", "mini_magick", "ezcrypto"] do
View
@@ -13,7 +13,8 @@
limit, vm, runner, name, iterations, report = ARGV
start = Time.now
-cmd = "#{timeout} -t #{limit} #{vm} #{runner} #{name} #{iterations} #{report} > #{null}"
+cmd = "#{timeout} -t #{limit} #{vm} #{runner} #{name} #{iterations} #{report}"
+cmd += " >#{null}" unless ENV['VERBOSE']
system cmd
finish = Time.now

0 comments on commit 05bfbf6

Please sign in to comment.