Skip to content

Instantly share code, notes, and snippets.

@coryodaniel
Created July 15, 2016 18:29
Show Gist options
  • Select an option

  • Save coryodaniel/377e68f1aeeae5c61bd1d94962da1610 to your computer and use it in GitHub Desktop.

Select an option

Save coryodaniel/377e68f1aeeae5c61bd1d94962da1610 to your computer and use it in GitHub Desktop.
Find env variables
env = Dir['myproject/**/*.rb'].
map { |file| File.read(file).match(/ENV\[['"](.+?)(?=[\]'"])/) }.
compact.
map{|matchdata| matchdata[1]}.uniq.sort
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment