README.md in wolverine-0.0.2 vs README.md in wolverine-0.0.3
- old
+ new
@@ -10,32 +10,49 @@
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.
+1) Make sure you have redis 2.6 or higher installed. As of now, that means compiling from source:
- git clone https://github.com/antirez/redis.git
- cd redis && make
- ./src/redis-server
+```shell
+git clone https://github.com/antirez/redis.git
+cd redis && make
+./src/redis-server
+```
-2) Add wolverine to your gemfile
+2) Add wolverine to your Gemfile:
- gem 'wolverine'
+```ruby
+gem 'wolverine'
+```
-3) Add your lua scripts to `app/redis`
+3) Add your lua scripts to `app/redis`:
- -- 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
+```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:
+4) Call wolverine from your code:
- Wolverine.call('util/mexists', 'key1', 'key2', 'key3') #=> [0, 1, 0]
+```ruby
+Wolverine.call('util/mexists', 'key1', 'key2', 'key3') #=> [0, 1, 0]
+```
+
+## Configuration
+
+Available configuration options:
+
+* `Wolverine.config.redis` (default `Redis.new`)
+* `Wolverine.config.script_path` (default `Rails.root + 'app/wolverine'`)
+
+If you want to override one or both of these, doing so in an initializer is recommended but not required.
## More information
For more information on scripting redis with lua, refer to redis' excellent documentation: http://redis.io/commands/eval