jipiboily / tumblr-to-hugo

Shitty but working Ruby tool to move your posts from Tumblr to Hugo
13 stars 3 forks source link

tidy_bytes': undefined method `empty?' #1

Open willwade opened 7 years ago

willwade commented 7 years ago

Not sure what this is - Im guessing an empty string somewhere?

on running:

ruby t2h.rb API+KEY willwade.tumblr.com

I get...

We're done! Writing 2012-12-05-how-to-get-a-exchange-2003-public-shared-calendar-on-an-iphone-using-outlook-2007-and-maybe-dropbox.html Writing 2012-05-15-keyboard-sounder.html Writing 2012-03-20-extract-images-sounds-from-clicker-files.html /Users/willwade/.rvm/gems/ruby-2.3.2/gems/activesupport-5.0.0.1/lib/active_support/multibyte/unicode.rb:246:intidy_bytes': undefined method empty?' for nil:NilClass (NoMethodError) from /Users/willwade/.rvm/gems/ruby-2.3.2/gems/activesupport-5.0.0.1/lib/active_support/inflector/transliterate.rb:62:intransliterate' from /Users/willwade/.rvm/gems/ruby-2.3.2/gems/activesupport-5.0.0.1/lib/active_support/inflector/transliterate.rb:88:in parameterize' from /Users/willwade/Downloads/tumblr-to-hugo-master/hugo.rb:14:inwrite_post' from t2h.rb:23:in block (2 levels) in <main>' from t2h.rb:22:ineach' from t2h.rb:22:in block in <main>' from /Users/willwade/.rvm/rubies/ruby-2.3.2/lib/ruby/2.3.0/csv.rb:1282:inopen' from t2h.rb:20:in <main>'

jipiboily commented 7 years ago

The problem seems to be on that line: https://github.com/jipiboily/tumblr-to-hugo/blob/master/hugo.rb#L14

Do you have a post with no title? Would it be possible? Hard to test without your API key I guess. 😕

willwade commented 7 years ago

Yep. Pretty sure it's a post without title.

willwade commented 7 years ago

Ps thanks for looking!

jipiboily commented 7 years ago

What should happen in this case? Skip it? Without the title the filename will be empty, so does the URL.

You could change the code to skip empty titles maybe?

JP Boily Founder @ Metrics Watch http://metricswatch.com

On Feb 22, 2017, 2:45 PM -0500, will wade notifications@github.com, wrote:

Ps thanks for looking!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub (https://github.com/jipiboily/tumblr-to-hugo/issues/1#issuecomment-281780844), or mute the thread (https://github.com/notifications/unsubscribe-auth/AAOOIRPzthTLUxHTve1UTwWBEv3fmlcrks5rfJA8gaJpZM4MFmCw).