Last active
December 8, 2020 16:31
-
-
Save Joseph-N/60fb10beee2e74574c8e to your computer and use it in GitHub Desktop.
Example YML file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require File.expand_path('../boot', __FILE__) | |
require 'rails/all' | |
# configurations | |
# preload tokens in application.yml to local ENV | |
config = YAML.load(File.read(File.expand_path('../application.yml', __FILE__))) | |
config.merge! config.fetch(Rails.env, {}) | |
config.each do |key, value| | |
ENV[key] = value.to_s unless value.kind_of? Hash | |
end | |
module YourAppName | |
class Application < Rails::Application | |
# configurations | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# EXAMPLE application.yml with dummy values | |
SECRET_TOKEN: "d4e5783de1c74c7a4e3a27578df6gdgf6g786g8df7g6g87d6fgb709" | |
FACEBOOK_APP_ID: "35864341" | |
FACEBOOK_APP_SECRET: "759a1e7sd7fvyfsd473" | |
TWITTER_CONSUMER_KEY: "1UrRKJDF8SD7FSDF3S" | |
TWITTER_CONSUMER_SECRET: "5W7TE8KJJk787bnG0s" | |
TWITTER_OAUTH_TOKEN: "716397744-3rHXFkFkjKjkjK78PQ5" | |
TWITTER_OAUTH_TOKEN_SECRET: "DuDJKFSD89SDFD" | |
LINKEDIN_API_KEY: "2vjkJKjk4" | |
LINKEDIN_SECRET_KEY: "5KLSJDFsE" | |
GMAIL_USERNAME: "[email protected]" | |
GMAIL_PASSWORD: "PASSWORD" | |
AWS_ACCESS_KEY_ID: "ASDKLSDJFIA" | |
AWS_SECRET_ACCESS_KEY: "7ASDFJksdfjskdlf87sdfKb" | |
AWS_S3_BUCKET: "bucket" | |
development: | |
MAILER_HOST: "localhost:3000" | |
test: | |
MAILER_HOST: "localhost:3000" | |
production: | |
MAILER_HOST: "domain.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ENV["GMAIL_USERNAME"] # => "[email protected]" | |
ENV["TWITTER_CONSUMER_KEY"] # => "1UrRKJDF8SD7FSDF3S" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment