Skip to content

Commit

Permalink
Update to rails 5.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
tomhughes committed Jun 18, 2018
1 parent aee2225 commit 98de681
Show file tree
Hide file tree
Showing 34 changed files with 305 additions and 109 deletions.
5 changes: 5 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ Style/HashSyntax:
- 'lib/tasks/testing.rake'
- 'config/initializers/wrap_parameters.rb'

Style/MixinUsage:
Exclude:
- 'bin/setup'
- 'bin/update'

Style/StringLiterals:
EnforcedStyle: double_quotes

Expand Down
7 changes: 5 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source "https://rubygems.org"

# Require rails
gem "rails", "5.1.6"
gem "rails", "5.2.0"

# Require things which have moved to gems in ruby 1.9
gem "bigdecimal", "~> 1.1.0", :platforms => :ruby_19
Expand Down Expand Up @@ -31,6 +31,9 @@ gem "jquery-rails"
# gem 'jbuilder', '~> 2.0'
gem "jsonify-rails"

# Reduces boot times through caching; required in config/boot.rb
gem 'bootsnap', '>= 1.1.0', require: false

# Use R2 for RTL conversion
gem "r2", "~> 0.2.7"

Expand All @@ -42,7 +45,7 @@ gem "image_optim_rails"

# Load rails plugins
gem "actionpack-page_caching"
gem "composite_primary_keys", "~> 10.0.4"
gem "composite_primary_keys", "~> 11.0.0"
gem "dynamic_form"
gem "http_accept_language", "~> 2.0.0"
gem "i18n-js", ">= 3.0.0"
Expand Down
93 changes: 52 additions & 41 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,41 +4,45 @@ GEM
SystemTimer (1.2.3)
aasm (4.12.3)
concurrent-ruby (~> 1.0)
actioncable (5.1.6)
actionpack (= 5.1.6)
actioncable (5.2.0)
actionpack (= 5.2.0)
nio4r (~> 2.0)
websocket-driver (~> 0.6.1)
actionmailer (5.1.6)
actionpack (= 5.1.6)
actionview (= 5.1.6)
activejob (= 5.1.6)
websocket-driver (>= 0.6.1)
actionmailer (5.2.0)
actionpack (= 5.2.0)
actionview (= 5.2.0)
activejob (= 5.2.0)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.1.6)
actionview (= 5.1.6)
activesupport (= 5.1.6)
actionpack (5.2.0)
actionview (= 5.2.0)
activesupport (= 5.2.0)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionpack-page_caching (1.1.0)
actionpack (>= 4.0.0, < 6)
actionview (5.1.6)
activesupport (= 5.1.6)
actionview (5.2.0)
activesupport (= 5.2.0)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.1.6)
activesupport (= 5.1.6)
activejob (5.2.0)
activesupport (= 5.2.0)
globalid (>= 0.3.6)
activemodel (5.1.6)
activesupport (= 5.1.6)
activerecord (5.1.6)
activemodel (= 5.1.6)
activesupport (= 5.1.6)
arel (~> 8.0)
activesupport (5.1.6)
activemodel (5.2.0)
activesupport (= 5.2.0)
activerecord (5.2.0)
activemodel (= 5.2.0)
activesupport (= 5.2.0)
arel (>= 9.0)
activestorage (5.2.0)
actionpack (= 5.2.0)
activerecord (= 5.2.0)
marcel (~> 0.3.1)
activesupport (5.2.0)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
Expand All @@ -48,9 +52,9 @@ GEM
annotate (2.7.4)
activerecord (>= 3.2, < 6.0)
rake (>= 10.4, < 13.0)
arel (8.0.0)
arel (9.0.0)
ast (2.4.0)
autoprefixer-rails (8.6.2)
autoprefixer-rails (8.6.3)
execjs
better_errors (2.4.0)
coderay (>= 1.0.0)
Expand All @@ -59,6 +63,8 @@ GEM
bigdecimal (1.1.0)
binding_of_caller (0.8.0)
debug_inspector (>= 0.0.1)
bootsnap (1.3.0)
msgpack (~> 1.0)
builder (3.2.3)
canonical-rails (0.2.3)
rails (>= 4.1, < 5.3)
Expand All @@ -79,8 +85,8 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
composite_primary_keys (10.0.4)
activerecord (~> 5.1.0, >= 5.1.6)
composite_primary_keys (11.0.0)
activerecord (~> 5.2.0)
concurrent-ruby (1.0.5)
coveralls (0.8.21)
json (>= 1.8, < 3)
Expand Down Expand Up @@ -163,6 +169,8 @@ GEM
nokogiri (>= 1.5.9)
mail (2.7.0)
mini_mime (>= 0.1.1)
marcel (0.3.2)
mimemagic (~> 0.3.2)
method_source (0.9.0)
mime-types (3.1)
mime-types-data (~> 3.2015)
Expand All @@ -171,6 +179,7 @@ GEM
mini_mime (1.0.0)
mini_portile2 (2.3.0)
minitest (5.11.3)
msgpack (1.2.4)
multi_json (1.13.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
Expand Down Expand Up @@ -248,17 +257,18 @@ GEM
rack-test (1.0.0)
rack (>= 1.0, < 3)
rack-uri_sanitizer (0.0.2)
rails (5.1.6)
actioncable (= 5.1.6)
actionmailer (= 5.1.6)
actionpack (= 5.1.6)
actionview (= 5.1.6)
activejob (= 5.1.6)
activemodel (= 5.1.6)
activerecord (= 5.1.6)
activesupport (= 5.1.6)
rails (5.2.0)
actioncable (= 5.2.0)
actionmailer (= 5.2.0)
actionpack (= 5.2.0)
actionview (= 5.2.0)
activejob (= 5.2.0)
activemodel (= 5.2.0)
activerecord (= 5.2.0)
activestorage (= 5.2.0)
activesupport (= 5.2.0)
bundler (>= 1.3.0)
railties (= 5.1.6)
railties (= 5.2.0)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.2)
actionpack (~> 5.x, >= 5.0.1)
Expand All @@ -272,9 +282,9 @@ GEM
rails-i18n (4.0.2)
i18n (~> 0.6)
rails (>= 4.0)
railties (5.1.6)
actionpack (= 5.1.6)
activesupport (= 5.1.6)
railties (5.2.0)
actionpack (= 5.2.0)
activesupport (= 5.2.0)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
Expand Down Expand Up @@ -354,7 +364,7 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
websocket-driver (0.6.5)
websocket-driver (0.7.0)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.3)
xpath (3.1.0)
Expand All @@ -372,10 +382,11 @@ DEPENDENCIES
better_errors
bigdecimal (~> 1.1.0)
binding_of_caller
bootsnap (>= 1.1.0)
canonical-rails
capybara (~> 2.13)
coffee-rails (~> 4.2)
composite_primary_keys (~> 10.0.4)
composite_primary_keys (~> 11.0.0)
coveralls
dalli
dynamic_form
Expand Down Expand Up @@ -413,7 +424,7 @@ DEPENDENCIES
r2 (~> 0.2.7)
rack-cors
rack-uri_sanitizer
rails (= 5.1.6)
rails (= 5.2.0)
rails-controller-testing
rails-i18n (~> 4.0.0)
record_tag_helper
Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def nearby(radius = NEARBY_RADIUS, num = NEARBY_USERS)
.where("id != ?", id)
.where(sql_for_area)
.where("#{sql_for_distance} <= ?", radius)
.order(sql_for_distance)
.order(Arel.sql(sql_for_distance))
.limit(num)
else
nearby = []
Expand Down
1 change: 1 addition & 0 deletions app/views/layouts/_head.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@
<%= yield :head %>
<%= yield :auto_discovery_link_tag %>
<%= csrf_meta_tag %>
<%= csp_meta_tag %>
<title><%= @title + ' | ' if @title %><%= t 'layouts.project_name.title' %></title>
<% end %>
3 changes: 3 additions & 0 deletions bin/bundle
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env ruby
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
load Gem.bin_path("bundler", "bundle")
4 changes: 4 additions & 0 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby
APP_PATH = File.expand_path("../config/application", __dir__)
require_relative "../config/boot"
require "rails/commands"
4 changes: 4 additions & 0 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env ruby
require_relative "../config/boot"
require "rake"
Rake.application.run
36 changes: 36 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env ruby
require "fileutils"
include FileUtils

# path to your application root.
APP_ROOT = File.expand_path("..", __dir__)

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end

chdir APP_ROOT do
# This script is a starting point to setup your application.
# Add necessary setup steps to this file.

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

# Install JavaScript dependencies if using Yarn
# system('bin/yarn')

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

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

puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"

puts "\n== Restarting application server =="
system! "bin/rails restart"
end
31 changes: 31 additions & 0 deletions bin/update
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env ruby
require "fileutils"
include FileUtils

# path to your application root.
APP_ROOT = File.expand_path("..", __dir__)

def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==")
end

chdir APP_ROOT do
# This script is a way to update your development environment automatically.
# Add necessary update steps to this file.

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

# Install JavaScript dependencies if using Yarn
# system('bin/yarn')

puts "\n== Updating database =="
system! "bin/rails db:migrate"

puts "\n== Removing old logs and tempfiles =="
system! "bin/rails log:clear tmp:clear"

puts "\n== Restarting application server =="
system! "bin/rails restart"
end
11 changes: 11 additions & 0 deletions bin/yarn
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env ruby
APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
begin
exec "yarnpkg", *ARGV
rescue Errno::ENOENT
warn "Yarn executable was not detected in the system."
warn "Download Yarn at https://yarnpkg.com/en/docs/install"
exit 1
end
end
5 changes: 3 additions & 2 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
module OpenStreetMap
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
# Application configuration can go into files in config/initializers
# -- all .rb files in that directory are automatically loaded after loading
# the framework and any gems in your application.

# Custom directories with classes and modules you want to be autoloadable.
config.autoload_paths += %W[#{config.root}/lib]
Expand Down
1 change: 1 addition & 0 deletions config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

require "bundler/setup" # Set up gems listed in the Gemfile.
require "bootsnap/setup" # Speed up boot time by caching expensive operations.
10 changes: 10 additions & 0 deletions config/cable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
development:
adapter: async

test:
adapter: async

production:
adapter: redis
url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %>
channel_prefix: openstreetmap_production
1 change: 1 addition & 0 deletions config/credentials.yml.enc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
E6VWa9zDZ3CNpJ+ztv1UbvGamyL3N+U7DepOApwj4YE4NNvH2eYr4dqw6hALKKpp2O9OoPmwAzoJy9WarOnAHo67iwkU1ZdxRGoJNPlavsNgmAwFkEMH2AgBT4AkNzAhdHq9+wM32SvwOpxzvfLx9wJ439b0hY4QR3SBgPmp69LrOLjjLgIyUn3SVTendPBJ1fZxyHSxoKjQmmpT6+2YQA94ynfAy/m/6IY9VGbz9sinZBPdwx4krg+AG7qUqx3PDgZ388bl2g8uA35BPIpGnMNBkqQXjuRrFSi1ZkkJdj6NFDqZRkLNsDUDcOfxmYIRWgx3JSDekU8/24NkGeJ1/tOw2xILlQRASi6vdfHXYIqVmbHSrEdXsLQFUqv7FNHzfUtzdTDms6g3+bYhy+ZGpLdsD3maXm36p7/Z--i03uonfXALIIhWbt--6AuvcDUvj0AL5xl8DPeU7g==
5 changes: 0 additions & 5 deletions config/daemons.yml

This file was deleted.

Loading

0 comments on commit 98de681

Please sign in to comment.