0.0
No commit activity in last 3 years
No release in over 3 years
using the pstore library, this gem allows the ability to store and retrieve settings set on an environment
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.13
~> 10.0
~> 3.0
 Project Readme

SettingStore

SettingStore is a simple wrapper around PStore that allows you to set persistent data using a key value store

Installation

Add this line to your application's Gemfile:

gem 'setting_store'

And then execute:

$ bundle

Or install it yourself as:

$ gem install setting_store

Usage

To set a new key value pair

SettingStore.set(:feature, value: 'Hello World')

To retrieve a set key value

SettingStore.get(:feature)
=> 'Hello World'

To check if value of a specific key value is truthy

SettingStore.set(:simple_key, value: 'Random String')
SettingStore.active?(:simple_key)
=> false

# must be explicitly set to true for .active? to return true
SettingStore.set(:simple_key, value: true)
SettingStore.active?(:simple_key)
=> true

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Owenhorner/setting_store.

License

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