* Refactor:Remove ENVied Gem in Favor of Default application.yml * Copy sample_application.yml for Travis * Create .env_sample file, Warn of missing ENV variables, ignore .env file * Use dotenv For ENV variables and create Rake Task to Populate * Update docs to copy .env_sample file * make application config a bit more resilient * update more documentation and only initialize dotenv in dev and test * Update doc code snippet types and refactor rake task and app config * remove push defaults * Make initializers more resilient, remove unused ENV from travis * Exit new rake task if application.yml does not exist, include dotenv in docs
18 lines
808 B
Ruby
18 lines
808 B
Ruby
Rails.application.reloader.to_prepare do
|
|
AWS_LAMBDA = if Rails.env.production? && ApplicationConfig["AWS_SDK_KEY"].present?
|
|
Aws::Lambda::Client.new(
|
|
region: ApplicationConfig["AWS_DEFAULT_REGION"],
|
|
access_key_id: ApplicationConfig["AWS_SDK_KEY"],
|
|
secret_access_key: ApplicationConfig["AWS_SDK_SECRET"],
|
|
)
|
|
else
|
|
# Fake Aws::Lambda::Client
|
|
Class.new do
|
|
def invoke(*)
|
|
# rubocop:disable Performance/OpenStruct
|
|
OpenStruct.new(payload: [{ body: { message: 0 }.to_json }.to_json])
|
|
# rubocop:enable Performance/OpenStruct
|
|
end
|
|
end.new
|
|
end
|
|
end
|