@@ -32,6 +32,7 @@ module Text
3232 #
3333 ##
3434
35+ TLDs = [ 'com' , 'net' , 'org' , 'gov' , 'biz' , 'edu' ]
3536 States = [ "AK" , "AL" , "AR" , "AZ" , "CA" , "CO" , "CT" , "DE" , "FL" , "GA" , "HI" ,
3637 "IA" , "ID" , "IL" , "IN" , "KS" , "KY" , "LA" , "MA" , "MD" , "ME" , "MI" , "MN" ,
3738 "MO" , "MS" , "MT" , "NC" , "ND" , "NE" , "NH" , "NJ" , "NM" , "NV" , "NY" , "OH" ,
@@ -1581,8 +1582,7 @@ def self.rand_hostname
15811582 ( rand ( 5 ) + 1 ) . times {
15821583 host . push ( Rex ::Text . rand_text_alphanumeric ( rand ( 10 ) + 1 ) )
15831584 }
1584- d = [ 'com' , 'net' , 'org' , 'gov' ]
1585- host . push ( d [ rand ( d . size ) ] )
1585+ host . push ( TLDs [ rand ( TLDs . size ) ] )
15861586 host . join ( '.' ) . downcase
15871587 end
15881588
@@ -1617,16 +1617,12 @@ def self.rand_name_female
16171617
16181618 # Generate a random mail address
16191619 def self . rand_mail_address
1620- d = [ 'com' , 'net' , 'org' , 'gov' , 'biz' , 'edu' ]
1621-
16221620 mail_address = ''
16231621 mail_address << Rex ::Text . rand_name
16241622 mail_address << '.'
16251623 mail_address << Rex ::Text . rand_surname
16261624 mail_address << '@'
1627- mail_address << Rex ::Text . rand_text_alpha ( rand ( 5 ) + 4 ) . downcase
1628- mail_address << '.'
1629- mail_address << d [ rand ( d . size ) ]
1625+ mail_address << Rex ::Text . rand_hostname
16301626 end
16311627
16321628
0 commit comments