Sha256: 4496a10b710cbd43cecc5b272c60088b5b319665a4cd855d1f0c72fc09ffe3db
Contents?: true
Size: 929 Bytes
Versions: 20
Compression:
Stored size: 929 Bytes
Contents
# frozen_string_literal: true module Racecar module RailsConfigFileLoader def self.load! config_file = "config/racecar.yml" begin require "rails" rescue LoadError # Not a Rails application. end if defined?(Rails) $stderr.puts "=> Detected Rails, booting application..." require "./config/environment" if (Rails.root + config_file).readable? Racecar.config.load_file(config_file, Rails.env) end # In development, write Rails logs to STDOUT. This mirrors what e.g. # Unicorn does. if Rails.env.development? && defined?(ActiveSupport::Logger) console = ActiveSupport::Logger.new($stdout) console.formatter = Rails.logger.formatter console.level = Rails.logger.level Rails.logger.extend(ActiveSupport::Logger.broadcast(console)) end end end end end
Version data entries
20 entries across 20 versions & 1 rubygems