1
0
Fork 0
psenv/lib/psenv.rb

24 lines
565 B
Ruby
Raw Normal View History

2018-03-28 21:51:39 -04:00
require "psenv/environment"
require "psenv/retriever"
2018-03-22 18:01:53 -04:00
require "psenv/version"
require "aws-sdk-ssm"
module Psenv
module_function
2018-03-28 21:51:39 -04:00
def load(*paths)
paths.unshift(ENV["PARAMETER_STORE_PATH"]) if ENV["PARAMETER_STORE_PATH"]
Environment.new(*paths.map { |path| retrieve_variables(path) }).apply
2018-03-28 21:51:39 -04:00
end
def overload(*paths)
paths.unshift(ENV["PARAMETER_STORE_PATH"]) if ENV["PARAMETER_STORE_PATH"]
Environment.new(*paths.map { |path| retrieve_variables(path) }).apply!
2018-03-28 21:51:39 -04:00
end
2018-03-22 18:01:53 -04:00
2018-03-28 21:51:39 -04:00
def retrieve_variables(path)
Retriever.new(path).call
2018-03-22 18:01:53 -04:00
end
end