No commit activity in last 3 years
No release in over 3 years
A Lita extension to allow exclusive route which only trigger if no prior routes triggered
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 3.0.0

Runtime

>= 3.3
 Project Readme

lita-exclusive-route

Build Status Code Climate Coverage Status

lita-exclusive-route is an extension for Lita that allows handler exclusive routes which only trigger when no prior routes already triggered

Installation

Add lita-exclusive-route to your Lita plugin's gemspec:

spec.add_runtime_dependency "lita-exclusive-route"

Usage

To make route exclusive simply add exclusive: true to it

# example from lita-responder
# this route will catch all chat commands but only if there's no other routes catching it before this
route %r{^(.+)$}, :ask_responder, command: true, exclusive: true

Bonus

It's also possible to get array of routes which caught a chat message by accessing message instance variable :

# inside handler route callback method
response.message.instance_variable_get('@routes') # return array of Lita::Handler::Route triggered before current route

License

MIT