remove more instances of positive?

bug/bundler_fix
Brent Cook 2017-08-02 12:47:34 -05:00
parent 6f97e45b35
commit 24d323d4ed
6 changed files with 14 additions and 14 deletions

View File

@ -33,7 +33,7 @@ module UDS
end end
left2combine = hash["Packets"].size left2combine = hash["Packets"].size
counter = 0 counter = 0
while left2combine.positive? && (bad_count < (hash["Packets"].size * 2)) while left2combine > 0 && (bad_count < (hash["Packets"].size * 2))
# print_line("DEBUG Current status combine=#{left2combine} data=#{data.inspect}") # print_line("DEBUG Current status combine=#{left2combine} data=#{data.inspect}")
hash["Packets"].each do |pkt| hash["Packets"].each do |pkt|
if (pkt.key? "ID") && pkt["ID"].hex == id.hex if (pkt.key? "ID") && pkt["ID"].hex == id.hex

View File

@ -269,7 +269,7 @@ class Console::CommandDispatcher::Automotive
return return
end end
if id.blank? && !stop if id.blank? && !stop
if self.tpjobs.size.positive? if self.tpjobs.size > 0
print_line("TesterPresent is currently active") print_line("TesterPresent is currently active")
self.tpjobs.each_index do |jid| self.tpjobs.each_index do |jid|
if self.tpjobs[jid] if self.tpjobs[jid]

View File

@ -185,7 +185,7 @@ class Console::CommandDispatcher::Core
if mod if mod
print_line(::Msf::Serializer::ReadableText.dump_module(mod)) print_line(::Msf::Serializer::ReadableText.dump_module(mod))
mod_opt = ::Msf::Serializer::ReadableText.dump_options(mod, ' ') mod_opt = ::Msf::Serializer::ReadableText.dump_options(mod, ' ')
print_line("\nModule options (#{mod.fullname}):\n\n#{mod_opt}") if mod_opt && mod_opt.length.positive? print_line("\nModule options (#{mod.fullname}):\n\n#{mod_opt}") if mod_opt && mod_opt.length > 0
end end
end end
@ -204,7 +204,7 @@ class Console::CommandDispatcher::Core
# Get the HW bridge devices status # Get the HW bridge devices status
# #
def cmd_status(*args) def cmd_status(*args)
if args.length.positive? if args.length > 0
cmd_status_help cmd_status_help
return true return true
end end
@ -235,7 +235,7 @@ class Console::CommandDispatcher::Core
# Get the Hardware specialty # Get the Hardware specialty
# #
def cmd_specialty(*args) def cmd_specialty(*args)
if args.length.positive? if args.length > 0
cmd_specialty_help cmd_specialty_help
return true return true
end end
@ -251,7 +251,7 @@ class Console::CommandDispatcher::Core
# Performs a device reset or factory reset # Performs a device reset or factory reset
# #
def cmd_reset(*args) def cmd_reset(*args)
if args.length.positive? if args.length > 0
cmd_reset_help cmd_reset_help
return return
end end
@ -268,7 +268,7 @@ class Console::CommandDispatcher::Core
# Perform a device reboot # Perform a device reboot
# #
def cmd_reboot(*args) def cmd_reboot(*args)
if args.length.positive? if args.length > 0
cmd_reboot_help cmd_reboot_help
return return
end end
@ -286,7 +286,7 @@ class Console::CommandDispatcher::Core
# Loads custom methods if any exist # Loads custom methods if any exist
# #
def cmd_load_custom_methods(*args) def cmd_load_custom_methods(*args)
if args.length.positive? if args.length > 0
cmd_load_custom_methods_help cmd_load_custom_methods_help
return true return true
end end

View File

@ -49,7 +49,7 @@ class Console::CommandDispatcher::RFtransceiver
return return
end end
indexes = indexes['indexes'] indexes = indexes['indexes']
unless indexes.size.positive? unless indexes.size > 0
print_line('none') print_line('none')
return return
end end
@ -535,7 +535,7 @@ class Console::CommandDispatcher::RFtransceiver
def cmd_lowball(*args) def cmd_lowball(*args)
self.idx ||= 0 self.idx ||= 0
if args.length.positive? if args.length > 0
cmd_lowball_help cmd_lowball_help
return return
end end
@ -552,7 +552,7 @@ class Console::CommandDispatcher::RFtransceiver
# #
def cmd_maxpower(*args) def cmd_maxpower(*args)
self.idx ||= 0 self.idx ||= 0
if args.length.positive? if args.length > 0
cmd_maxpower_help cmd_maxpower_help
return return
end end

View File

@ -44,7 +44,7 @@ class Console::CommandDispatcher::Zigbee
return return
end end
devices = devices["devices"] devices = devices["devices"]
unless devices.size.positive? unless devices.size > 0
print_line("none") print_line("none")
return return
end end

View File

@ -124,7 +124,7 @@ module Msf
group = "default" group = "default"
if (@host && @host.length.positive?) && (@port && @port.length.positive? && @port.to_i > 0) if (@host && @host.length > 0) && (@port && @port.length > 0 && @port.to_i > 0)
config = { "#{group}" => { 'server' => @host, 'port' => @port } } config = { "#{group}" => { 'server' => @host, 'port' => @port } }
::File.open("#{Aggregator_yaml}", "wb") { |f| f.puts YAML.dump(config) } ::File.open("#{Aggregator_yaml}", "wb") { |f| f.puts YAML.dump(config) }
print_good("#{Aggregator_yaml} created.") print_good("#{Aggregator_yaml} created.")
@ -376,7 +376,7 @@ module Msf
def aggregator_login def aggregator_login
if !((@host && @host.length.positive?) && (@port && @port.length.positive? && @port.to_i > 0)) if !((@host && @host.length > 0) && (@port && @port.length > 0 && @port.to_i > 0))
usage_connect usage_connect
return return
end end