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

Does not close stdout when running DlmeJsonResourceWriter. Closes #54. #55

Merged
merged 1 commit into from Feb 20, 2019

Conversation

justinlittman
Copy link
Contributor

No description provided.

@@ -21,6 +21,10 @@ def serialize(context)
"#{JSON.pretty_generate(adjusted)}"
end

def close
@output_file.close unless (@output_file.nil? || @output_file.tty? || @output_file == $stdout)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain why we need to check for tty?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or nil for that matter?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you refactor to

def close
  return if  @output_file == $stdout
  super
end

@justinlittman justinlittman force-pushed the justinlittman-patch-1 branch 2 times, most recently from 0cfb665 to 4233789 Compare February 20, 2019 18:16
@justinlittman
Copy link
Contributor Author

Upstream PR: traject/traject#202

Copy link
Contributor

@jcoyne jcoyne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a comment referencing that this customization is needed until traject/traject#202 is resolved?

@justinlittman justinlittman merged commit 9f37508 into master Feb 20, 2019
@justinlittman justinlittman deleted the justinlittman-patch-1 branch February 20, 2019 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants