From 26c0cd0871753dd02c78ca4fbad22d3db3c8e13b Mon Sep 17 00:00:00 2001 From: Dominik Richter Date: Sun, 3 Jan 2016 09:49:40 +0100 Subject: [PATCH] lint --- lib/resources/file.rb | 2 +- lib/resources/mount.rb | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/resources/file.rb b/lib/resources/file.rb index 17dd2e211..0e7687acc 100644 --- a/lib/resources/file.rb +++ b/lib/resources/file.rb @@ -5,7 +5,7 @@ # license: All rights reserved module Inspec::Resources - class File < Inspec.resource(1) + class File < Inspec.resource(1) # rubocop:disable Metrics/ClassLength name 'file' desc 'Use the file InSpec audit resource to test all system file types, including files, directories, symbolic links, named pipes, sockets, character devices, block devices, and doors.' example " diff --git a/lib/resources/mount.rb b/lib/resources/mount.rb index 44519ac50..8be324ad5 100644 --- a/lib/resources/mount.rb +++ b/lib/resources/mount.rb @@ -32,12 +32,8 @@ class Mount < Inspec.resource(1) def count mounted = file.mounted - - if !mounted.nil? && !mounted.stdout.nil? && !mounted.stdout.lines.nil? - mounted.stdout.lines.count - else - nil - end + return nil if mounted.nil? || mounted.stdout.nil? + mounted.stdout.lines.count end def method_missing(name)