208: def targets
209: on("-t", "--target", "TARGET",
210: "Implementation to run the specs, where TARGET is:") do |t|
211: case t
212: when 'r', 'ruby'
213: config[:target] = 'ruby'
214: when 'r19', 'ruby19'
215: config[:target] = 'ruby1.9'
216: when 'x', 'rubinius'
217: config[:target] = './bin/rbx'
218: when 'X', 'rbx'
219: config[:target] = 'rbx'
220: when 'j', 'jruby'
221: config[:target] = 'jruby'
222: when 'i','ironruby'
223: config[:target] = 'ir'
224: when 'm','maglev'
225: config[:target] = 'maglev-ruby'
226: else
227: config[:target] = t
228: end
229: end
230:
231: doc ""
232: doc " r or ruby invokes ruby in PATH"
233: doc " r19, ruby19 or ruby1.9 invokes ruby1.9 in PATH"
234: doc " x or rubinius invokes ./bin/rbx"
235: doc " X or rbx invokes rbx in PATH"
236: doc " j or jruby invokes jruby in PATH"
237: doc " i or ironruby invokes ir in PATH"
238: doc " m or maglev invokes maglev-ruby in PATH"
239: doc " full path to EXE invokes EXE directly\n"
240:
241: on("-T", "--target-opt", "OPT",
242: "Pass OPT as a flag to the target implementation") do |t|
243: config[:flags] << t
244: end
245: on("-I", "--include", "DIR",
246: "Pass DIR through as the -I option to the target") do |d|
247: config[:includes] << "-I#{d}"
248: end
249: on("-r", "--require", "LIBRARY",
250: "Pass LIBRARY through as the -r option to the target") do |f|
251: config[:requires] << "-r#{f}"
252: end
253: end