lib/wd_sinatra/app_loader.rb
def load_environment(env=RACK_ENV)
      # Load the default which can be overwritten or extended by specific
      # env config files.
      require File.join(root_path, 'config', 'environments', 'default.rb')
      env_file = File.join(root_path, "config", "environments", "#{env}.rb")
      if File.exist?(env_file)
        require env_file
      else
        debug_msg = "Environment file: #{env_file} couldn't be found, using only the default environment config instead." unless env == 'development'
      end
      # making sure we have a LOGGER constant defined.
      unless Object.const_defined?(:LOGGER)
        Object.const_set(:LOGGER, Logger.new($stdout))
      end
      LOGGER.debug(debug_msg) if debug_msg
    end
def load_environment(env=RACK_ENV)
      # Load the default which can be overwritten or extended by specific
      # env config files.
      require File.join(root_path, 'config', 'environments', 'default.rb')
      env_file = File.join(root_path, "config", "environments", "#{env}.rb")
      if File.exist?(env_file)
        require env_file
      else
        debug_msg = "Environment file: #{env_file} couldn't be found, using only the default environment config instead." unless env == 'development'
      end
      # making sure we have a LOGGER constant defined.
      unless Object.const_defined?(:LOGGER)
        Object.const_set(:LOGGER, Logger.new($stdout))
      end
      LOGGER.debug(debug_msg) if debug_msg
    end
def load_environment ( env = RACK_ENV ) # Load the default which can be overwritten or extended by specific # env config files. require File . join ( root_path , 'config' , 'environments' , 'default.rb' ) env_file = File . join ( root_path , "config" , "environments" , "#{env}.rb" ) if File . exist? ( env_file ) require env_file else debug_msg = "Environment file: #{env_file} couldn't be found, using only the default environment config instead." unless env == 'development' end # making sure we have a LOGGER constant defined. unless Object . const_defined? ( :LOGGER ) Object . const_set ( :LOGGER , Logger . new ( $stdout ) ) end LOGGER . debug ( debug_msg ) if debug_msg end
Loads an environment specific config if available, the config file is where the logger should be set
 if it was not, we are using stdout.
Loads an environment specific config if available the config file is where the logger should be set if it was not we are using stdout .