Skip to content

Commit

Permalink
Remove rbx (Rubinius) and 1.8.x pinned dependencies (#64)
Browse files Browse the repository at this point in the history
* Remove rbx (Rubinius) and 1.8.x pinned dependencies

* Update travis.yml branch to main
  • Loading branch information
ms-ati committed Feb 9, 2021
1 parent d6cae50 commit a6253f6
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 50 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -2,7 +2,7 @@ language: ruby

branches:
only:
- master
- main

rvm:
# MRI
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Expand Up @@ -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
Expand Down
19 changes: 4 additions & 15 deletions docile.gemspec
Expand Up @@ -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"
Expand Down
12 changes: 0 additions & 12 deletions on_what.rb
Expand Up @@ -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
Expand Down
40 changes: 19 additions & 21 deletions spec/spec_helper.rb
@@ -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
# 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

# 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"
# 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"

0 comments on commit a6253f6

Please sign in to comment.