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

For MT: :entry_text_more attribute is nil or not before evaluate #45

Merged
merged 1 commit into from
Aug 9, 2013

Conversation

shigeya
Copy link
Contributor

@shigeya shigeya commented Aug 8, 2013

This happen when I tried my MovableType blog import (still on going)

@parkr
Copy link
Member

parkr commented Aug 8, 2013

Oh great, thanks!

LGTM. @mattr-?

@mattr-
Copy link
Member

mattr- commented Aug 8, 2013

for a quick fix, this is fine. If you wanted to take this a step further, you could wrap the conditional in a method to improve the clarity of the code.

def extra_entry_text_empty?(post)
  post[:entry_text_more].nil? || post[:entry_text_more].strip.empty?
end

and replace the condition like so:

if extra_entry_text_empty?(post)
...
end

@shigeya
Copy link
Contributor Author

shigeya commented Aug 8, 2013

I like that modification better, but only if you want to cost lines+methods for clarity. (besides the commit message's clarity). will change and push again later.

@shigeya
Copy link
Contributor Author

shigeya commented Aug 8, 2013

Updated.

@mattr-
Copy link
Member

mattr- commented Aug 8, 2013

I will always take clearer code over code that is less lines. Thanks for updating this! 😃

@shigeya
Copy link
Contributor Author

shigeya commented Aug 8, 2013

no problem. Looks like travis said OK.

@parkr
Copy link
Member

parkr commented Aug 8, 2013

Boom! LGTM.

mattr- added a commit that referenced this pull request Aug 9, 2013
For MT: :entry_text_more attribute is nil or not before evaluate
@mattr- mattr- merged commit bb02ec7 into jekyll:master Aug 9, 2013
mattr- added a commit that referenced this pull request Aug 9, 2013
@shigeya shigeya deleted the mt-entry_text_more-null-check branch August 9, 2013 07:14
@shigeya
Copy link
Contributor Author

shigeya commented Aug 9, 2013

tnx

@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.

5 participants