From 14b90f57b2217e6b8a327bac5066ece57ce15d9e Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Wed, 12 Oct 2022 11:06:00 -0700 Subject: [PATCH 1/3] only install rubocop on ci with ruby 3.0+ We only run rubocop on 3.1 on the CI currently, making this change will allow rubocop to still be installed locally on any version, but prevent the CI from installing it on lower ruby versions --- newrelic_rpm.gemspec | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/newrelic_rpm.gemspec b/newrelic_rpm.gemspec index e552cec937..6b79868b54 100644 --- a/newrelic_rpm.gemspec +++ b/newrelic_rpm.gemspec @@ -54,10 +54,10 @@ https://github.com/newrelic/newrelic-ruby-agent/ s.add_development_dependency 'mocha', '~> 1.14.0' s.add_development_dependency 'pry' unless ENV['CI'] s.add_development_dependency 'rake', '12.3.3' - s.add_development_dependency 'rubocop' if RUBY_VERSION > '2.5.0' - s.add_development_dependency 'rubocop-minitest' if RUBY_VERSION > '2.5.0' - s.add_development_dependency 'rubocop-performance' if RUBY_VERSION > '2.5.0' - s.add_development_dependency 'rubocop-rake' if RUBY_VERSION > '2.5.0' + s.add_development_dependency 'rubocop' unless ENV['CI'] && RUBY_VERSION < '3.0.0' + s.add_development_dependency 'rubocop-minitest' unless ENV['CI'] && RUBY_VERSION < '3.0.0' + s.add_development_dependency 'rubocop-performance' unless ENV['CI'] && RUBY_VERSION < '3.0.0' + s.add_development_dependency 'rubocop-rake' unless ENV['CI'] && RUBY_VERSION < '3.0.0' s.add_development_dependency 'simplecov' if RUBY_VERSION >= '2.7.0' s.add_development_dependency 'thor' s.add_development_dependency 'yard' From d723565c9bf94ab0aa94f926bbbbad36215d0a4b Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Wed, 12 Oct 2022 11:08:21 -0700 Subject: [PATCH 2/3] only install yard and thor when running locally --- newrelic_rpm.gemspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newrelic_rpm.gemspec b/newrelic_rpm.gemspec index 6b79868b54..982192bc28 100644 --- a/newrelic_rpm.gemspec +++ b/newrelic_rpm.gemspec @@ -59,6 +59,6 @@ https://github.com/newrelic/newrelic-ruby-agent/ s.add_development_dependency 'rubocop-performance' unless ENV['CI'] && RUBY_VERSION < '3.0.0' s.add_development_dependency 'rubocop-rake' unless ENV['CI'] && RUBY_VERSION < '3.0.0' s.add_development_dependency 'simplecov' if RUBY_VERSION >= '2.7.0' - s.add_development_dependency 'thor' - s.add_development_dependency 'yard' + s.add_development_dependency 'thor' unless ENV['CI'] + s.add_development_dependency 'yard' unless ENV['CI'] end From e5aa640856546db4c900bbb17ea657726dab064f Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Wed, 12 Oct 2022 11:31:16 -0700 Subject: [PATCH 3/3] Limit yard version based on ruby version Install yard 0.9.26 when on 2.2, but install latest when on any other ruby version --- newrelic_rpm.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newrelic_rpm.gemspec b/newrelic_rpm.gemspec index 982192bc28..1a1b8cc089 100644 --- a/newrelic_rpm.gemspec +++ b/newrelic_rpm.gemspec @@ -60,5 +60,5 @@ https://github.com/newrelic/newrelic-ruby-agent/ s.add_development_dependency 'rubocop-rake' unless ENV['CI'] && RUBY_VERSION < '3.0.0' s.add_development_dependency 'simplecov' if RUBY_VERSION >= '2.7.0' s.add_development_dependency 'thor' unless ENV['CI'] - s.add_development_dependency 'yard' unless ENV['CI'] + s.add_development_dependency 'yard', "#{RUBY_VERSION < '2.3.0' ? '0.9.26' : '> 0.9.26'}" end