jimmycuadra / lita-key-value

A Lita handler for storing snippets of text.
MIT License
5 stars 1 forks source link
chatops key-value lita lita-handler ruby

lita-key-value

Build Status Code Climate Coverage Status

lita-key-value is a handler for Lita that stores snippets of text.

Installation

Add lita-key-value to your Lita instance's Gemfile:

gem "lita-key-value"

Configuration

Optional attributes

Example

Lita.configure do |config|
  config.handlers.key_value.key_pattern = /[\w-]+/
  config.handlers.key_value.key_normalizer = proc { |key| "~#{key}~" }
end

Usage

Set a key:

You: Lita, kv set google http://www.google.com/
Lita: Set google to https://www.google.com/.

Get a key:

You: Lita, kv get google
Lita: https://www.google.com/

Delete a key:

You: Lita, kv delete google
Lita: Deleted google.

List keys:

You: Lita, kv list
Lita: google, heart, something.else

Search for keys:

You: Lita, kv search amaninacan
Lita: amaninacan.amazon.recommendations, hello.amaninacan

By default, keys are restricted to alphanumeric characters, underscores, and periods. Values can contain character.

License

MIT