changeset 89:d5a0d66ee457

Finish updating to rails 5
author nanaya <me@myconan.net>
date Sat, 02 Jul 2016 16:26:00 +0900
parents cf9a9ce2d034
children 0b2b1865e864
files Gemfile Gemfile.lock config.ru config/application.rb config/environments/production.rb config/initializers/cookies_serializer.rb config/initializers/new_framework_defaults.rb config/puma.rb config/routes.rb
diffstat 9 files changed, 96 insertions(+), 88 deletions(-) [+]
line wrap: on
line diff
--- a/Gemfile	Tue Jun 28 02:38:27 2016 +0900
+++ b/Gemfile	Sat Jul 02 16:26:00 2016 +0900
@@ -1,6 +1,6 @@
 source "https://rubygems.org"
 
-rails_ver = "~> 5.0.0.rc2"
+rails_ver = "~> 5.0.0"
 gem "actionview", rails_ver
 gem "railties", rails_ver
 gem "actionpack", rails_ver
--- a/Gemfile.lock	Tue Jun 28 02:38:27 2016 +0900
+++ b/Gemfile.lock	Sat Jul 02 16:26:00 2016 +0900
@@ -1,20 +1,20 @@
 GEM
   remote: https://rubygems.org/
   specs:
-    actionpack (5.0.0.rc2)
-      actionview (= 5.0.0.rc2)
-      activesupport (= 5.0.0.rc2)
-      rack (~> 2.x)
+    actionpack (5.0.0)
+      actionview (= 5.0.0)
+      activesupport (= 5.0.0)
+      rack (~> 2.0)
       rack-test (~> 0.6.3)
-      rails-dom-testing (~> 1.0, >= 1.0.5)
+      rails-dom-testing (~> 2.0)
       rails-html-sanitizer (~> 1.0, >= 1.0.2)
-    actionview (5.0.0.rc2)
-      activesupport (= 5.0.0.rc2)
+    actionview (5.0.0)
+      activesupport (= 5.0.0)
       builder (~> 3.1)
       erubis (~> 2.7.0)
-      rails-dom-testing (~> 1.0, >= 1.0.5)
+      rails-dom-testing (~> 2.0)
       rails-html-sanitizer (~> 1.0, >= 1.0.2)
-    activesupport (5.0.0.rc2)
+    activesupport (5.0.0)
       concurrent-ruby (~> 1.0, >= 1.0.2)
       i18n (~> 0.7)
       minitest (~> 5.1)
@@ -25,7 +25,7 @@
     concurrent-ruby (1.0.2)
     concurrent-ruby (1.0.2-java)
     dalli (2.7.6)
-    domain_name (0.5.20160310)
+    domain_name (0.5.20160615)
       unf (>= 0.0.5, < 1.0.0)
     equalizer (0.0.10)
     erubis (2.7.0)
@@ -53,7 +53,7 @@
     minitest (5.9.0)
     multipart-post (2.0.0)
     naught (1.1.0)
-    newrelic_rpm (3.15.2.317)
+    newrelic_rpm (3.16.0.318)
     nokogiri (1.6.8)
       mini_portile2 (~> 2.1.0)
       pkg-config (~> 1.1.7)
@@ -64,21 +64,17 @@
     pkg-config (1.1.7)
     puma (3.4.0)
     puma (3.4.0-java)
-    rack (2.0.0.rc1)
-      json
+    rack (2.0.1)
     rack-test (0.6.3)
       rack (>= 1.0)
-    rails-deprecated_sanitizer (1.0.3)
-      activesupport (>= 4.2.0.alpha)
-    rails-dom-testing (1.0.7)
-      activesupport (>= 4.2.0.beta, < 5.0)
+    rails-dom-testing (2.0.1)
+      activesupport (>= 4.2.0, < 6.0)
       nokogiri (~> 1.6.0)
-      rails-deprecated_sanitizer (>= 1.0.1)
     rails-html-sanitizer (1.0.3)
       loofah (~> 2.0)
-    railties (5.0.0.rc2)
-      actionpack (= 5.0.0.rc2)
-      activesupport (= 5.0.0.rc2)
+    railties (5.0.0)
+      actionpack (= 5.0.0)
+      activesupport (= 5.0.0)
       method_source
       rake (>= 0.8.7)
       thor (>= 0.18.1, < 2.0)
@@ -114,12 +110,12 @@
   x86-mingw32
 
 DEPENDENCIES
-  actionpack (~> 5.0.0.rc2)
-  actionview (~> 5.0.0.rc2)
+  actionpack (~> 5.0.0)
+  actionview (~> 5.0.0)
   dalli
   newrelic_rpm
   puma
-  railties (~> 5.0.0.rc2)
+  railties (~> 5.0.0)
   twitter
   twitter-text
 
--- a/config.ru	Tue Jun 28 02:38:27 2016 +0900
+++ b/config.ru	Sat Jul 02 16:26:00 2016 +0900
@@ -1,4 +1,5 @@
 # This file is used by Rack-based servers to start the application.
 
-require ::File.expand_path("../config/environment", __FILE__)
+require_relative "config/environment"
+
 run Rails.application
--- a/config/application.rb	Tue Jun 28 02:38:27 2016 +0900
+++ b/config/application.rb	Sat Jul 02 16:26:00 2016 +0900
@@ -21,13 +21,6 @@
     # Application configuration should go into files in config/initializers
     # -- all .rb files in that directory are automatically loaded.
 
-    # 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)'
-
-    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
-    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
-    # config.i18n.default_locale = :de
     config.middleware.delete ActionDispatch::Cookies
 
     # this isn't actually used but railties checks this variable during boot.
--- a/config/environments/production.rb	Tue Jun 28 02:38:27 2016 +0900
+++ b/config/environments/production.rb	Sat Jul 02 16:26:00 2016 +0900
@@ -78,7 +78,7 @@
   # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name')
 
   # if ENV["RAILS_LOG_TO_STDOUT"].present?
-  logger           = ActiveSupport::Logger.new(STDOUT)
+  logger = ActiveSupport::Logger.new(STDOUT)
   logger.formatter = config.log_formatter
   config.logger = ActiveSupport::TaggedLogging.new(logger)
   # end
--- a/config/initializers/cookies_serializer.rb	Tue Jun 28 02:38:27 2016 +0900
+++ b/config/initializers/cookies_serializer.rb	Sat Jul 02 16:26:00 2016 +0900
@@ -2,4 +2,4 @@
 
 # Specify a serializer for the signed and encrypted cookie jars.
 # Valid options are :json, :marshal, and :hybrid.
-Rails.application.config.action_dispatch.cookies_serializer = :marshal
+# Rails.application.config.action_dispatch.cookies_serializer = :marshal
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/initializers/new_framework_defaults.rb	Sat Jul 02 16:26:00 2016 +0900
@@ -0,0 +1,24 @@
+# Be sure to restart your server when you modify this file.
+#
+# This file contains migration options to ease your Rails 5.0 upgrade.
+#
+# Read the Rails 5.0 release notes for more info on each option.
+
+# Enable per-form CSRF tokens. Previous versions had false.
+# Rails.application.config.action_controller.per_form_csrf_tokens = true
+
+# Enable origin-checking CSRF mitigation. Previous versions had false.
+# Rails.application.config.action_controller.forgery_protection_origin_check = true
+
+# Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
+# Previous versions had false.
+ActiveSupport.to_time_preserves_timezone = true
+
+# Require `belongs_to` associations by default. Previous versions had false.
+# Rails.application.config.active_record.belongs_to_required_by_default = true
+
+# Do not halt callback chains when a callback returns false. Previous versions had true.
+# ActiveSupport.halt_callback_chains_on_return_false = false
+
+# Configure SSL options to enable HSTS with subdomains. Previous versions had false.
+# Rails.application.config.ssl_options = { hsts: { subdomains: true } }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/puma.rb	Sat Jul 02 16:26:00 2016 +0900
@@ -0,0 +1,47 @@
+# Puma can serve each request in a thread from an internal thread pool.
+# The `threads` method setting takes two numbers a minimum and maximum.
+# Any libraries that use thread pools should be configured to match
+# the maximum value specified for Puma. Default is set to 5 threads for minimum
+# and maximum, this matches the default thread size of Active Record.
+#
+threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
+threads threads_count, threads_count
+
+# Specifies the `port` that Puma will listen on to receive requests, default is 3000.
+#
+port        ENV.fetch("PORT") { 3000 }
+
+# Specifies the `environment` that Puma will run in.
+#
+environment ENV.fetch("RAILS_ENV") { "development" }
+
+# Specifies the number of `workers` to boot in clustered mode.
+# Workers are forked webserver processes. If using threads and workers together
+# the concurrency of the application would be max `threads` * `workers`.
+# Workers do not work on JRuby or Windows (both of which do not support
+# processes).
+#
+# workers ENV.fetch("WEB_CONCURRENCY") { 2 }
+
+# Use the `preload_app!` method when specifying a `workers` number.
+# This directive tells Puma to first boot the application and load code
+# before forking the application. This takes advantage of Copy On Write
+# process behavior so workers use less memory. If you use this option
+# you need to make sure to reconnect any threads in the `on_worker_boot`
+# block.
+#
+# preload_app!
+
+# The code in the `on_worker_boot` will be called if you are using
+# clustered mode by specifying a number of `workers`. After each worker
+# process is booted this block will be run, if you are using `preload_app!`
+# option you will want to use this block to reconnect to any threads
+# or connections that may have been created at application boot, Ruby
+# cannot share connections between processes.
+#
+# on_worker_boot do
+#   ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
+# end
+
+# Allow puma to be restarted by `rails restart` command.
+plugin :tmp_restart
--- a/config/routes.rb	Tue Jun 28 02:38:27 2016 +0900
+++ b/config/routes.rb	Sat Jul 02 16:26:00 2016 +0900
@@ -1,58 +1,5 @@
 Rails.application.routes.draw do
-  # The priority is based upon order of creation: first created -> highest priority.
-  # See how all your routes lay out with "rake routes".
-
-  # You can have the root of your site routed with "root"
   root "tweets#index"
 
   get "*id" => "tweets#show", :defaults => { :format => :atom }, :as => "tweet"
-
-  # Example of regular route:
-  #   get 'products/:id' => 'catalog#view'
-
-  # Example of named route that can be invoked with purchase_url(id: product.id)
-  #   get 'products/:id/purchase' => 'catalog#purchase', as: :purchase
-
-  # Example resource route (maps HTTP verbs to controller actions automatically):
-  #   resources :products
-
-  # Example resource route with options:
-  #   resources :products do
-  #     member do
-  #       get 'short'
-  #       post 'toggle'
-  #     end
-  #
-  #     collection do
-  #       get 'sold'
-  #     end
-  #   end
-
-  # Example resource route with sub-resources:
-  #   resources :products do
-  #     resources :comments, :sales
-  #     resource :seller
-  #   end
-
-  # Example resource route with more complex sub-resources:
-  #   resources :products do
-  #     resources :comments
-  #     resources :sales do
-  #       get 'recent', on: :collection
-  #     end
-  #   end
-
-  # Example resource route with concerns:
-  #   concern :toggleable do
-  #     post 'toggle'
-  #   end
-  #   resources :posts, concerns: :toggleable
-  #   resources :photos, concerns: :toggleable
-
-  # Example resource route within a namespace:
-  #   namespace :admin do
-  #     # Directs /admin/products/* to Admin::ProductsController
-  #     # (app/controllers/admin/products_controller.rb)
-  #     resources :products
-  #   end
 end