Sha256: cb01c19f6bf1b3bb8ff8626862cc1fc99fadc862944d783794a725a4fe50c18f
Contents?: true
Size: 717 Bytes
Versions: 44
Compression:
Stored size: 717 Bytes
Contents
module Volt class Environment def initialize # Use VOLT_ENV or RACK_ENV to set the environment @env = ENV['VOLT_ENV'] || ENV['RACK_ENV'] # If we're in opal, we can set the env from JS before opal loads if RUBY_PLATFORM == 'opal' unless @env `if (window.start_env) {` @env = `window.start_env` `}` end end @env ||= 'development' end def ==(val) @env == val end def production? self.==('production') end def test? self.==('test') end def development? self.==('development') end def inspect @env.inspect end def to_s @env end end end
Version data entries
44 entries across 44 versions & 1 rubygems