summaryrefslogtreecommitdiff
path: root/lib/ohai/mixin
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2017-06-20 11:29:39 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2017-06-20 11:29:39 -0700
commit97eae99ee6518ab5f3be894448b502fd45266fe2 (patch)
tree3527d9ab2a16ce7ef0d28eb3f01f681bd8416722 /lib/ohai/mixin
parentf1eddc9cf42c77b51d3e5150c2b2b3d34197b615 (diff)
downloadohai-97eae99ee6518ab5f3be894448b502fd45266fe2.tar.gz
autofixing cops for 0.5.0
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
Diffstat (limited to 'lib/ohai/mixin')
-rw-r--r--lib/ohai/mixin/command.rb6
-rw-r--r--lib/ohai/mixin/dmi_decode.rb2
-rw-r--r--lib/ohai/mixin/os.rb22
-rw-r--r--lib/ohai/mixin/string.rb2
4 files changed, 16 insertions, 16 deletions
diff --git a/lib/ohai/mixin/command.rb b/lib/ohai/mixin/command.rb
index 01a00edc..a6105ba0 100644
--- a/lib/ohai/mixin/command.rb
+++ b/lib/ohai/mixin/command.rb
@@ -37,13 +37,13 @@ module Ohai
so = Mixlib::ShellOut.new(cmd, options)
begin
so.run_command
- Ohai::Log.debug("Plugin #{self.name}: ran '#{cmd}' and returned #{so.exitstatus}")
+ Ohai::Log.debug("Plugin #{name}: ran '#{cmd}' and returned #{so.exitstatus}")
so
rescue Errno::ENOENT => e
- Ohai::Log.debug("Plugin #{self.name}: ran '#{cmd}' and failed #{e.inspect}")
+ Ohai::Log.debug("Plugin #{name}: ran '#{cmd}' and failed #{e.inspect}")
raise Ohai::Exceptions::Exec, e
rescue Mixlib::ShellOut::CommandTimeout => e
- Ohai::Log.debug("Plugin #{self.name}: ran '#{cmd}' and timed out after #{options[:timeout]} seconds")
+ Ohai::Log.debug("Plugin #{name}: ran '#{cmd}' and timed out after #{options[:timeout]} seconds")
raise Ohai::Exceptions::Exec, e
end
end
diff --git a/lib/ohai/mixin/dmi_decode.rb b/lib/ohai/mixin/dmi_decode.rb
index 64be3371..971911c8 100644
--- a/lib/ohai/mixin/dmi_decode.rb
+++ b/lib/ohai/mixin/dmi_decode.rb
@@ -46,6 +46,6 @@ module ::Ohai::Mixin::DmiDecode
return "veertu"
end
end
- return nil
+ nil
end
end
diff --git a/lib/ohai/mixin/os.rb b/lib/ohai/mixin/os.rb
index 83cdc34e..b8222596 100644
--- a/lib/ohai/mixin/os.rb
+++ b/lib/ohai/mixin/os.rb
@@ -26,32 +26,32 @@ module Ohai
def collect_os
case ::RbConfig::CONFIG["host_os"]
when /aix(.+)$/
- return "aix"
+ "aix"
when /darwin(.+)$/
- return "darwin"
+ "darwin"
when /hpux(.+)$/
- return "hpux"
+ "hpux"
when /linux/
- return "linux"
+ "linux"
when /freebsd(.+)$/
- return "freebsd"
+ "freebsd"
when /openbsd(.+)$/
- return "openbsd"
+ "openbsd"
when /netbsd(.*)$/
- return "netbsd"
+ "netbsd"
when /dragonfly(.*)$/
- return "dragonflybsd"
+ "dragonflybsd"
when /solaris2/
- return "solaris2"
+ "solaris2"
when /mswin|mingw32|windows/
# After long discussion in IRC the "powers that be" have come to a consensus
# that no Windows platform exists that was not based on the
# Windows_NT kernel, so we herby decree that "windows" will refer to all
# platforms built upon the Windows_NT kernel and have access to win32 or win64
# subsystems.
- return "windows"
+ "windows"
else
- return ::RbConfig::CONFIG["host_os"]
+ ::RbConfig::CONFIG["host_os"]
end
end
diff --git a/lib/ohai/mixin/string.rb b/lib/ohai/mixin/string.rb
index 48830a36..a10fab2b 100644
--- a/lib/ohai/mixin/string.rb
+++ b/lib/ohai/mixin/string.rb
@@ -23,7 +23,7 @@ class String
# This should implement the same functionality as underscore method in
# ActiveSupport::CoreExtensions::String::Inflections
def wmi_underscore
- self.gsub(/::/, "/").gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
+ gsub(/::/, "/").gsub(/([A-Z]+)([A-Z][a-z])/, '\1_\2').
gsub(/([a-z\d])([A-Z])/, '\1_\2').tr("-", "_").downcase
end
end