pygments / pygments.rb

💎 Ruby wrapper for Pygments syntax highlighter
MIT License
572 stars 141 forks source link

add timeout configuration option #123

Closed ptoomey3 closed 3 years ago

ptoomey3 commented 10 years ago

This PR adds a :timeout option that can be passed to Pygments.highlight. I also added a bit of a hacky unit test for the new functionality. The other unit test for testing timeouts is similarly presumptive (about how long/short a given machine is likely to take to highlight a block of code), but let me know if you would prefer another approach.

/cc @tnm

tnm commented 4 years ago

@gfx This is a pretty good idea that we should've merged back when. No need for the env var.

ivanistheone commented 4 years ago

The :timeout param was copied to the Py3 support here https://github.com/tmm1/pygments.rb/pull/194