mardi 26 mai 2015

How to set ruby variables in ruby script to shell environment variables

I want to write a ruby script using fog (a wrapper for aws-sdk). Of course I could hard code my aws secret key and ID but would like to be able to have it set dynamically to my shell env variable since I manage multiple accounts.

require 'fog'
require 'json'
require 'logger'

aws_key_id = $aws_key_id
aws_secret_key = $aws_secret_key
queue_url = $sqs_queue_url

Would this work?




Aucun commentaire:

Enregistrer un commentaire