Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

Commit

Permalink
Merge pull request #673 from y-yagi/rails_600
Browse files Browse the repository at this point in the history
Rails 600
  • Loading branch information
y-yagi authored May 9, 2019
2 parents 70bf233 + 16b9898 commit 4aebaaf
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 106 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ruby '2.6.2'
source 'https://rubygems.org'
gem 'rails', '>= 5.2'
gem 'rails', '>= 6.0.0.rc1'

gem 'active_decorator'
gem 'array_form_helper'
Expand Down
104 changes: 60 additions & 44 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,55 +1,68 @@
GEM
remote: https://rubygems.org/
specs:
actioncable (5.2.2.1)
actionpack (= 5.2.2.1)
actioncable (6.0.0.rc1)
actionpack (= 6.0.0.rc1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailer (5.2.2.1)
actionpack (= 5.2.2.1)
actionview (= 5.2.2.1)
activejob (= 5.2.2.1)
actionmailbox (6.0.0.rc1)
actionpack (= 6.0.0.rc1)
activejob (= 6.0.0.rc1)
activerecord (= 6.0.0.rc1)
activestorage (= 6.0.0.rc1)
activesupport (= 6.0.0.rc1)
mail (>= 2.7.1)
actionmailer (6.0.0.rc1)
actionpack (= 6.0.0.rc1)
actionview (= 6.0.0.rc1)
activejob (= 6.0.0.rc1)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.2.2.1)
actionview (= 5.2.2.1)
activesupport (= 5.2.2.1)
actionpack (6.0.0.rc1)
actionview (= 6.0.0.rc1)
activesupport (= 6.0.0.rc1)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionview (5.2.2.1)
activesupport (= 5.2.2.1)
actiontext (6.0.0.rc1)
actionpack (= 6.0.0.rc1)
activerecord (= 6.0.0.rc1)
activestorage (= 6.0.0.rc1)
activesupport (= 6.0.0.rc1)
nokogiri (>= 1.8.5)
actionview (6.0.0.rc1)
activesupport (= 6.0.0.rc1)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
active_decorator (1.2.0)
activejob (5.2.2.1)
activesupport (= 5.2.2.1)
activejob (6.0.0.rc1)
activesupport (= 6.0.0.rc1)
globalid (>= 0.3.6)
activemodel (5.2.2.1)
activesupport (= 5.2.2.1)
activerecord (5.2.2.1)
activemodel (= 5.2.2.1)
activesupport (= 5.2.2.1)
arel (>= 9.0)
activestorage (5.2.2.1)
actionpack (= 5.2.2.1)
activerecord (= 5.2.2.1)
activemodel (6.0.0.rc1)
activesupport (= 6.0.0.rc1)
activerecord (6.0.0.rc1)
activemodel (= 6.0.0.rc1)
activesupport (= 6.0.0.rc1)
activestorage (6.0.0.rc1)
actionpack (= 6.0.0.rc1)
activejob (= 6.0.0.rc1)
activerecord (= 6.0.0.rc1)
marcel (~> 0.3.1)
activesupport (5.2.2.1)
activesupport (6.0.0.rc1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.1, >= 2.1.4)
activesupport-testing-metadata (0.1.0)
activesupport (>= 4.0)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
archive-zip (0.12.0)
io-like (~> 0.3.0)
arel (9.0.0)
array_form_helper (0.0.1)
actionpack (>= 4.0)
benchmark-ips (2.7.2)
Expand Down Expand Up @@ -235,30 +248,32 @@ GEM
rack (>= 1.2.0)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.2.1)
actioncable (= 5.2.2.1)
actionmailer (= 5.2.2.1)
actionpack (= 5.2.2.1)
actionview (= 5.2.2.1)
activejob (= 5.2.2.1)
activemodel (= 5.2.2.1)
activerecord (= 5.2.2.1)
activestorage (= 5.2.2.1)
activesupport (= 5.2.2.1)
rails (6.0.0.rc1)
actioncable (= 6.0.0.rc1)
actionmailbox (= 6.0.0.rc1)
actionmailer (= 6.0.0.rc1)
actionpack (= 6.0.0.rc1)
actiontext (= 6.0.0.rc1)
actionview (= 6.0.0.rc1)
activejob (= 6.0.0.rc1)
activemodel (= 6.0.0.rc1)
activerecord (= 6.0.0.rc1)
activestorage (= 6.0.0.rc1)
activesupport (= 6.0.0.rc1)
bundler (>= 1.3.0)
railties (= 5.2.2.1)
railties (= 6.0.0.rc1)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.0.4)
loofah (~> 2.2, >= 2.2.2)
railties (5.2.2.1)
actionpack (= 5.2.2.1)
activesupport (= 5.2.2.1)
railties (6.0.0.rc1)
actionpack (= 6.0.0.rc1)
activesupport (= 6.0.0.rc1)
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
thor (>= 0.20.3, < 2.0)
rake (12.3.2)
rambulance (0.6.0)
actionpack
Expand All @@ -269,9 +284,9 @@ GEM
ffi (>= 0.5.0, < 2)
redcarpet (3.4.0)
regexp_parser (1.4.0)
responders (2.4.0)
actionpack (>= 4.2.0, < 5.3)
railties (>= 4.2.0, < 5.3)
responders (2.4.1)
actionpack (>= 4.2.0, < 6.0)
railties (>= 4.2.0, < 6.0)
rest-client (1.8.0)
http-cookie (>= 1.0.2, < 2.0)
mime-types (>= 1.16, < 3.0)
Expand Down Expand Up @@ -331,7 +346,7 @@ GEM
activesupport (>= 4.0)
sprockets (>= 3.0.0)
stackprof (0.2.12)
temple (0.8.0)
temple (0.8.1)
term-ansicolor (1.7.1)
tins (~> 1.0)
the_garage (2.4.3)
Expand Down Expand Up @@ -375,6 +390,7 @@ GEM
websocket-extensions (0.1.3)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.1.6)

PLATFORMS
ruby
Expand Down Expand Up @@ -419,7 +435,7 @@ DEPENDENCIES
pghero
puma
rack-mini-profiler
rails (>= 5.2)
rails (>= 6.0.0.rc1)
rambulance
rinku
rollbar
Expand Down
5 changes: 0 additions & 5 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
before_action :check_logged_in, :setup
force_ssl if: :ssl_configured?
add_flash_types :info, :warning, :danger

helper_method :current_user
Expand All @@ -22,10 +21,6 @@ def setup
@travels = Travel.belong(current_user).future
end

def ssl_configured?
Rails.env.production?
end

def set_page_js
@need_pages_js = true
end
Expand Down
4 changes: 0 additions & 4 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
require_relative '../config/boot'
require 'rake'
Rake.application.run
35 changes: 21 additions & 14 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
#!/usr/bin/env ruby
require 'pathname'
require 'fileutils'

# path to your application root.
APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
APP_ROOT = File.expand_path('..', __dir__)

Dir.chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file:
def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end

FileUtils.chdir APP_ROOT do
# This script is a way to setup or update your development environment automatically.
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
# Add necessary setup steps to this file.

puts '== Installing dependencies =='
system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install')

puts "== Installing dependencies =="
system "gem install bundler --conservative"
system "bundle check || bundle install"
# Install JavaScript dependencies
# system('bin/yarn')

# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# system "cp config/database.yml.sample config/database.yml"
# unless File.exist?('config/database.yml')
# FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
# end

puts "\n== Preparing database =="
system "bin/rake db:setup"
system! 'bin/rails db:prepare'

puts "\n== Removing old logs and tempfiles =="
system "rm -f log/*"
system "rm -rf tmp/cache"
system! 'bin/rails log:clear tmp:clear'

puts "\n== Restarting application server =="
system "touch tmp/restart.txt"
system! 'bin/rails restart'
end
29 changes: 0 additions & 29 deletions bin/update

This file was deleted.

2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ class Application < Rails::Application
config.active_record.time_zone_aware_types = [:time]
config.middleware.delete Rack::Sendfile

config.load_defaults "5.2"
config.load_defaults "6.0"
end
end
2 changes: 1 addition & 1 deletion config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
config.action_mailer.delivery_method = :test

# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
config.active_support.deprecation = :raise

# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
Expand Down
2 changes: 1 addition & 1 deletion test/system/places_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class PlacesTest < ApplicationSystemTestCase
end

test 'restore archived place' do
Place.order('updated_at DESC').first.update_attributes!(status: :already_went)
Place.order('updated_at DESC').first.update!(status: :already_went)
find('.fa-history').click

assert_match '大麻比古神社', page.text
Expand Down
10 changes: 4 additions & 6 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
module Warning
def warn(str)
return if str.match?("gems")
return if str.match?("warning: possibly useless use of a variable in void context")
def Warning.warn(str)
return if str.match?("gems")
return if str.match?("warning: possibly useless use of a variable in void context")

super
end
super
end

$VERBOSE = true
Expand Down

0 comments on commit 4aebaaf

Please sign in to comment.