Last active
July 20, 2016 16:01
-
-
Save napcs/a0d4197a8c4ef1ba9dbda55aa2086c03 to your computer and use it in GitHub Desktop.
copyedit script - shuffles file contents to help look for errors without being clouded by context.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Shuffles file contents to help you find errors without being blinded by context. | |
# Displays original line number and the line text to help you fix errors. | |
# usage: ce.rb path/to/file | |
file = ARGV[0] | |
File.readlines(file) | |
.collect.with_index {|line, i| {line: i + 1, text: line} } | |
.shuffle.each {|line| puts "#{line[:line]}\t#{line[:text]}" } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment