Class: Vcsmap::Plugin::FilezillaXml

Inherits:
BasePlugin show all
Defined in:
lib/vcsmap/plugins/filezilla_xml.rb

Instance Attribute Summary

Attributes inherited from BasePlugin

#search_string

Instance Method Summary collapse

Methods inherited from BasePlugin

#capture_match

Constructor Details

#initializeFilezillaXml

Returns a new instance of FilezillaXml.



4
5
6
7
8
9
10
11
# File 'lib/vcsmap/plugins/filezilla_xml.rb', line 4

def initialize
  @search_string = 'filename:filezilla.xml+Pass'
  @host_regex = /<Host>(.*)<\/Host>/
  @username_regex = /<User>(.*)<\/User>/
  @password_regex = /<Pass>(.*)<\/Pass>/
  @encoded_password_regex = /<Pass encoding="base64">(.*)<\/Pass>/
  @port_regex = /<Port>(.*)<\/Port>/
end

Instance Method Details

#credentials(file) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/vcsmap/plugins/filezilla_xml.rb', line 13

def credentials(file)
  @host = capture_match(@host_regex, file)
  @user = capture_match(@username_regex, file)
  @pass = find_password(file)
  @port = capture_match(@port_regex, file)
  ['FTP', @host, @port, @user, @pass]
end

#table_headerObject



21
22
23
# File 'lib/vcsmap/plugins/filezilla_xml.rb', line 21

def table_header
  %w(Protocol Host Port Username Password)
end