I am building my first ruby gem for a service which requires the use of an API key from the user,
so I would like to know what should I do to let the user give his own API key to the gem when he installs it?
Thanks 🙂
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Let users of your gem put the API key in
config/yourgem_config.ymlFrom your gem, load this YAML file, and use the
api_keythat is specified.Optionally fall back so some other sort of API access, when the config file can not be found, or provide a error message.
Optionally let the user configure the path to the config file.