Sha256: 74e5562ecb8065f6bcb2f969f4db88bdd006903e0b9bb833b3d1ffab93f884ae
Contents?: true
Size: 947 Bytes
Versions: 2
Compression:
Stored size: 947 Bytes
Contents
require "voltos/version" require "curb" require "json" module Voltos class << self attr_accessor :configuration end def self.configure self.configuration ||= Configuration.new yield(configuration) end def self.foobar puts "API key is: #{Voltos.configuration.api_key}" end def self.load env_str = Curl.get("https://voltos.online/v1/credentials") do |http| http.headers["Authorization"] = "Token token=#{Voltos.configuration.api_key}" end Voltos.configuration.envs = JSON.parse(env_str.body_str) end def self.keys Voltos.configuration.envs.keys end def self.key(bundle, env_key) if not bundle == "" Voltos.configuration.envs["bundles"][bundle][env_key] else Voltos.configuration.envs["unbundled"][env_key] end end class Configuration attr_accessor :api_key attr_accessor :envs def initialize @api_key = "" end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
voltos-0.0.8 | lib/voltos.rb |
voltos-0.0.7 | lib/voltos.rb |