From: Max Williams Date: 2007-09-12T23:54:33+09:00 Subject: Re: copy/paste line numbers with code Hu Yoi wrote: > Max Williams wrote: >> I'm writing up my project report and want to include line numbers with >> the code that i paste into my word doc writeup. Does anyone know of a >> ruby editor for windows that will allow this? I use SciTE and Eclipse >> already but can't see how to do it using those, so if someone knows a >> way for those that would be ideal. >> >> thanks >> max > > I have used a bit of Ruby code to do this: > > code = File.open("Song.rb") > code.each { > |line| puts "#{code.lineno}. #{line}" > } > code.close > > present your .rb file to replace "Song.rb" and copy code with line > number from your Console or SciTE thanks...i thought about doing something like this but it's a last desperate option - if i make any changes i need to run this again on the file for example. There must be a text editor out there that does this? (and knows how to colour ruby) Anyone know? don't meant to sound ungrateful though, thanks! :) -- Posted via http://www.ruby-forum.com/.