relevance / edn-ruby

Ruby implementation of Extensible Data Notation as defined by Rich Hickey
MIT License
119 stars 31 forks source link

Error writing string output #36

Closed edporras closed 9 years ago

edporras commented 9 years ago

Hi Russ,

We've been running into some hangs while writing EDN output with long strings. Reading it is no problem but trying to save it as an EDN file never completes.

Here's a file containing one of these strings:

https://dl.dropboxusercontent.com/u/540179/edn-ruby/long_string.edn

Trying to write it will just hang:

  File.open('./long_string.edn') { |file| data = EDN.read(file) }
  pp data
  File.open('output.edn', 'w') { |file| file.write(data.to_edn) }
russolsen commented 9 years ago

Ed,

Sorry you are having troubles. I think it is not exactly hanging as it is taking a very long time.

I've just pushed a branch with a fix: faster-string-to-edn. It passes all the tests, but I want to think it through in the daylight before I merge and release.

Again, sorry for the pain.

R

russolsen commented 9 years ago

ED,

I'd like to add a test for this problem - is it ok if I check in your data?

R

edporras commented 9 years ago

hey Russ,

Thanks for getting to this so quickly. I checked and it's no problem. Let me know if you push a new version as we could really use it. :)

russolsen commented 9 years ago

I'm on it.

russolsen commented 9 years ago

Fixed in version 1.0.8.