Created
July 31, 2012 22:26
-
-
Save redsquirrel/3221208 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| array.each_with_index do |line, index| | |
| if line.match(/^<s>/i) | |
| start = index | |
| splits = line.scan(/<(?:s|c)>\s*/i).map(&:size) | |
| end | |
| # detect a line that's all dashes and spaces | |
| if line.match(/^[\- ]+$/) | |
| start = index | |
| # scan for dashes followed by a space | |
| splits = line.scan(/\-+ /).map(&:size) | |
| end | |
| if line.match(/^<\/table>/i) | |
| stop = index | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment