lumoslabs / txgh

A library for automatically syncing translation resources between Github and Transifex.
1 stars 1 forks source link

Introduce config providers #11

Closed camertron closed 8 years ago

camertron commented 8 years ago

Right now there are two bits of configuration that get loaded at different points in the Txgh cycle. The first is provided as a set of environment variables on boot, and contains things like API and login credentials, webhook secrets, and a map of connections between Github repositories and Transifex projects. The second is called the tx config, and contains a list of files we'd like to translate (eg. en.yml). The tx config can be loaded from three places - a string, a file, or a git repository. In order to support configuration for multiple projects, I'd like to be able to move the base config from environment variables to YAML, and load it as a string or file just like the tx config.

This PR introduces the concept of config providers, one for each of the different ways of loading config (string, file, git). In addition, the responsibility of loading tx config has been moved from Config::KeyManager into a separate class called Config::TxManager.

11mdlow commented 8 years ago

:+1: