0.0
No commit activity in last 3 years
No release in over 3 years
Store Ruboty's memory via Moneta
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0
>= 0

Runtime

~> 0.8.0
>= 0
 Project Readme

Ruboty::Moneta

Store Ruboty's memory in backend via moneta.

Installation

Add this line to your application's Gemfile:

gem 'ruboty-moneta'

Usage

setting moneta backend

please setting backend_type to MONETA_BACKEND

 MONETA_BACKEND="{backend_type}"

setting initialize options

please setting options

MONETA_#{バックエンドの形式}_{initialize時のoptionパラメータに渡したいキー名}で 指定してください。

Sqlite3のfileパラメータを指定したいときは下記のようになります。

 # MONETA_#{Backend}_#{Options Hash}
 MONETA_SQLITE_FILE = "{file path}"

Setting replicate

複数のbackendに同時に書き込みます。 MONETA_BACKENDで設定されたbackendのデータをmasterとして扱います。 ストアの移行作業時などに使ってください

MONETA_BACKEND_SLAVE={"backend" or ["backend1", "backend2"]}

# example

# Replicate in YAML
MONETA_BACKEND_SLAVE="YAML"
MONETA_YAML_FILE="./ruboty.yml"

# Replicate in YAML and File
MONETA_BACKEND_SLAVE=["YAML", "File"]
MONETA_FILE_DIR="./db"
MONETA_YAML_FILE="./ruboty.yml"

example

use memory

gem 'ruboty-moneta'

use File

gem 'ruboty-moneta'
MONETA_BACKEND="File"
MONETA_FILE_DIR="./db"

use Sqlite

gem 'ruboty-moneta'
gem 'sqlite3'
MONETA_BACKEND="Sqlite"
MONETA_SQLITE_FILE="./ruboty.db"

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/rike422/ruboty-moneta. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.