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

clean_batch_for_jruby returns nil unless batch contains a linefeed ("\n") #96

Open
breckenedge opened this issue Aug 17, 2018 · 0 comments

Comments

@breckenedge
Copy link

The clean_batch_for_jruby method is called during parse_batch. However, unless the message contains a linefeed (0xA), nil is returned, which causes an HL7::ParseError to be raised.

Current method definition:

def clean_batch_for_jruby(batch)
  batch.gsub("\n", "\r") if batch.include?("\n") # <= returns nil unless batch.include?("\n")
end

This probably should be:

def clean_batch_for_jruby(batch)
  batch.include?("\n") ? batch.gsub("\n", "\r") : batch
end

All of the examples in"lib/test/hl7_messages.rb" terminate with a linefeed because they're using ruby HEREDOCs.

@breckenedge breckenedge changed the title clean_batch_for_jruby returns nil unless message contains a linefeed ("\n") clean_batch_for_jruby returns nil unless batch contains a linefeed ("\n") Aug 17, 2018
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

No branches or pull requests

1 participant