Permalink
Browse files

Match files as generated by Rails 4.1

  • Loading branch information...
1 parent dc8da49 commit f6adb79f0e3ae7f6a03e701fa460e54d2b483e96 @mvz mvz committed Sep 9, 2014
View
@@ -2,6 +2,5 @@
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
-require 'rake'
-Publify::Application.load_tasks
+Rails.application.load_tasks
File renamed without changes.
No changes.
View
No changes.
View
No changes.
No changes.
View
@@ -1,4 +1,4 @@
# This file is used by Rack-based servers to start the application.
require ::File.expand_path('../config/environment', __FILE__)
-run Publify::Application
+run Rails.application
View
@@ -2,8 +2,9 @@
require 'rails/all'
-# Auto-require default libraries and those for the current Rails environment.
-Bundler.require :default, Rails.env
+# Require the gems listed in Gemfile, including any gems
+# you've limited to :test, :development, or :production.
+Bundler.require(*Rails.groups)
module Publify
class Application < Rails::Application
@@ -17,7 +18,7 @@ class Application < Rails::Application
# Setup the cache path
config.action_controller.page_cache_directory = "#{::Rails.root.to_s}/public/cache/"
config.cache_store=:file_store, "#{::Rails.root.to_s}/public/cache/"
-
+
config.plugins = [ :all ]
# Activate observers that should always be running
@@ -26,9 +27,6 @@ class Application < Rails::Application
# Turn om timestamped migrations
config.active_record.timestamped_migrations = true
- # Filter sensitive parameters from the log file
- config.filter_parameters << :password
-
# To avoid exception when deploying on Heroku
config.assets.initialize_on_precompile = false
View
@@ -1,13 +1,4 @@
-require 'rubygems'
-
# Set up gems listed in the Gemfile.
-gemfile = File.expand_path('../../Gemfile', __FILE__)
-begin
- ENV['BUNDLE_GEMFILE'] = gemfile
- require 'bundler'
- Bundler.setup
-rescue Bundler::GemNotFound => e
- STDERR.puts e.message
- STDERR.puts "Try running `bundle install`."
- exit!
-end if File.exist?(gemfile)
+ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
+
+require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
@@ -1,5 +1,5 @@
-# Load the rails application
+# Load the Rails application.
require File.expand_path('../application', __FILE__)
-# Initialize the rails application
-Publify::Application.initialize!
+# Initialize the Rails application.
+Rails.application.initialize!
@@ -1,29 +1,37 @@
-# Settings specified here will take precedence over those in config/environment.rb
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
-Publify::Application.configure do
# In the development environment your application's code is reloaded on
- # every request. This slows down response time but is perfect for development
- # since you don't have to restart the webserver when you make code changes.
+ # every request. This slows down response time but is perfect for development
+ # since you don't have to restart the web server when you make code changes.
config.cache_classes = false
- config.eager_load = true
+ # Do not eager load code on boot.
+ config.eager_load = false
- # Log error messages when you accidentally call methods on nil.
- config.whiny_nils = true
+ # Show full error reports and disable caching.
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
- # Show full error reports and disable caching
- config.consider_all_requests_local = true
- config.action_controller.perform_caching = false
-
- # Don't care if the mailer can't send
+ # Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
+ # Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
- def log_to(stream)
- ActiveRecord::Base.logger = Logger.new(stream)
- ActiveRecord::Base.clear_active_connections!
- end
+ # Raise an error on page load if there are pending migrations.
+ config.active_record.migration_error = :page_load
+
+ # Debug mode disables concatenation and preprocessing of assets.
+ # This option may cause significant delays in view rendering with a large
+ # number of complex assets.
+ config.assets.debug = true
+
+ # Adds additional error checking when serving assets at runtime.
+ # Checks for improperly declared sprockets dependencies.
+ # Raises helpful error messages.
+ config.assets.raise_runtime_errors = true
- config.log_level = :debug
+ # Raises error for missing translations
+ # config.action_view.raise_on_missing_translations = true
end
@@ -1,31 +1,83 @@
-Publify::Application.configure do
- # Settings specified here will take precedence over those in config/environment.rb
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
- # The production environment is meant for finished, "live" apps.
- # Code is not reloaded between requests
+ # Code is not reloaded between requests.
config.cache_classes = true
+ # Eager load code on boot. This eager loads most of Rails and
+ # your application in memory, allowing both threaded web servers
+ # and those relying on copy on write to perform better.
+ # Rake tasks automatically ignore this option for performance.
config.eager_load = true
- # Full error reports are disabled and caching is turned on
- config.consider_all_requests_local = false
- config.action_controller.perform_caching = true
+ # Full error reports are disabled and caching is turned on.
+ config.consider_all_requests_local = false
+ config.action_controller.perform_caching = true
- # See everything in the log (default is :info)
- # config.log_level = :debug
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
+ # Add `rack-cache` to your Gemfile before enabling this.
+ # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
+ # config.action_dispatch.rack_cache = true
- # Use a different logger for distributed setups
- # config.logger = SyslogLogger.new
+ # Disable Rails's static asset server (Apache or nginx will already do this).
+ config.serve_static_assets = false
- # Use a different cache store in production
+ # Compress JavaScripts and CSS.
+ config.assets.js_compressor = :uglifier
+ # config.assets.css_compressor = :sass
+
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
+ config.assets.compile = false
+
+ # Generate digests for assets URLs.
+ config.assets.digest = true
+
+ # Version of your assets, change this if you want to expire all your assets.
+ config.assets.version = '1.0'
+
+ # Specifies the header that your server uses for sending files.
+ # config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
+
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
+ # config.force_ssl = true
+
+ # Set to :debug to see everything in the log.
+ config.log_level = :info
+
+ # Prepend all log lines with the following tags.
+ # config.log_tags = [ :subdomain, :uuid ]
+
+ # Use a different logger for distributed setups.
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
+
+ # Use a different cache store in production.
# config.cache_store = :mem_cache_store
- # Enable serving of images, stylesheets, and javascripts from an asset server
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = "http://assets.example.com"
- # Disable delivery errors, bad email addresses will be ignored
+ # Precompile additional assets.
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
+ # config.assets.precompile += %w( search.js )
+
+ # Ignore bad email addresses and do not raise email delivery errors.
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
- # Enable threaded mode
- # config.threadsafe!
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
+ # the I18n.default_locale when a translation cannot be found).
+ config.i18n.fallbacks = true
+
+ # Send deprecation notices to registered listeners.
+ config.active_support.deprecation = :notify
+
+ # Disable automatic flushing of the log to improve performance.
+ # config.autoflush_log = false
+
+ # Use default logging formatter so that PID and timestamp are not suppressed.
+ config.log_formatter = ::Logger::Formatter.new
+
+ # Do not dump schema after migrations.
+ config.active_record.dump_schema_after_migration = false
end
@@ -1,33 +1,39 @@
-# Settings specified here will take precedence over those in config/environment.rb
+Rails.application.configure do
+ # Settings specified here will take precedence over those in config/application.rb.
-Publify::Application.configure do
# The test environment is used exclusively to run your application's
- # test suite. You never need to work with it otherwise. Remember that
+ # test suite. You never need to work with it otherwise. Remember that
# your test database is "scratch space" for the test suite and is wiped
- # and recreated between test runs. Don't rely on the data there!
- config.cache_classes = false
+ # and recreated between test runs. Don't rely on the data there!
+ config.cache_classes = true
+ # Do not eager load code on boot. This avoids loading your whole application
+ # just for the purpose of running a single test. If you are using a tool that
+ # preloads Rails for running tests, you may have to set it to true.
config.eager_load = false
- # Log error messages when you accidentally call methods on nil.
- config.whiny_nils = true
+ # Configure static asset server for tests with Cache-Control for performance.
+ config.serve_static_assets = true
+ config.static_cache_control = 'public, max-age=3600'
- # Show full error reports and disable caching
- config.consider_all_requests_local = true
- config.action_controller.perform_caching = false
+ # Show full error reports and disable caching.
+ config.consider_all_requests_local = true
+ config.action_controller.perform_caching = false
- # Disable request forgery protection in test environment
- config.action_controller.allow_forgery_protection = false
+ # Raise exceptions instead of rendering exception templates.
+ config.action_dispatch.show_exceptions = false
+
+ # Disable request forgery protection in test environment.
+ config.action_controller.allow_forgery_protection = false
# Tell Action Mailer not to deliver emails to the real world.
# The :test delivery method accumulates sent emails in the
# ActionMailer::Base.deliveries array.
config.action_mailer.delivery_method = :test
- # Use SQL instead of Active Record's schema dumper when creating the test 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
-
+ # Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
+
+ # Raises error for missing translations
+ # config.action_view.raise_on_missing_translations = true
end
@@ -3,5 +3,5 @@
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
-# You can also remove all the silencers if you're trying do debug a problem that might steem from framework code.
-# Rails.backtrace_cleaner.remove_silencers!
+# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
+# Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,3 @@
+# Be sure to restart your server when you modify this file.
+
+Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -0,0 +1,4 @@
+# Be sure to restart your server when you modify this file.
+
+# Configure sensitive parameters which will be filtered from the log file.
+Rails.application.config.filter_parameters += [:password]
@@ -1,10 +1,16 @@
# Be sure to restart your server when you modify this file.
-# Add new inflection rules using the following format
-# (all these examples are active by default):
-# ActiveSupport::Inflector.inflections do |inflect|
+# Add new inflection rules using the following format. Inflections
+# are locale specific, and you may define rules for as many different
+# locales as you wish. All of these examples are active by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end
+
+# These inflection rules are supported but not enabled by default:
+# ActiveSupport::Inflector.inflections(:en) do |inflect|
+# inflect.acronym 'RESTful'
+# end
@@ -2,6 +2,5 @@
# Add new mime types for use in respond_to blocks:
# Mime::Type.register "text/richtext", :rtf
-# Mime::Type.register_alias "text/html", :iphone
Mime::Type.register_alias "application/xml", :googlesitemap
-Mime::Type.register "application/rsd+xml", :rsd
+Mime::Type.register "application/rsd+xml", :rsd
@@ -1,8 +1,3 @@
# Be sure to restart your server when you modify this file.
-Publify::Application.config.session_store :cookie_store, :key => '_publify_blog_session'
-
-# Use the database for sessions instead of the cookie-based default,
-# which shouldn't be used to store highly confidential information
-# (create the session table with "rake db:sessions:create")
-# Publify::Application.config.session_store :active_record_store
+Rails.application.config.session_store :cookie_store, key: '_publify_blog_session'
@@ -0,0 +1,14 @@
+# Be sure to restart your server when you modify this file.
+
+# This file contains settings for ActionController::ParamsWrapper which
+# is enabled by default.
+
+# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
+ActiveSupport.on_load(:action_controller) do
+ wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
+end
+
+# To enable root element in JSON for ActiveRecord objects.
+# ActiveSupport.on_load(:active_record) do
+# self.include_root_in_json = true
+# end
View
No changes.
View
@@ -1,36 +0,0 @@
-# General Apache options
-AddHandler fastcgi-script .fcgi
-#AddHandler fcgid-script .fcgi
-AddHandler cgi-script .cgi
-#Options +FollowSymLinks +ExecCGI
-
-# If you don't want Rails to look in certain directories,
-# use the following rewrite rules so that Apache won't rewrite certain requests
-#
-# Example:
-# RewriteCond %{REQUEST_URI} ^/notrails.*
-# RewriteRule .* - [L]
-
-# If Typo is accessed via an Alias directive, then you MUST also set
-# the RewriteBase in this htaccess file.
-#
-# Example:
-# Alias /blog /path/to/typo/public
-# RewriteBase /blog
-
-RewriteEngine On
-RewriteRule ^/$ /cache/index.html [QSA]
-RewriteCond %{DOCUMENT_ROOT}/cache/%{REQUEST_FILENAME} -f
-RewriteRule ^/(.*)$ /cache/$1 [PT]
-RewriteCond %{DOCUMENT_ROOT}/cache/%{REQUEST_FILENAME}.html -f
-RewriteRule ^/(.*)$ /cache/$1.html [PT]
-RewriteCond %{REQUEST_FILENAME} !-f
-RewriteRule ^(.*)$ dispatch.fcgi [QSA,L]
-
-# In case Typo experiences terminal errors
-# Instead of displaying this message you can supply a file here which will be rendered instead
-#
-# Example:
-# ErrorDocument 500 /500.html
-
-ErrorDocument 500 "<h2>Application error</h2>Typo failed to start properly"
Oops, something went wrong.

0 comments on commit f6adb79

Please sign in to comment.