Skip to content

Named property definitions added to PStore

Compare
Choose a tag to compare
@tom-lord tom-lord released this 12 Jul 17:12
· 201 commits to master since this release

Previously, there were 2 main issues with the named properties implementation:

  1. All definitions for what a named property, e.g. /\p{Arabic}/, is defined to match was being stored in RAM (using a ruby hash) at run time. This (slightly) impacted the library load time.
  2. The definitions did not take into account your ruby version. So for example, /\p{Arabic}/.random_example may have returned a NON_MATCHING result for ruby 2.0.x/2.1.x

This patch fixes the above, as well as proving much better test coverage, a slight (~10%) overall performance boost for the Regexp#examples method via lazy evaluation. Also, the test suite has been slightly optimised.

Basically, everything is just a little bit better!

Special thanks to @equivalent for initially proposing this idea, and making the first commits towards my solution :)