Browse Source

Remove superseded rails_12factor gem

Dominik Sander 8 years ago
parent
commit
ad33e280eb
3 changed files with 10 additions and 10 deletions
  1. 0 4
      Gemfile
  2. 0 6
      Gemfile.lock
  3. 10 0
      config/environments/production.rb

+ 0 - 4
Gemfile

@@ -183,10 +183,6 @@ ENV['DATABASE_ADAPTER'] ||=
     'mysql2'
   end
 
-if_true(on_heroku) do
-  gem 'rails_12factor', group: :production
-end
-
 if_true(ENV['DATABASE_ADAPTER'].strip == 'postgresql') do
   gem 'pg', '~> 0.18.3'
 end

+ 0 - 6
Gemfile.lock

@@ -418,11 +418,6 @@ GEM
       nokogiri (~> 1.6.0)
     rails-html-sanitizer (1.0.3)
       loofah (~> 2.0)
-    rails_12factor (0.0.3)
-      rails_serve_static_assets
-      rails_stdout_logging
-    rails_serve_static_assets (0.0.4)
-    rails_stdout_logging (0.0.3)
     railties (5.0.0.1)
       actionpack (= 5.0.0.1)
       activesupport (= 5.0.0.1)
@@ -663,7 +658,6 @@ DEPENDENCIES
   rack-livereload (~> 0.3.16)
   rails (~> 5.0.0.1)
   rails-controller-testing
-  rails_12factor
   rr
   rspec (~> 3.5)
   rspec-collection_matchers (~> 1.1.0)

+ 10 - 0
config/environments/production.rb

@@ -18,6 +18,16 @@ Huginn::Application.configure do
   # Apache or NGINX already handles this.
   config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
 
+  if ENV["RAILS_LOG_TO_STDOUT"].present? ||
+       ENV['ON_HEROKU'] ||
+       ENV['HEROKU_POSTGRESQL_ROSE_URL'] ||
+       ENV['HEROKU_POSTGRESQL_GOLD_URL'] ||
+       File.read(File.join(File.dirname(__FILE__), '../../Procfile')) =~ /intended for Heroku/
+    logger           = ActiveSupport::Logger.new(STDOUT)
+    logger.formatter = config.log_formatter
+    config.logger = ActiveSupport::TaggedLogging.new(logger)
+  end
+
   # Compress JavaScripts and CSS
   config.assets.js_compressor  = :uglifier
   config.assets.css_compressor = :sass