input_file=ARGV.firstdefprint_all(f)putsf.readenddefrewind(f)f.seek(0)enddefprint_a_line(line_count,f)puts"#{line_count}, #{f.gets.chomp}"endcurrent_file=open(input_file)puts"First let's print the whole file:\n"print_all(current_file)puts"Now let's rewind, kind of like a tape."rewind(current_file)puts"Let's print three lines:"current_line=1print_a_line(current_line,current_file)current_line+=1print_a_line(current_line,current_file)current_line+=1print_a_line(current_line,current_file)