Sha256: be49cc12391e209d8924a92ce37f983e7f41dde09a085014c3c2e26a15a299cd
Contents?: true
Size: 786 Bytes
Versions: 3
Compression:
Stored size: 786 Bytes
Contents
# frozen_string_literal: true # encoding=utf-8 # utility functions to read environment variables # module Env # :reek:BooleanParameter # :reek:DataClump # :reek:NilCheck # :reek:UtilityFunction def env_bool(name, default: false) return default if name.nil? || (val = ENV[name]).nil? return false if val.empty? || val == '0' true end # skip :reek:DataClump # skip :reek:NilCheck # skip :reek:UtilityFunction def env_int(name, default: 0) return default if name.nil? || (val = ENV[name]).nil? return default if val.empty? val.to_i end # skip :reek:DataClump # skip :reek:NilCheck # skip :reek:UtilityFunction def env_str(name, default: '') return default if name.nil? || (val = ENV[name]).nil? val || default end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
markdown_exec-1.3.1 | lib/env.rb |
markdown_exec-1.3.0 | lib/env.rb |
markdown_exec-1.2.0 | lib/env.rb |