DEV: update dependencies and add notes about exceptions

Previously it was unclear why certain gems are being held back cause Gemfile
had no comment explaining it.

I tried to add some explanation from memory and remove some exceptions that
seemed to be superfluous.

This upgrades shoulda to latest, it appears to work once a couple of assertions
are removed

Also update http accept language used to auto detect language from http header
this is tested

Zeitwerk small update seems fine
This commit is contained in:
Sam Saffron 2019-12-06 13:00:16 +11:00
parent e4881290be
commit a06fccae1b
3 changed files with 42 additions and 31 deletions

48
Gemfile
View File

@ -14,8 +14,10 @@ if rails_master?
gem 'arel', git: 'https://github.com/rails/arel.git' gem 'arel', git: 'https://github.com/rails/arel.git'
gem 'rails', git: 'https://github.com/rails/rails.git' gem 'rails', git: 'https://github.com/rails/rails.git'
else else
# until rubygems gives us optional dependencies we are stuck with this # NOTE: Until rubygems gives us optional dependencies we are stuck with this needing to be explicit
# bundle update actionmailer actionpack actionview activemodel activerecord activesupport railties # this allows us to include the bits of rails we use without pieces we do not.
#
# To issue a rails update bump the version number here
gem 'actionmailer', '6.0.1' gem 'actionmailer', '6.0.1'
gem 'actionpack', '6.0.1' gem 'actionpack', '6.0.1'
gem 'actionview', '6.0.1' gem 'actionview', '6.0.1'
@ -36,18 +38,25 @@ gem 'mail', require: false
gem 'mini_mime' gem 'mini_mime'
gem 'mini_suffix' gem 'mini_suffix'
gem 'redis', '4.1.3' gem 'redis'
gem 'redis-namespace' gem 'redis-namespace'
# NOTE: AM serializer gets a lot slower with recent updates
# we used an old branch which is the fastest one out there
# are long term goal here is to fork this gem so we have a
# better maintained living fork
gem 'active_model_serializers', '~> 0.8.3' gem 'active_model_serializers', '~> 0.8.3'
gem 'onebox', '1.9.24' gem 'onebox'
gem 'http_accept_language', '~>2.0.5', require: false gem 'http_accept_language', require: false
# Ember related gems need to be pinned cause they control client side
# behavior, we will push these versions up when upgrading ember
gem 'ember-rails', '0.18.5' gem 'ember-rails', '0.18.5'
gem 'discourse-ember-source', '~> 3.10.0' gem 'discourse-ember-source', '~> 3.10.0'
gem 'ember-handlebars-template', '0.8.0' gem 'ember-handlebars-template', '0.8.0'
gem 'barber' gem 'barber'
gem 'message_bus' gem 'message_bus'
@ -66,7 +75,7 @@ gem 'aws-sdk-sns', require: false
gem 'excon', require: false gem 'excon', require: false
gem 'unf', require: false gem 'unf', require: false
gem 'email_reply_trimmer', '~> 0.1' gem 'email_reply_trimmer'
# Forked until https://github.com/toy/image_optim/pull/162 is merged # Forked until https://github.com/toy/image_optim/pull/162 is merged
# https://github.com/discourse/image_optim # https://github.com/discourse/image_optim
@ -92,7 +101,7 @@ gem 'oj'
gem 'pg' gem 'pg'
gem 'mini_sql' gem 'mini_sql'
gem 'pry-rails', require: false gem 'pry-rails', require: false
gem 'r2', '~> 0.2.5', require: false gem 'r2', require: false
gem 'rake' gem 'rake'
gem 'thor', require: false gem 'thor', require: false
@ -107,7 +116,10 @@ gem 'tilt', require: false
gem 'execjs', require: false gem 'execjs', require: false
gem 'mini_racer' gem 'mini_racer'
# TODO: determine why highline is being held back and upgrade to latest
gem 'highline', '~> 1.7.0', require: false gem 'highline', '~> 1.7.0', require: false
gem 'rack-protection' # security gem 'rack-protection' # security
gem 'cbor', require: false gem 'cbor', require: false
gem 'cose', require: false gem 'cose', require: false
@ -121,7 +133,7 @@ end
group :test do group :test do
gem 'webmock', require: false gem 'webmock', require: false
gem 'fakeweb', '~> 1.3.0', require: false gem 'fakeweb', require: false
gem 'minitest', require: false gem 'minitest', require: false
gem 'simplecov', require: false gem 'simplecov', require: false
gem "test-prof" gem "test-prof"
@ -136,9 +148,15 @@ group :test, :development do
gem 'fabrication', require: false gem 'fabrication', require: false
gem 'mocha', require: false gem 'mocha', require: false
gem 'rb-fsevent', require: RUBY_PLATFORM =~ /darwin/i ? 'rb-fsevent' : false gem 'rb-fsevent', require: RUBY_PLATFORM =~ /darwin/i ? 'rb-fsevent' : false
# TODO determine if we can update this to 0.10, API changes happened
# we would like to upgrade it if possible
gem 'rb-inotify', '~> 0.9', require: RUBY_PLATFORM =~ /linux/i ? 'rb-inotify' : false gem 'rb-inotify', '~> 0.9', require: RUBY_PLATFORM =~ /linux/i ? 'rb-inotify' : false
# TODO once 4.0.0 is released upgrade to it, at time of writing 3.9.0 is latest
gem 'rspec-rails', '4.0.0.beta2', require: false gem 'rspec-rails', '4.0.0.beta2', require: false
gem 'shoulda-matchers', '~> 3.1', '>= 3.1.3', require: false
gem 'shoulda-matchers', require: false
gem 'rspec-html-matchers' gem 'rspec-html-matchers'
gem 'pry-nav' gem 'pry-nav'
gem 'byebug', require: ENV['RM_INFO'].nil? gem 'byebug', require: ENV['RM_INFO'].nil?
@ -153,13 +171,7 @@ group :development do
gem 'better_errors' gem 'better_errors'
gem 'binding_of_caller' gem 'binding_of_caller'
gem 'yaml-lint' gem 'yaml-lint'
gem 'annotate'
# waiting on 2.7.5 per: https://github.com/ctran/annotate_models/pull/595
if rails_master?
gem 'annotate', git: 'https://github.com/ctran/annotate_models.git'
else
gem 'annotate'
end
end end
# this is an optional gem, it provides a high performance replacement # this is an optional gem, it provides a high performance replacement
@ -213,11 +225,13 @@ gem 'lz4-ruby', require: false, platform: :mri
if ENV["IMPORT"] == "1" if ENV["IMPORT"] == "1"
gem 'mysql2' gem 'mysql2'
gem 'redcarpet' gem 'redcarpet'
# NOTE: in import mode the version of sqlite can matter a lot, so we stick it to a specific one
gem 'sqlite3', '~> 1.3', '>= 1.3.13' gem 'sqlite3', '~> 1.3', '>= 1.3.13'
gem 'ruby-bbcode-to-md', git: 'https://github.com/nlalonde/ruby-bbcode-to-md' gem 'ruby-bbcode-to-md', git: 'https://github.com/nlalonde/ruby-bbcode-to-md'
gem 'reverse_markdown' gem 'reverse_markdown'
gem 'tiny_tds' gem 'tiny_tds'
gem 'csv', '~> 3.0' gem 'csv'
end end
gem 'webpush', require: false gem 'webpush', require: false

View File

@ -145,7 +145,7 @@ GEM
highline (1.7.10) highline (1.7.10)
hkdf (0.3.0) hkdf (0.3.0)
htmlentities (4.3.4) htmlentities (4.3.4)
http_accept_language (2.0.5) http_accept_language (2.1.1)
i18n (1.7.0) i18n (1.7.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
image_size (1.5.0) image_size (1.5.0)
@ -375,8 +375,8 @@ GEM
seed-fu (2.3.9) seed-fu (2.3.9)
activerecord (>= 3.1) activerecord (>= 3.1)
activesupport (>= 3.1) activesupport (>= 3.1)
shoulda-matchers (3.1.3) shoulda-matchers (4.1.2)
activesupport (>= 4.0.0) activesupport (>= 4.2.0)
sidekiq (5.2.7) sidekiq (5.2.7)
connection_pool (~> 2.2, >= 2.2.2) connection_pool (~> 2.2, >= 2.2.2)
rack (>= 1.5.0) rack (>= 1.5.0)
@ -420,7 +420,7 @@ GEM
hkdf (~> 0.2) hkdf (~> 0.2)
jwt (~> 2.0) jwt (~> 2.0)
yaml-lint (0.0.10) yaml-lint (0.0.10)
zeitwerk (2.2.1) zeitwerk (2.2.2)
PLATFORMS PLATFORMS
ruby ruby
@ -452,13 +452,13 @@ DEPENDENCIES
diffy diffy
discourse-ember-source (~> 3.10.0) discourse-ember-source (~> 3.10.0)
discourse_image_optim discourse_image_optim
email_reply_trimmer (~> 0.1) email_reply_trimmer
ember-handlebars-template (= 0.8.0) ember-handlebars-template (= 0.8.0)
ember-rails (= 0.18.5) ember-rails (= 0.18.5)
excon excon
execjs execjs
fabrication fabrication
fakeweb (~> 1.3.0) fakeweb
fast_blank fast_blank
fast_xor fast_xor
fast_xs fast_xs
@ -467,7 +467,7 @@ DEPENDENCIES
gc_tracer gc_tracer
highline (~> 1.7.0) highline (~> 1.7.0)
htmlentities htmlentities
http_accept_language (~> 2.0.5) http_accept_language
listen listen
lograge lograge
logstash-event logstash-event
@ -499,14 +499,14 @@ DEPENDENCIES
omniauth-oauth2 omniauth-oauth2
omniauth-openid omniauth-openid
omniauth-twitter omniauth-twitter
onebox (= 1.9.24) onebox
openid-redis-store openid-redis-store
parallel_tests parallel_tests
pg pg
pry-nav pry-nav
pry-rails pry-rails
puma puma
r2 (~> 0.2.5) r2
rack-mini-profiler rack-mini-profiler
rack-protection rack-protection
rails_multisite rails_multisite
@ -516,7 +516,7 @@ DEPENDENCIES
rb-inotify (~> 0.9) rb-inotify (~> 0.9)
rbtrace rbtrace
rchardet rchardet
redis (= 4.1.3) redis
redis-namespace redis-namespace
rinku rinku
rotp rotp
@ -534,7 +534,7 @@ DEPENDENCIES
sassc sassc
sassc-rails sassc-rails
seed-fu seed-fu
shoulda-matchers (~> 3.1, >= 3.1.3) shoulda-matchers
sidekiq sidekiq
simplecov simplecov
sprockets-rails sprockets-rails

View File

@ -7,9 +7,6 @@ describe PostReply do
fab!(:post) { Fabricate(:post, topic: topic) } fab!(:post) { Fabricate(:post, topic: topic) }
fab!(:other_post) { Fabricate(:post, topic: topic) } fab!(:other_post) { Fabricate(:post, topic: topic) }
it { is_expected.to belong_to :post }
it { is_expected.to belong_to :reply }
context "validation" do context "validation" do
it "should ensure that the posts belong in the same topic" do it "should ensure that the posts belong in the same topic" do
expect(PostReply.new(post: post, reply: other_post)).to be_valid expect(PostReply.new(post: post, reply: other_post)).to be_valid