ASCIIwwdc / asciiwwdc.com

Searchable full-text transcripts of WWDC sessions
https://asciiwwdc.com
MIT License
555 stars 43 forks source link

Fix: When `db:seed`ing, `ArgumentError: invalid value for Integer(): "tools"` #28

Closed capnslipp closed 8 years ago

capnslipp commented 8 years ago

Fixed an issue when running rake db:seed (as instructed in the readme setup via foreman run bundle exec rake db:seed) where the data/tools/ directory is interpreted as a year and dies with the following error:

rake aborted!
ArgumentError: invalid value for Integer(): "tools"
/Volumes/UserDrive/2016-04_10.11_Users/capnslipp/Development/Documentation/asciiwwdc.com/Rakefile:20:in `Integer'
/Volumes/UserDrive/2016-04_10.11_Users/capnslipp/Development/Documentation/asciiwwdc.com/Rakefile:20:in `block (3 levels) in <top (required)>'
/Volumes/UserDrive/2016-04_10.11_Users/capnslipp/Development/Documentation/asciiwwdc.com/Rakefile:17:in `each'
/Volumes/UserDrive/2016-04_10.11_Users/capnslipp/Development/Documentation/asciiwwdc.com/Rakefile:17:in `block (2 levels) in <top (required)>'

Fix is to simply skip to the next loop iteration if the directory's name is “tools”.  Not the most universal solution, but the least-invasive— I'd rather any new directory in the future also result in an error over silently ignoring all non-integer dir names. (E.G. What if Apple changed their event timing and a new directory appeared as “2017-jan” or “nyc-2017”?  We'd want that not to be ignored without warning.)

natecook1000 commented 8 years ago

Thanks so much, @capnslipp! 👍