Sha256: f4b418e314c86a2a2cb8f4b53f05bf7298ff3ba1162abf3d931a19f0de0147b0
Contents?: true
Size: 1009 Bytes
Versions: 2
Compression:
Stored size: 1009 Bytes
Contents
# encoding: utf-8 # Copyright (C) 2015 Szymon Kopciewski # # This file is part of SinatraEnvToConfig # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. require 'sinatra/base' module Sinatra module EnvToConfig def env_to_config(*args) args.each { |key| set key, find_value_for_key(key) } end private def find_value_for_key(key) key_string = key.to_s ENV[key_string] end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
sinatra-env_to_config-1.0.1 | lib/sinatra/env_to_config.rb |
sinatra-env_to_config-1.0.0 | lib/sinatra/env_to_config.rb |