cowboyd / handlebars.rb

Ruby Bindings for Handlebars.js
http://www.handlebarsjs.com
161 stars 67 forks source link

Make Handlebars::Context.current thread safe #46

Closed mpeychich closed 2 years ago

mpeychich commented 7 years ago

Handlebars::Template#call was mutating global state. When called in multiple threads you ran the risk of overwriting the current context for other threads while the @fn.call was executing. By moving to a thread variable we ensure that this value remains with the thread which is setting the value.

Also in this PR are some dependency updates including requiring a modern ruby. All three ruby versions previously tested are no longer maintained.

Should address #39

mpeychich commented 7 years ago

@cowboyd Any thoughts on this? I'd love to get this merged in. I am not familiar with the versioning change needed here since it does bump the required ruby version, but it does so by requiring the minimum maintained version (lower than that even) where there was no minimum previously.