From bc7c1e411cd0b7b500d1c9707780551f43907034 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 9 Nov 2018 18:24:58 +1100 Subject: [PATCH] DEV: Ruby 2.5.1 is no longer supported with Discourse This removes a monkey patch we no longer need since our containers require 2.5.2 or up for all Discourse installs. If you are looking to deploy on 2.5.1 which is highly not recommended you will need to figure out how to apply this diff. --- lib/freedom_patches/net.rb | 49 -------------------------------------- 1 file changed, 49 deletions(-) delete mode 100644 lib/freedom_patches/net.rb diff --git a/lib/freedom_patches/net.rb b/lib/freedom_patches/net.rb deleted file mode 100644 index 136ebea124b..00000000000 --- a/lib/freedom_patches/net.rb +++ /dev/null @@ -1,49 +0,0 @@ -if Gem::Version.new(RUBY_VERSION) == Gem::Version.new("2.5.1") - require 'net/pop' - - module Net - class POP3 - def inspect - +"#<#{self.class} #{@address}:#{@port} open=#{@started}>" - end - end - - class POPMail - def inspect - +"#<#{self.class} #{@number}#{@deleted ? ' deleted' : ''}>" - end - - def pop(dest = +'', &block) # :yield: message_chunk - if block_given? - @command.retr(@number, &block) - nil - else - @command.retr(@number) do |chunk| - dest << chunk - end - dest - end - end - - def top(lines, dest = +'') - @command.top(@number, lines) do |chunk| - dest << chunk - end - dest - end - - def header(dest = +'') - top(0, dest) - end - end - - class POP3Command - def inspect - +"#<#{self.class} socket=#{@socket}>" - end - end - end -elsif Gem::Version.new(RUBY_VERSION) > Gem::Version.new("2.5.1") - # See https://github.com/ruby/ruby/commit/7830a950efa6d312e7c662beabaa0f8d7b4e0a23 - STDERR.puts 'This monkey patch is no longer required.' -end