seven1m/bible_ref — pull request #2 by adamtootle (2014-11-08 00:57:50+00:00)
Title: Tweaking some regex patterns in BibleRef::Book::BOOKS

I tweaked them so that now each one matches their respective key in BibleRef::Book::BOOKS, as well as any original matches.

Here's an example of the code that prompted me to make the changes:

```
ref = BibleRef::Reference.new('Dut 1:1-2')
puts BibleRef::Book.new(ref.ranges.first.first[:book]).id
```

Currently the id of the new book is nil. This is because 'DEU' (the key for Deuteronomy in BibleRef::Book::BOOKS) doesn't match `/^de?ut/`, so I've updated that one to `/^d(e?ut|eu)/`.

I pass a couple of references around in a rails app the do some file lookups on the disk based on how things are structured in this gem. So I'm not doing it exactly like the example, but that's a reliable way to reproduce what I'm seeing.

Here's a quick way I used to check for matches:
```
BibleRef::Book::BOOKS.keys.each do |key|
puts "not matched - #{key}" unless key.downcase =~ BOOKS[key]
end
```