Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class FileParser
- def find_line(file_name, line_number)
- current_file = open(filename)
- array_of_lines = []
- while current_line = current_file.gets
- array_of_lines << current_line
- end
- array_of_lines[line_number]
- ensure
- current_file.close if current_file
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement