Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first pass at cleaning up the tumblr migrator #483

Closed
wants to merge 4 commits into from

Conversation

mattrose
Copy link

  1. What is the "at" method? I don't have it:
[mattrose@oscar public_html]$ ruby -rubygems -e 'require "jekyll/migrators/tumblr"; Jekyll::Tumblr.process("http://folkwolf.tumblr.com", true)'
Page: 1 - Posts: 50
/usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:72:in `post_to_hash': undefined method `at' for #<Hash:0x7f56c4d622f8> (NoMethodError)
    from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:27:in `process'
    from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:27:in `map'
    from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:27:in `process'
    from -e:1
  1. I think somewhere along they changed a conversation from a hash with "line" to a straight array
[mattrose@oscar public_html]$ ruby -rubygems -e 'require "jekyll/migrators/tumblr"; Jekyll::Tumblr.process("http://folkwolf.tumblr.com", true)'
Page: 1 - Posts: 50
Page: 2 - Posts: 50
Page: 3 - Posts: 50
/usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:86:in `[]': can't convert String into Integer (TypeError)
    from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:86:in `post_to_hash'
    from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:27:in `process'
    from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:27:in `map'
    from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:27:in `process'
    from -e:1
  1. Put an upper bound on the slug. This prevents this error.
[mattrose@oscar public_html]$ ruby -rubygems -e 'require "jekyll/migrators/tumblr"; Jekyll::Tumblr.process("http://folkwolf.tumblr.com",format = "html",false,false,false)'
Page: 1 - Posts: 50
Page: 2 - Posts: 50
Page: 3 - Posts: 50
Page: 4 - Posts: 50
Page: 5 - Posts: 50
Page: 6 - Posts: 45
/usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:37:in `initialize': File name too long - _posts/tumblr/2012-01-19-five-cyclists-set-out-on-a-morning-ride-from-kanata-ontario-to-pakenham-and-back-three-miles-into-their-ride-luangpakham-drifted-into-the-bicycle-lane-he-hit-one-of-the-cyclists-and-then-another-and-another-and-another-and-another-he-hit-all-five-cyclists-and-continued-driving-luangpakhams-excuse-he-thought-he-had-hit-a-pole.html (Errno::ENAMETOOLONG)
    from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:37:in `open'
    from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:37:in `process'
    from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:32:in `each'
    from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:32:in `process'
    from -e:1

1.  What is the "at" method?  I don't have it:
[mattrose@oscar public_html]$ ruby -rubygems -e 'require "jekyll/migrators/tumblr"; Jekyll::Tumblr.process("http://folkwolf.tumblr.com", true)'
Page: 1 - Posts: 50
/usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:72:in `post_to_hash': undefined method `at' for #<Hash:0x7f56c4d622f8> (NoMethodError)
	from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:27:in `process'
	from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:27:in `map'
	from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:27:in `process'
	from -e:1

2.  I think somewhere along they changed a conversation from a hash with "line" to a straight array
[mattrose@oscar public_html]$ ruby -rubygems -e 'require "jekyll/migrators/tumblr"; Jekyll::Tumblr.process("http://folkwolf.tumblr.com", true)'
Page: 1 - Posts: 50
Page: 2 - Posts: 50
Page: 3 - Posts: 50
/usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:86:in `[]': can't convert String into Integer (TypeError)
	from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:86:in `post_to_hash'
	from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:27:in `process'
	from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:27:in `map'
	from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:27:in `process'
	from -e:1
3.  Put an upper bound on the slug.  This prevents this error.
[mattrose@oscar public_html]$ ruby -rubygems -e 'require "jekyll/migrators/tumblr"; Jekyll::Tumblr.process("http://folkwolf.tumblr.com",format = "html",false,false,false)'
Page: 1 - Posts: 50
Page: 2 - Posts: 50
Page: 3 - Posts: 50
Page: 4 - Posts: 50
Page: 5 - Posts: 50
Page: 6 - Posts: 45
/usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:37:in `initialize': File name too long - _posts/tumblr/2012-01-19-five-cyclists-set-out-on-a-morning-ride-from-kanata-ontario-to-pakenham-and-back-three-miles-into-their-ride-luangpakham-drifted-into-the-bicycle-lane-he-hit-one-of-the-cyclists-and-then-another-and-another-and-another-and-another-he-hit-all-five-cyclists-and-continued-driving-luangpakhams-excuse-he-thought-he-had-hit-a-pole.html (Errno::ENAMETOOLONG)
	from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:37:in `open'
	from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:37:in `process'
	from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:32:in `each'
	from /usr/lib/ruby/gems/1.8/gems/jekyll-0.11.2/lib/jekyll/migrators/tumblr.rb:32:in `process'
	from -e:1
@parkr
Copy link
Member

parkr commented Jan 30, 2013

Added to jekyll/jekyll-import#3

@parkr parkr closed this Jan 30, 2013
@jekyll jekyll locked and limited conversation to collaborators Feb 27, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants