Remove rbx (Rubinius) and 1.8.x pinned dependencies (#64)

* Remove rbx (Rubinius) and 1.8.x pinned dependencies

* Update travis.yml branch to main
This commit is contained in:
Marc Siegel 2021-02-09 11:25:38 -05:00 committed by GitHub
parent d6cae505ee
commit a6253f63e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 51 deletions

View File

@ -2,7 +2,7 @@ language: ruby
branches:
only:
- master
- main
rvm:
# MRI

View File

@ -2,7 +2,7 @@ require File.expand_path("on_what", File.dirname(__FILE__))
source "https://rubygems.org"
# Travis-only dependencies go here
if on_travis? && !on_less_than_2_3? && !on_rubinius?
if on_travis? && !on_less_than_2_3?
group :test do
gem "codecov", ">= 0.0.9", :require => false
end

View File

@ -25,27 +25,16 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
# Specify oldest supported Ruby version
s.required_ruby_version = ">= 1.8.7"
s.required_ruby_version = ">= 1.9.3"
# Run rspec tests from rake even on old Ruby versions
s.add_development_dependency "rake", "~> 10.5" if on_less_than_1_9_3? # Pin compatible rake on old rubies, see: https://github.com/travis-ci/travis.rb/issues/380
s.add_development_dependency "rake", "< 11.0" unless on_less_than_1_9_3? # See http://stackoverflow.com/questions/35893584/nomethoderror-undefined-method-last-comment-after-upgrading-to-rake-11
s.add_development_dependency "rake", "< 11.0" # See http://stackoverflow.com/questions/35893584/nomethoderror-undefined-method-last-comment-after-upgrading-to-rake-11
s.add_development_dependency "rspec", "~> 3.0"
s.add_development_dependency "rspec-expectations", "!= 3.8.3" # Workaround for RSpec's issue, see: https://github.com/rspec/rspec-expectations/issues/1111
# Run code coverage where possible - not on Rubinius
unless on_rubinius?
# Pin versions for Travis builds on 1.9
s.add_development_dependency "json", "< 2.0" if on_less_than_2_0?
# Pin versions for Travis builds on 1.8
s.add_development_dependency "mime-types" , "~> 1.25.1" if on_1_8?
s.add_development_dependency "rest-client", "~> 1.6.8" if on_1_8?
end
# To limit needed compatibility with versions of dependencies, only configure
# yard doc generation when *not* on Travis, JRuby, Rubinius, or < 2.0
if !on_travis? && !on_jruby? && !on_rubinius? && !on_less_than_2_0?
# yard doc generation when *not* on Travis, JRuby, or < 2.3
if !on_travis? && !on_jruby? && !on_less_than_2_3?
# Github flavored markdown in YARD documentation
# http://blog.nikosd.com/2011/11/github-flavored-markdown-in-yard.html
s.add_development_dependency "yard"

View File

@ -9,18 +9,6 @@ def on_jruby?
defined?(RUBY_ENGINE) && "jruby" == RUBY_ENGINE
end
def on_rubinius?
defined?(RUBY_ENGINE) && "rbx" == RUBY_ENGINE
end
def on_1_8?
RUBY_VERSION.start_with? "1.8"
end
def on_less_than_1_9_3?
RUBY_VERSION < "1.9.3"
end
def on_less_than_2_0?
RUBY_VERSION < "2.0.0"
end

View File

@ -1,31 +1,29 @@
require File.expand_path("on_what", File.dirname(File.dirname(__FILE__)))
# Code coverage (via SimpleCov) on Ruby 1.9+
unless on_1_8?
begin
require "simplecov"
SimpleCov.start do
add_filter "/spec/" # exclude test code
add_filter "/vendor/" # exclude gems which are vendored on Travis CI
add_filter "/on_what.rb" # exclude help used only in gemspec
end
# On CI we publish simplecov results to codecov.io
if on_travis?
require "codecov"
SimpleCov.formatter = SimpleCov::Formatter::Codecov
end
# Due to circular dependency (simplecov depends on docile), remove docile and require again below
Object.send(:remove_const, :Docile)
$LOADED_FEATURES.reject! { |f| f =~ /\/docile\// }
rescue LoadError
warn "warning: simplecov or codecov gems not found; skipping coverage"
# Code coverage (via SimpleCov)
begin
require "simplecov"
SimpleCov.start do
add_filter "/spec/" # exclude test code
add_filter "/vendor/" # exclude gems which are vendored on Travis CI
add_filter "/on_what.rb" # exclude help used only in gemspec
end
# On CI we publish simplecov results to codecov.io
if on_travis?
require "codecov"
SimpleCov.formatter = SimpleCov::Formatter::Codecov
end
# Due to circular dependency (simplecov depends on docile), remove docile and require again below
Object.send(:remove_const, :Docile)
$LOADED_FEATURES.reject! { |f| f =~ /\/docile\// }
rescue LoadError
warn "warning: simplecov or codecov gems not found; skipping coverage"
end
lib_dir = File.join(File.dirname(File.dirname(__FILE__)), "lib")
$LOAD_PATH.unshift lib_dir unless $LOAD_PATH.include? lib_dir
# Require Docile again, now with coverage enabled on 1.9+
# Require Docile again, now with coverage enabled
require "docile"