Land #4848, remove some reliance on rails libraries from rex

bug/bundler_fix
Brent Cook 2016-03-07 07:38:30 -06:00
commit 289f43bb80
No known key found for this signature in database
GPG Key ID: 1FFAA0B24B708F96
12 changed files with 16 additions and 16 deletions

View File

@ -27,7 +27,7 @@ class Memory
def self.heaplib2(custom_js='', opts={})
js = ::File.read(::File.join(Msf::Config.data_directory, "js", "memory", "heaplib2.js"))
unless custom_js.blank?
unless custom_js.to_s.empty?
js << custom_js
end

View File

@ -126,7 +126,7 @@ class Message
header_string = self.header.to_s
msg = header_string.empty? ? '' : force_crlf(self.header.to_s + "\r\n")
msg << force_crlf(self.content + "\r\n") unless self.content.blank?
msg << force_crlf(self.content + "\r\n") unless self.content.to_s.empty?
self.parts.each do |part|
msg << force_crlf("--" + self.bound + "\r\n")

View File

@ -195,7 +195,7 @@ module Rex
res_header = Rex::Proto::Http::Packet::Header.new
req_header.from_s request_headers.lstrip
res_header.from_s response_headers.lstrip
if response_body.blank?
if response_body.to_s.empty?
response_body = ''
end
@state[:request_headers] = req_header

View File

@ -59,7 +59,7 @@ module Parser
unless in_tag("JobOrder")
case name
when "OS"
unless @host.nil? or @text.blank?
unless @host.nil? or @text.to_s.empty?
tnote = {
:type => "host.os.fusionvm_fingerprint",
:data => { :os => @text.strip },
@ -86,7 +86,7 @@ module Parser
when "CVE"
@vuln[:refs] << "CVE-#{@text.strip}"
when "References"
unless @text.blank?
unless @text.to_s.empty?
@text.split(' ').each do |ref|
next unless ref.start_with? "http"
if ref =~ /MS\d{2}-\d{3}/

View File

@ -469,7 +469,7 @@ class ClientCore < Extension
end
if client.platform =~ /linux/
if writable_dir.blank?
if writable_dir.to_s.empty?
writable_dir = tmp_folder
end
@ -752,7 +752,7 @@ class ClientCore < Extension
def tmp_folder
tmp = client.sys.config.getenv('TMPDIR')
if tmp.blank?
if tmp.to_s.empty?
tmp = '/tmp'
end

View File

@ -31,7 +31,7 @@ class Wmi
def query(query, root = nil)
request = Packet.create_request('extapi_wmi_query')
request.add_tlv(TLV_TYPE_EXT_WMI_DOMAIN, root) unless root.blank?
request.add_tlv(TLV_TYPE_EXT_WMI_DOMAIN, root) unless root.to_s.empty?
request.add_tlv(TLV_TYPE_EXT_WMI_QUERY, query)
response = client.send_request(request)

View File

@ -66,7 +66,7 @@ class Webcam
remote_browser_path = webrtc_browser_path
if remote_browser_path.blank?
if remote_browser_path.to_s.empty?
fail "Unable to find a suitable browser on the target machine"
end

View File

@ -491,7 +491,7 @@ class Console::CommandDispatcher::Android
end
end
if dest.blank? || body.blank?
if dest.to_s.empty? || body.to_s.empty?
print_error("You must enter both a destination address -d and the SMS text body -t")
print_error('e.g. send_sms -d +351961234567 -t "GREETINGS PROFESSOR FALKEN."')
print_line(send_sms_opts.usage)
@ -543,7 +543,7 @@ class Console::CommandDispatcher::Android
wlan_list << [mac, ssid, ss.to_s]
end
if wlan_list.blank?
if wlan_list.to_s.empty?
print_error("Unable to enumerate wireless networks from the target. Wireless may not be present or enabled.")
return
end

View File

@ -866,7 +866,7 @@ class Console::CommandDispatcher::Core
end
pid = val.to_i
when '-N'
if val.blank?
if val.to_s.empty?
print_error("No process name provided")
return
end

View File

@ -51,14 +51,14 @@ module Kademlia
bootstrap_peer_id = Rex::Proto::Kademlia.decode_peer_id(message.body.slice!(0, 16))
bootstrap_tcp_port, bootstrap_version, num_peers = message.body.slice!(0, 5).unpack('vCv')
# protocol says there are no peers and the body confirms this, so just return with no peers
if num_peers == 0 && message.body.blank?
if num_peers == 0 && message.body.to_s.empty?
peers = []
else
peers_data = message.body
# peers data is too long/short, abort
return if peers_data.size % BOOTSTRAP_PEER_SIZE != 0
peers = []
until peers_data.blank?
until peers_data.to_s.empty?
peer_data = peers_data.slice!(0, BOOTSTRAP_PEER_SIZE)
peer_id = Rex::Proto::Kademlia.decode_peer_id(peer_data.slice!(0, 16))
ip, udp_port, tcp_port, version = peer_data.unpack('VvvC')

View File

@ -116,7 +116,7 @@ class CentralDir
end
def pack
if @entry.central_dir_name.blank?
if @entry.central_dir_name.to_s.empty?
path = @entry.relative_path
else
path = @entry.central_dir_path

View File

@ -76,7 +76,7 @@ class Entry
end
def central_dir_path
return nil if @central_dir_name.blank?
return nil if @central_dir_name.to_s.empty?
get_relative_path(@central_dir_name)
end