summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2020-09-08 12:49:38 -0700
committerGitHub <noreply@github.com>2020-09-08 12:49:38 -0700
commit7eadadc4fbd63837738df9dcda6a0bb4b1c30f84 (patch)
tree4c028eaed15924360f5e9fa144eec7f86ac4b5a4
parent12572db2f1639cd1675daeacfbcb444518b21d22 (diff)
parent813180ea8e046476a08f0c13c6a520c98bc5560d (diff)
downloadohai-7eadadc4fbd63837738df9dcda6a0bb4b1c30f84.tar.gz
Merge pull request #1506 from chef/dependabot/bundler/rubocop-performance-1.8.0
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r--.rubocop.yml4
-rw-r--r--Gemfile2
-rw-r--r--lib/ohai/plugins/linode.rb2
-rw-r--r--spec/support/platform_helpers.rb12
4 files changed, 6 insertions, 14 deletions
diff --git a/.rubocop.yml b/.rubocop.yml
index 425a9e8c..9f82e5e8 100644
--- a/.rubocop.yml
+++ b/.rubocop.yml
@@ -1,6 +1,7 @@
require: rubocop-performance
AllCops:
+ NewCops: enable
TargetRubyVersion: 2.5
Exclude:
- "spec/data/**/*"
@@ -14,4 +15,7 @@ Layout/IndentationStyle:
- "lib/ohai/plugins/darwin/hardware.rb"
Performance/Caller:
+ Enabled: false
+
+Performance/CollectionLiteralInLoop:
Enabled: false \ No newline at end of file
diff --git a/Gemfile b/Gemfile
index d6ab3750..aadd5e4d 100644
--- a/Gemfile
+++ b/Gemfile
@@ -5,7 +5,7 @@ gemspec
# NOTE: do not submit PRs to add pry as a dep, add to your Gemfile.local
group :development do
gem "chefstyle", git: "https://github.com/chef/chefstyle.git", branch: "master"
- gem "rubocop-performance", "1.7.1"
+ gem "rubocop-performance", "1.8.0"
gem "rake", ">= 10.1.0"
gem "rspec-core", "~> 3.0"
gem "rspec-expectations", "~> 3.0"
diff --git a/lib/ohai/plugins/linode.rb b/lib/ohai/plugins/linode.rb
index 64e8a62f..60cdb210 100644
--- a/lib/ohai/plugins/linode.rb
+++ b/lib/ohai/plugins/linode.rb
@@ -25,7 +25,7 @@ Ohai.plugin(:Linode) do
# Returns true or false
def has_linode_kernel?
if ( kernel_data = kernel )
- kernel_data[:release].split("-").last =~ /linode/
+ kernel_data[:release].split("-").last.include?("linode")
end
end
diff --git a/spec/support/platform_helpers.rb b/spec/support/platform_helpers.rb
index 2a531883..01df9626 100644
--- a/spec/support/platform_helpers.rb
+++ b/spec/support/platform_helpers.rb
@@ -23,16 +23,4 @@ def unix?
!windows?
end
-def os_x?
- !!(RUBY_PLATFORM =~ /darwin/)
-end
-
-def solaris?
- !!(RUBY_PLATFORM =~ /solaris/)
-end
-
-def freebsd?
- !!(RUBY_PLATFORM =~ /freebsd/)
-end
-
DEV_NULL = windows? ? "NUL" : "/dev/null"