Skip to content
This repository has been archived by the owner on Jan 25, 2025. It is now read-only.

tatsuio/juvet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

juvet

DESCRIPTION

A factory and storage mechanism to store your bot information, backed by Redis.

A word about the future

The initial intent of this gem is to just store information about the bots you are running. This will in the near future be able to start, stop, and pause bots by turning on/off their senses. In addition by integrating message queuing (right now just by using Redis) will be able to send messages to/from the bots within the factory. This will allow things such as adding health checks, broadcasting messages to all bots, etc.

USAGE

In order to configure Juvet, you will want to specify the repository it will be using. An initializer of some sort would be ideal to place this code in.

Juvet.configure do
  adapter :redis, url: ENV["REDIS_URL"]
  mapping do
    collection :bots do
      repository Juvet::BotRepository, adapter: :redis
      entity Juvet::Bot
    end
  end
end
  • Creating a bot
Juvet::Bot.create! bot_access_token, team_id: "T12345", status: :active
  • Updating a bot
bot = Juvet::Bot.find bot_access_token
bot.status = :inactive
bot.update!
  • Destroying a bot
Juvet::Bot.destroy! bot_access_token

CONTRIBUTING

  1. Clone the repository git clone https://github.com/tatsuio/juvet
  2. Create a feature branch git checkout -b my-awesome-feature
  3. Codez!
  4. Commit your changes (small commits please)
  5. Push your new branch git push origin my-awesome-feature
  6. Create a pull request hub pull-request -b tatsuio:master -h tatsuio:my-awesome-feature

RELEASING A NEW GEM

  1. Bump the VERSION in lib/juvet/version.rb
  2. run bundle exec rake build
  3. Commit changes and push to GitHub
  4. run bundle exec rake release

LICENSE

Copyright (c) 2016, Tatsu, LLC.

This project is licensed under the MIT License.

About

The factory for bots

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages