Skip to content

Commit

Permalink
Removed needless condition for old versions of Ruby.
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed May 11, 2018
1 parent faacaeb commit 55f536f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 35 deletions.
30 changes: 1 addition & 29 deletions Rakefile
Expand Up @@ -20,38 +20,10 @@ task :setup => ["bundler:checkout"] do
end

Rake::TestTask.new do |t|
# For old rubygems with default bundler gemspec
if "1.8" < RUBY_VERSION && RUBY_VERSION < "2.2"
module Gem
@path_to_default_spec_map.delete_if do |_path, spec|
spec.name == "bundler"
end
end
end

# For ruby < 2.0, minitest files need to copied into repo lib folder
if RUBY_VERSION < '2.0'
require 'fileutils'
dest = File.dirname(__FILE__)
src_dir = Dir.glob("#{Gem.default_dir}/gems/minitest-*").sort
if (src = src_dir.last)
Dir.mkdir "#{dest}/lib/minitest" unless Dir.exist? "#{dest}/lib/minitest"
IO.copy_stream "#{src}/lib/minitest.rb", "#{dest}/lib/minitest.rb"
FileUtils.cp_r "#{src}/lib/minitest/.", "#{dest}/lib/minitest/"
end
end

# no --disable-gems option
if RUBY_VERSION < "1.9"
t.ruby_opts = %w[-I"bundler/lib" -r./lib/rubygems]
else
t.ruby_opts = %w[--disable-gems]
end

t.ruby_opts = %w[--disable-gems]
t.ruby_opts << '-rdevkit' if Gem.win_platform?

t.libs << "test"

t.libs << "bundler/lib"

t.test_files = FileList['test/**/test_*.rb']
Expand Down
7 changes: 1 addition & 6 deletions setup.rb
Expand Up @@ -6,11 +6,6 @@
# See LICENSE.txt for permissions.
#++

if RUBY_VERSION < "1.8.7"
$stderr.puts "RubyGems now requires Ruby 1.8.7 or later"
exit 1
end

# Make sure rubygems isn't already loaded.
if ENV['RUBYOPT'] or defined? Gem then
ENV.delete 'RUBYOPT'
Expand All @@ -22,7 +17,7 @@
ruby << config::CONFIG['EXEEXT']

cmd = [ruby, 'setup.rb', *ARGV].compact
cmd[1,0] = "--disable-gems" if RUBY_VERSION > "1.9"
cmd[1,0] = "--disable-gems"

exec(*cmd)
end
Expand Down

0 comments on commit 55f536f

Please sign in to comment.