From bd402599f541e3da86036f21d955b6e6fc31185c Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Thu, 24 Apr 2014 22:58:30 +0100 Subject: [PATCH] Update to rails 4.1.1 --- Gemfile | 10 +- Gemfile.lock | 120 +++++++++++----------- config.ru | 2 +- config/application.rb | 11 +- config/boot.rb | 4 +- config/environment.rb | 6 +- config/environments/development.rb | 10 +- config/environments/production.rb | 5 +- config/environments/test.rb | 5 +- config/initializers/cookies_serializer.rb | 3 + config/initializers/secret_token.rb | 12 --- config/initializers/session_store.rb | 4 +- config/secrets.yml | 22 ++++ 13 files changed, 117 insertions(+), 97 deletions(-) create mode 100644 config/initializers/cookies_serializer.rb delete mode 100644 config/initializers/secret_token.rb create mode 100644 config/secrets.yml diff --git a/Gemfile b/Gemfile index 0cdf8ce7f..20f05d723 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ -source 'http://rubygems.org' +source 'https://rubygems.org' # Require rails -gem 'rails', '4.0.5' +gem 'rails', '4.1.1' # Require things which have moved to gems in ruby 1.9 gem 'bigdecimal', "~> 1.1.0", :platforms => :ruby_19 @@ -16,7 +16,7 @@ gem 'json' gem 'pg' # Use SCSS for stylesheets -gem 'sass-rails', '~> 4.0.0' +gem 'sass-rails', '~> 4.0.3' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' @@ -41,7 +41,7 @@ gem 'rinku', '>= 1.2.2', :require => 'rails_rinku' gem 'oauth-plugin', '>= 0.5.1' gem 'open_id_authentication', '>= 1.1.0' gem 'validates_email_format_of', '>= 1.5.1' -gem 'composite_primary_keys', '>= 6.0.1' +gem 'composite_primary_keys', '~> 7.0.1' gem 'http_accept_language', '~> 2.0.0' gem 'paperclip', '~> 4.0' gem 'deadlock_retry', '>= 1.2.0' @@ -84,7 +84,7 @@ end # Gems needed for running tests group :test do gem 'timecop' - gem 'minitest', '~> 4.7.0', :platforms => [:ruby_19, :ruby_20] + gem 'minitest', '~> 5.1', :platforms => [:ruby_19, :ruby_20] end # Needed in development as well so rake can see konacha tasks diff --git a/Gemfile.lock b/Gemfile.lock index fc2d4f54b..c875850f7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,36 +1,38 @@ GEM - remote: http://rubygems.org/ + remote: https://rubygems.org/ specs: SystemTimer (1.2.3) - actionmailer (4.0.5) - actionpack (= 4.0.5) + actionmailer (4.1.1) + actionpack (= 4.1.1) + actionview (= 4.1.1) mail (~> 2.5.4) - actionpack (4.0.5) - activesupport (= 4.0.5) - builder (~> 3.1.0) - erubis (~> 2.7.0) + actionpack (4.1.1) + actionview (= 4.1.1) + activesupport (= 4.1.1) rack (~> 1.5.2) rack-test (~> 0.6.2) actionpack-page_caching (1.0.2) actionpack (>= 4.0.0, < 5) - activemodel (4.0.5) - activesupport (= 4.0.5) - builder (~> 3.1.0) - activerecord (4.0.5) - activemodel (= 4.0.5) - activerecord-deprecated_finders (~> 1.0.2) - activesupport (= 4.0.5) - arel (~> 4.0.0) - activerecord-deprecated_finders (1.0.3) - activesupport (4.0.5) + actionview (4.1.1) + activesupport (= 4.1.1) + builder (~> 3.1) + erubis (~> 2.7.0) + activemodel (4.1.1) + activesupport (= 4.1.1) + builder (~> 3.1) + activerecord (4.1.1) + activemodel (= 4.1.1) + activesupport (= 4.1.1) + arel (~> 5.0.0) + activesupport (4.1.1) i18n (~> 0.6, >= 0.6.9) - minitest (~> 4.2) - multi_json (~> 1.3) + json (~> 1.7, >= 1.7.7) + minitest (~> 5.1) thread_safe (~> 0.1) - tzinfo (~> 0.3.37) - arel (4.0.2) + tzinfo (~> 1.1) + arel (5.0.1.20140414130214) bigdecimal (1.1.0) - builder (3.1.4) + builder (3.2.2) capybara (2.2.1) mime-types (>= 1.16) nokogiri (>= 1.3.3) @@ -49,14 +51,14 @@ GEM coffee-script-source execjs coffee-script-source (1.7.0) - colorize (0.7.2) - composite_primary_keys (6.0.3) - activerecord (>= 4.0.0) - dalli (2.7.1) + colorize (0.7.3) + composite_primary_keys (7.0.1) + activerecord (~> 4.1.0) + dalli (2.7.2) deadlock_retry (1.2.0) dynamic_form (1.1.4) erubis (2.7.0) - execjs (2.0.2) + execjs (2.1.0) faraday (0.9.0) multipart-post (>= 1.2, < 3) hike (1.2.3) @@ -74,10 +76,9 @@ GEM jsonify-rails (0.3.2) actionpack jsonify (< 0.4.0) - jwt (0.1.13) - multi_json (>= 1.5) + jwt (1.0.0) kgio (2.9.2) - konacha (3.2.2) + konacha (3.2.3) actionpack (>= 3.1, < 5) capybara colorize @@ -88,22 +89,22 @@ GEM mime-types (~> 1.16) treetop (~> 1.4.8) mime-types (1.25.1) - mini_portile (0.5.3) - minitest (4.7.5) - multi_json (1.10.0) + mini_portile (0.6.0) + minitest (5.3.4) + multi_json (1.10.1) multi_xml (0.5.5) multipart-post (2.0.0) - nokogiri (1.6.1) - mini_portile (~> 0.5.0) + nokogiri (1.6.2.1) + mini_portile (= 0.6.0) oauth (0.4.7) oauth-plugin (0.5.1) multi_json oauth (~> 0.4.4) oauth2 (>= 0.5.0) rack - oauth2 (0.9.3) + oauth2 (0.9.4) faraday (>= 0.8, < 0.10) - jwt (~> 0.1.8) + jwt (~> 1.0) multi_json (~> 1.3) multi_xml (~> 0.5) rack (~> 1.2) @@ -124,7 +125,7 @@ GEM websocket-driver (>= 0.2.0) polyglot (0.3.4) psych (2.0.5) - r2 (0.2.3) + r2 (0.2.4) rack (1.5.2) rack-cors (0.2.9) rack-openid (1.4.2) @@ -132,24 +133,26 @@ GEM ruby-openid (>= 2.1.8) rack-test (0.6.2) rack (>= 1.0) - rails (4.0.5) - actionmailer (= 4.0.5) - actionpack (= 4.0.5) - activerecord (= 4.0.5) - activesupport (= 4.0.5) + rails (4.1.1) + actionmailer (= 4.1.1) + actionpack (= 4.1.1) + actionview (= 4.1.1) + activemodel (= 4.1.1) + activerecord (= 4.1.1) + activesupport (= 4.1.1) bundler (>= 1.3.0, < 2.0) - railties (= 4.0.5) - sprockets-rails (~> 2.0.0) + railties (= 4.1.1) + sprockets-rails (~> 2.0) rails-i18n (4.0.2) i18n (~> 0.6) rails (>= 4.0) - railties (4.0.5) - actionpack (= 4.0.5) - activesupport (= 4.0.5) + railties (4.1.1) + actionpack (= 4.1.1) + activesupport (= 4.1.1) rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (10.3.1) - redcarpet (3.1.1) + rake (10.3.2) + redcarpet (3.1.2) rinku (1.7.3) ruby-openid (2.5.0) sanitize (2.1.0) @@ -166,23 +169,24 @@ GEM multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sprockets-rails (2.0.1) + sprockets-rails (2.1.3) actionpack (>= 3.0) activesupport (>= 3.0) sprockets (~> 2.8) thor (0.19.1) - thread_safe (0.3.3) + thread_safe (0.3.4) tilt (1.4.1) timecop (0.7.1) treetop (1.4.15) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.39) + tzinfo (1.2.0) + thread_safe (~> 0.1) uglifier (2.5.0) execjs (>= 0.3.0) json (>= 1.8.0) validates_email_format_of (1.5.3) - vendorer (0.1.15) + vendorer (0.1.16) websocket-driver (0.3.3) xpath (2.0.0) nokogiri (~> 1.3) @@ -195,7 +199,7 @@ DEPENDENCIES actionpack-page_caching bigdecimal (~> 1.1.0) coffee-rails (~> 4.0.0) - composite_primary_keys (>= 6.0.1) + composite_primary_keys (~> 7.0.1) dalli deadlock_retry (>= 1.2.0) dynamic_form @@ -209,7 +213,7 @@ DEPENDENCIES kgio konacha libxml-ruby (>= 2.0.5) - minitest (~> 4.7.0) + minitest (~> 5.1) oauth-plugin (>= 0.5.1) open_id_authentication (>= 1.1.0) openstreetmap-i18n-js (>= 3.0.0.rc5.3) @@ -219,13 +223,13 @@ DEPENDENCIES psych r2 rack-cors - rails (= 4.0.5) + rails (= 4.1.1) rails-i18n (~> 4.0.0) redcarpet rinku (>= 1.2.2) ruby-openid (>= 2.2.0) sanitize - sass-rails (~> 4.0.0) + sass-rails (~> 4.0.3) soap4r-ruby1.9 timecop uglifier (>= 1.3.0) diff --git a/config.ru b/config.ru index 205abe353..5bc2a619e 100644 --- a/config.ru +++ b/config.ru @@ -1,4 +1,4 @@ # This file is used by Rack-based servers to start the application. require ::File.expand_path('../config/environment', __FILE__) -run OpenStreetMap::Application +run Rails.application diff --git a/config/application.rb b/config/application.rb index 3cb01eabf..a40336c33 100644 --- a/config/application.rb +++ b/config/application.rb @@ -14,7 +14,7 @@ end # Require the gems listed in Gemfile, including any gems # you've limited to :test, :development, or :production. -Bundler.require(:default, Rails.env) +Bundler.require(*Rails.groups) module OpenStreetMap class Application < Rails::Application @@ -33,9 +33,6 @@ module OpenStreetMap # Custom directories with classes and modules you want to be autoloadable. config.autoload_paths += %W(#{config.root}/lib) - # Configure the default encoding used in templates for Ruby 1.9. - config.encoding = "utf-8" - # 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 @@ -43,12 +40,6 @@ module OpenStreetMap config.active_record.schema_format = :sql end - # Enable the asset pipeline - config.assets.enabled = true - - # Version of your assets, change this if you want to expire all your assets - config.assets.version = '1.0' - # Don't eager load models when the database is offline if STATUS == :database_offline config.paths["app/models"].skip_eager_load! diff --git a/config/boot.rb b/config/boot.rb index 4489e5868..5e5f0c1fa 100644 --- a/config/boot.rb +++ b/config/boot.rb @@ -1,6 +1,4 @@ -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' if File.exist?(ENV['BUNDLE_GEMFILE']) diff --git a/config/environment.rb b/config/environment.rb index b958021e8..ee8d90dc6 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 -OpenStreetMap::Application.initialize! +# Initialize the Rails application. +Rails.application.initialize! diff --git a/config/environments/development.rb b/config/environments/development.rb index 36696f827..a414d1490 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -19,11 +19,19 @@ OpenStreetMap::Application.configure do # Print deprecation notices to the Rails logger. config.active_support.deprecation = :log - # Raise an error on page load if there are pending migrations + # 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 + + # Raises error for missing translations + # config.action_view.raise_on_missing_translations = true end diff --git a/config/environments/production.rb b/config/environments/production.rb index c4910d86f..9debf9666 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -5,7 +5,7 @@ OpenStreetMap::Application.configure do config.cache_classes = true # Eager load code on boot. This eager loads most of Rails and - # your application in memory, allowing both thread web servers + # 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 @@ -102,4 +102,7 @@ OpenStreetMap::Application.configure do # 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 diff --git a/config/environments/test.rb b/config/environments/test.rb index ebbda5836..b0ff645a0 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -14,7 +14,7 @@ OpenStreetMap::Application.configure do # Configure static asset server for tests with Cache-Control for performance. config.serve_static_assets = true - config.static_cache_control = "public, max-age=3600" + config.static_cache_control = 'public, max-age=3600' # Show full error reports and disable caching. config.consider_all_requests_local = true @@ -33,4 +33,7 @@ OpenStreetMap::Application.configure do # 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 diff --git a/config/initializers/cookies_serializer.rb b/config/initializers/cookies_serializer.rb new file mode 100644 index 000000000..7a06a89f0 --- /dev/null +++ b/config/initializers/cookies_serializer.rb @@ -0,0 +1,3 @@ +# Be sure to restart your server when you modify this file. + +Rails.application.config.action_dispatch.cookies_serializer = :json \ No newline at end of file diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb deleted file mode 100644 index ac761aea5..000000000 --- a/config/initializers/secret_token.rb +++ /dev/null @@ -1,12 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure your secret_key_base is kept private -# if you're sharing your code publicly. -OpenStreetMap::Application.config.secret_key_base = '8be565e2e25831d88231f4bcfd83dfc3ab33957c4f33bb3cff7a279f7820ec4d0c1111f246bb347c68859c0b46b4e591be9179a53a5a7165a9936000d6d2be41' diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 17173d536..97886ab3e 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,7 +1,7 @@ # Be sure to restart your server when you modify this file. if defined?(MEMCACHE_SERVERS) - OpenStreetMap::Application.config.session_store :mem_cache_store, :memcache_server => MEMCACHE_SERVERS, :namespace => "rails:session", :key => "_osm_session" + Rails.application.config.session_store :mem_cache_store, :memcache_server => MEMCACHE_SERVERS, :namespace => "rails:session", :key => "_osm_session" else - OpenStreetMap::Application.config.session_store :cache_store, :key => '_osm_session' + Rails.application.config.session_store :cache_store, :key => '_osm_session' end diff --git a/config/secrets.yml b/config/secrets.yml new file mode 100644 index 000000000..253f2be62 --- /dev/null +++ b/config/secrets.yml @@ -0,0 +1,22 @@ +# Be sure to restart your server when you modify this file. + +# Your secret key is used for verifying the integrity of signed cookies. +# If you change this key, all old signed cookies will become invalid! + +# Make sure the secret is at least 30 characters and all random, +# no regular words or you'll be exposed to dictionary attacks. +# You can use `rake secret` to generate a secure secret key. + +# Make sure the secrets in this file are kept private +# if you're sharing your code publicly. + +development: + secret_key_base: 1ce5ed17771b4fdc3f755c5b98459d67816f99ec5889ec2fa7bf2bd3cba3ad5cc453693ce3c5d121669be478fb811136f4f483e6f39ac1f0e34ba66e8acab574 + +test: + secret_key_base: 10d52b1bf88c429e73ffbc5e5f58b037db21f38ea88b8b454e55d52ed8bcc6e7fe3b48a79b2f36eb78a4685224d707767d083f79c51f7d81a9d4a06d1c1e2534 + +# Do not keep production secrets in the repository, +# instead read values from the environment. +production: + secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> -- 2.43.2