diff --git a/.travis.yml b/.travis.yml index c53d44f..4632b02 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,7 +2,7 @@ language: ruby branches: only: - - master + - main rvm: # MRI diff --git a/Gemfile b/Gemfile index 9d71912..7eccca4 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/docile.gemspec b/docile.gemspec index 965a9f8..b625f50 100644 --- a/docile.gemspec +++ b/docile.gemspec @@ -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" diff --git a/on_what.rb b/on_what.rb index 60a1794..aa05269 100644 --- a/on_what.rb +++ b/on_what.rb @@ -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 diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index e6e68eb..027ab20 100644 --- a/spec/spec_helper.rb +++ b/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"