Skip to content

Commit bf9b013

Browse files
committed
Clean up odd code
1 parent 71df231 commit bf9b013

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

lib/msf/core/modules/loader/directory.rb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ class Msf::Modules::Loader::Directory < Msf::Modules::Loader::Base
1111
# @return [true] if path is a directory
1212
# @return [false] otherwise
1313
def loadable?(path)
14-
if File.directory?(path)
15-
true
16-
else
17-
false
18-
end
14+
File.directory?(path)
1915
end
2016

2117
protected
@@ -35,8 +31,7 @@ def each_module_reference_name(path, opts={})
3531
full_entry_path = ::File.join(path, entry)
3632
type = entry.singularize
3733

38-
unless ::File.directory?(full_entry_path) and
39-
module_manager.type_enabled? type
34+
unless ::File.directory?(full_entry_path) && module_manager.type_enabled?(type)
4035
next
4136
end
4237

lib/msf/core/modules/loader/executable.rb

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ class Msf::Modules::Loader::Executable < Msf::Modules::Loader::Base
1111
# @return [true] if path is a directory
1212
# @return [false] otherwise
1313
def loadable?(path)
14-
if File.directory?(path)
15-
true
16-
else
17-
false
18-
end
14+
File.directory?(path)
1915
end
2016

2117
protected
@@ -35,8 +31,7 @@ def each_module_reference_name(path, opts={})
3531
full_entry_path = ::File.join(path, entry)
3632
type = entry.singularize
3733

38-
unless ::File.directory?(full_entry_path) and
39-
module_manager.type_enabled? type
34+
unless ::File.directory?(full_entry_path) && module_manager.type_enabled?(type)
4035
next
4136
end
4237

0 commit comments

Comments
 (0)