<commit_before># `crayon`

This is the lua client for the crayon package.


## Install

* From luarocks:
```bash
$ luarocks install crayon
```

* From source:
```bash
$ luarocks make
```

### Dependencies

* `openssl`


#### OpenSSL troubleshooting

On some distributions installing `luasec` (which lua-requests depends on) will
fail with some form of this error:

```
Error: Failed installing dependency: https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/lua-requests-1.1-1.src.rock \
- Failed installing dependency: https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/luasec-0.6-1.rockspec - Could not find library file for OPENSSL
  No file libssl.a in /usr/lib
  No file libssl.so in /usr/lib
  No file matching libssl.so.* in /usr/lib
```

To fix this (assuming openssl is already installed):

```bash
$ locate libssl.so
[...]
/usr/lib/x86_64-linux-gnu/libssl.so
$ ln -s /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/libssl.so<commit_msg>Add OSX fixes when attempting to install luasec / crayon<commit_after># `crayon`

This is the lua client for the crayon package.


## Install

* From luarocks:
```bash
$ luarocks install crayon
```

* From source:
```bash
$ luarocks make
```

### Dependencies

* `openssl`


#### OpenSSL troubleshooting

On some distributions / OSs installing `luasec` (which lua-requests depends on) will
fail with some form of this error:

```
Error: Failed installing dependency: https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/lua-requests-1.1-1.src.rock \
- Failed installing dependency: https://raw.githubusercontent.com/rocks-moonscript-org/moonrocks-mirror/master/luasec-0.6-1.rockspec - Could not find library file for OPENSSL
  No file libssl.a in /usr/lib
  No file libssl.so in /usr/lib
  No file matching libssl.so.* in /usr/lib
```

##### Linux fix

To fix this (assuming openssl is already installed):

```bash
$ locate libssl.so
[...]
/usr/lib/x86_64-linux-gnu/libssl.so
$ ln -s /usr/lib/x86_64-linux-gnu/libssl.so /usr/lib/libssl.so
```

##### Mac OS / OS X fix

Assuming you have Homebrew installed:

```bash
$ brew install openssl
$ brew list openssl
[...]
/usr/local/<YOUR_PATH_TO_OPEN_SSL>/openssl/<YOUR_VERSION>/lib
/usr/local/<YOUR_PATH_TO_OPEN_SSL>/openssl/<YOUR_VERSION>/bin
$ luarocks install luasec OPENSSL_DIR=/usr/local/$YOUR_PATH_TO_OPEN_SSL/openssl/<YOUR_VERSION>
$ luarocks install crayon
{'fraction_non_alphanumeric': 0.13316892725030827, 'fraction_numerical': 0.011508425811755036, 'mean_word_length': 4.156779661016949, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3176896', 'n_tokens_mistral': 939, 'n_tokens_neox': 861, 'n_words': 220}