Sha256: 17a26e53991f01e6eb39330050f8738ecc93735271c74e03972e41a9cc2a726e

Contents?: true

Size: 1.04 KB

Versions: 3

Compression:

Stored size: 1.04 KB

Contents

# RedisEval

[![Build Status](https://travis-ci.org/i2bskn/redis_eval.svg)](https://travis-ci.org/i2bskn/redis_eval)
[![codecov](https://codecov.io/gh/i2bskn/redis_eval/branch/master/graph/badge.svg)](https://codecov.io/gh/i2bskn/redis_eval)

Evaluate Lua scripts with Redis.

## Installation

Add this line to your application's Gemfile:

```ruby
gem "redis_eval"
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install redis_eval

## Usage

Build and execute a script source as argument.

```ruby
script = RedisEval::Script.new("return {KEYS[1], ARGV[1]}")
script.execute([1], [2]) # => ["1", "2"]
```

Find and build scripts from a specific directory.

```ruby
scripts = RedisEval::ScriptSet.new("/path/to/script_dir")
scripts.hello.execute(keys, argv) # build /path/to/script_dir/hello.lua and run.
```
## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/i2bskn/redis_eval.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
redis_eval-0.2.2 README.md
redis_eval-0.2.1 README.md
redis_eval-0.2.0 README.md