<commit_before># Wolverine

Wolverine is a simple library to allow you to manage and run redis server-side lua scripts from a rails app, or other ruby code.

## What are you talking about?

Redis versions 2.6 and up allow lua scripts to be run on the server that execute atomically and very, very quickly.

This is really, really cool.

Wolverine is a wrapper around that functionality, to package it up in a format more familiar to a Rails codebase.

## How do I use it?

1) Make sure you have redis 2.6 or higher installed. As of now, that means compiling from source.

```shell
git clone https://github.com/antirez/redis.git
cd redis && make
./src/redis-server
```

2) Add wolverine to your gemfile

```ruby
gem 'wolverine'
```

3) Add your lua scripts to `app/redis`

```lua
-- app/redis/util/mexists.lua
local exists = {}
local existence
for _, key in ipairs(KEYS) do
  table.insert(exists, redis.call('exists', key))
end
return exists
```

4) Call from your code:
<commit_msg>minor README tweak<commit_after># Wolverine

Wolverine is a simple library to allow you to manage and run redis server-side lua scripts from a rails app, or other ruby code.

## What are you talking about?

Redis versions 2.6 and up allow lua scripts to be run on the server that execute atomically and very, very quickly.

This is really, really cool.

Wolverine is a wrapper around that functionality, to package it up in a format more familiar to a Rails codebase.

## How do I use it?

1) Make sure you have redis 2.6 or higher installed. As of now, that means compiling from source:

```shell
git clone https://github.com/antirez/redis.git
cd redis && make
./src/redis-server
```

2) Add wolverine to your Gemfile:

```ruby
gem 'wolverine'
```

3) Add your lua scripts to `app/redis`:

```lua
-- app/redis/util/mexists.lua
local exists = {}
local existence
for _, key in ipairs(KEYS) do
  table.insert(exists, redis.call('exists', key))
end
return exists
```

4) Call wolverine from your code:

{'fraction_non_alphanumeric': 0.08884401817264008, 'fraction_numerical': 0.008076728924785462, 'mean_word_length': 3.942643391521197, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '845274', 'n_tokens_mistral': 649, 'n_tokens_neox': 611, 'n_words': 295}