Skip to content

Instantly share code, notes, and snippets.

@chrisberkhout
Created June 21, 2013 05:33
Show Gist options
  • Save chrisberkhout/5829090 to your computer and use it in GitHub Desktop.
Save chrisberkhout/5829090 to your computer and use it in GitHub Desktop.
Load credentials set by shell script into current Ruby environment - in one line
require "json"
JSON.parse(`. /etc/credentials.sh; ruby -rjson -e'puts ENV.to_hash.to_json'`).each_pair { |k,v| ENV[k] = v }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment