Skip to content

Commit

Permalink
Merge #2972
Browse files Browse the repository at this point in the history
2972: Remove 1.8.7 leftovers r=bronzdoc a=deivid-rodriguez

# Description:

Cleanup some leftover code from ruby 1.8.7 times.

# Tasks:

- [x] Describe the problem / feature
- [ ] Write tests
- [x] Write code to solve the problem
- [ ] Get code review from coworkers / friends

I will abide by the [code of conduct](https://github.com/rubygems/rubygems/blob/master/CODE_OF_CONDUCT.md).


Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
  • Loading branch information
2 people authored and hsbt committed Dec 13, 2019
1 parent 9a67b0a commit 428672f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
18 changes: 4 additions & 14 deletions lib/rubygems.rb
Expand Up @@ -160,24 +160,14 @@ module Gem
].freeze

##
# Exception classes used in a Gem.read_binary +rescue+ statement. Not all of
# these are defined in Ruby 1.8.7, hence the need for this convoluted setup.
# Exception classes used in a Gem.read_binary +rescue+ statement

READ_BINARY_ERRORS = begin
read_binary_errors = [Errno::EACCES, Errno::EROFS, Errno::ENOSYS]
read_binary_errors << Errno::ENOTSUP if Errno.const_defined?(:ENOTSUP)
read_binary_errors
end.freeze
READ_BINARY_ERRORS = [Errno::EACCES, Errno::EROFS, Errno::ENOSYS, Errno::ENOTSUP].freeze

##
# Exception classes used in Gem.write_binary +rescue+ statement. Not all of
# these are defined in Ruby 1.8.7.
# Exception classes used in Gem.write_binary +rescue+ statement

WRITE_BINARY_ERRORS = begin
write_binary_errors = [Errno::ENOSYS]
write_binary_errors << Errno::ENOTSUP if Errno.const_defined?(:ENOTSUP)
write_binary_errors
end.freeze
WRITE_BINARY_ERRORS = [Errno::ENOSYS, Errno::ENOTSUP].freeze

@@win_platform = nil

Expand Down
2 changes: 1 addition & 1 deletion lib/rubygems/commands/setup_command.rb
Expand Up @@ -98,7 +98,7 @@ def initialize
end

def check_ruby_version
required_version = Gem::Requirement.new '>= 1.8.7'
required_version = Gem::Requirement.new '>= 2.3.0'

unless required_version.satisfied_by? Gem.ruby_version
alert_error "Expected Ruby version #{required_version}, is #{Gem.ruby_version}"
Expand Down
7 changes: 1 addition & 6 deletions test/rubygems/test_gem_commands_help_command.rb
Expand Up @@ -4,20 +4,15 @@
require "rubygems/commands/help_command"
require "rubygems/package"
require "rubygems/command_manager"
require File.expand_path('../rubygems_plugin', __FILE__)

class TestGemCommandsHelpCommand < Gem::TestCase

# previously this was calc'd in setup, but 1.8.7 had
# intermittent failures, but no issues with above require
PLUGIN = File.expand_path('../rubygems_plugin.rb', __FILE__)

def setup
super

@cmd = Gem::Commands::HelpCommand.new

load PLUGIN unless Gem::Commands.const_defined? :InterruptCommand
load File.expand_path('../rubygems_plugin.rb', __FILE__) unless Gem::Commands.const_defined? :InterruptCommand
end

def test_gem_help_bad
Expand Down

0 comments on commit 428672f

Please sign in to comment.