From 54661746ffa9f113c6b489a4d5ba170a27874ad1 Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 24 Mar 2016 11:10:48 +0100 Subject: upgrade: migrate config environment.rb boot.rb application.rb -> adopted according to http://railsdiff.org/3.2.22.2/4.2.6 Also dropped quite_assets - not sure if this is still needed with rails 4.2. If it is we can bring it back. --- Gemfile | 1 - Gemfile.lock | 3 --- config/application.rb | 57 +++++++-------------------------------------------- config/boot.rb | 5 +---- config/environment.rb | 6 +++--- 5 files changed, 11 insertions(+), 61 deletions(-) diff --git a/Gemfile b/Gemfile index bf05642..0df9357 100644 --- a/Gemfile +++ b/Gemfile @@ -43,7 +43,6 @@ gem 'client_side_validations-simple_form' gem "haml-rails" gem "bootstrap-sass" gem "sass-rails" -gem 'quiet_assets' # stops logging all the asset requests group :production do gem "uglifier" gem 'therubyracer', :platforms => :ruby diff --git a/Gemfile.lock b/Gemfile.lock index cf005f3..bd41a09 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -213,8 +213,6 @@ GEM coderay (~> 1.1.0) method_source (~> 0.8.1) slop (~> 3.4) - quiet_assets (1.1.0) - railties (>= 3.1, < 5.0) rack (1.6.4) rack-protection (1.5.3) rack @@ -342,7 +340,6 @@ DEPENDENCIES phantomjs-binaries poltergeist pry - quiet_assets rails (~> 4.2.6) rails-i18n rails_warden diff --git a/config/application.rb b/config/application.rb index 4771f89..4a70b04 100644 --- a/config/application.rb +++ b/config/application.rb @@ -7,12 +7,9 @@ require "action_mailer/railtie" require "sprockets/railtie" require "rails/test_unit/railtie" -if defined?(Bundler) - # If you precompile assets before deploying to production, use this line - Bundler.require(*Rails.groups(:assets => %w(development test))) - # If you want your assets lazily compiled in production, use this line - # Bundler.require(:default, :assets, Rails.env) -end +# Require the gems listed in Gemfile, including any gems +# you've limited to :test, :development, or :production. +Bundler.require(*Rails.groups) APP_CONFIG = ["defaults.yml", "config.yml"].inject({}) {|config, file| filepath = File.expand_path(file, File.dirname(__FILE__)) @@ -29,16 +26,6 @@ module LeapWeb # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. - # Custom directories with classes and modules you want to be autoloadable. - # config.autoload_paths += %W(#{config.root}/extras) - - # Only load the plugins named here, in the order given (default is alphabetical). - # :all can be used as a placeholder for all plugins not explicitly named. - # config.plugins = [ :exception_notification, :ssl_requirement, :all ] - - # Activate observers that should always be running. - # config.active_record.observers = :cacher, :garbage_collector, :forum_observer - # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone. # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC. # config.time_zone = 'Central Time (US & Canada)' @@ -47,48 +34,18 @@ module LeapWeb # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] # config.i18n.default_locale = :de - # Configure the default encoding used in templates for Ruby 1.9. - config.encoding = "utf-8" - - # Configure sensitive parameters which will be filtered from the log file. - config.filter_parameters += [:password] - if APP_CONFIG[:logfile].present? config.logger = Logger.new(APP_CONFIG[:logfile]) end - # Enable escaping HTML in JSON. - config.active_support.escape_html_entities_in_json = true - - # Use SQL instead of Active Record's schema dumper when creating the database. - # This is necessary if your schema can't be completely dumped by the schema dumper, - # like if you have constraints or database-specific column types - # config.active_record.schema_format = :sql - - # Enforce whitelist mode for mass assignment. - # This will create an empty whitelist of attributes available for mass-assignment for all models - # in your app. As such, your models will need to explicitly whitelist or blacklist accessible - # parameters by using an attr_accessible or attr_protected declaration. - # config.active_record.whitelist_attributes = true - - ## - ## ASSETS - ## - - # Enable the asset pipeline - config.assets.enabled = true - config.assets.initialize_on_precompile = true # don't change this (see customization.rb) - - # Version of your assets, change this if you want to expire all your assets - config.assets.version = '1.0' - - # Set to false in order to see asset requests in the log - config.quiet_assets = true - ## ## CUSTOMIZATION ## see initializers/customization.rb ## + + # don't change this (see customization.rb) + config.assets.initialize_on_precompile = true + if APP_CONFIG["customization_directory"] custom_view_path = (Pathname.new(APP_CONFIG["customization_directory"]).relative_path_from(Rails.root) + 'views').to_s else diff --git a/config/boot.rb b/config/boot.rb index 4489e58..6b750f0 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,6 +1,3 @@ -require 'rubygems' - -# Set up gems listed in the Gemfile. ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__) -require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE']) +require 'bundler/setup' # Set up gems listed in the Gemfile. diff --git a/config/environment.rb b/config/environment.rb index fe16a54..00a613f 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,5 +1,5 @@ -# Load the rails application +# Load the rails application. require File.expand_path('../application', __FILE__) -# Initialize the rails application -LeapWeb::Application.initialize! +# Initialize the rails application. +Rails.application.initialize! -- cgit v1.2.3