Project

redis_env

0.0
No commit activity in last 3 years
No release in over 3 years
Store environment variables in redis
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
>= 0
>= 0
 Project Readme

Redis Env

Store your environment variables in Redis.

Installation

$ gem install redis_env

Usage

Commands:
  redis-env clear           # Remove all environment variables
  redis-env exec COMMAND    # Run a COMMAND within the environment
  redis-env list            # List all variables
  redis-env load FILE       # Read an env file and load it into redis
  redis-env set NAME VALUE  # Set an environment variable called NAME to VALUE
  redis-env unset NAME      # Remove an environment variable called NAME

Options:
  [--project=PROJECT]  # The project these variables are for
  [--redis=REDIS]      # The url of the redis server
                       # Default: redis://localhost:6379/0

Examples

Load your existing .env file

redis-env load --project my-awesome-app .env

Now run your app using redis-env

redis-env exec --project my-awesome-app rails s

Programmatic Usage

require "redis_env"
client = RedisEnv.new(Redis.new, "my-awesome-app")

# Write keys
client.set("IMPORTANT_KEY", "VALUE")
client.bulk_set("IMPORTANT_KEY" => "NEW VALUE", "ANOTHER_KEY" => "banana")

# Use keys
SomeRestClient.new(url: client.variables["RELEVENT_URL"])

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/sionide21/redis-env.