Class: Vcsmap::Plugin::FilezillaXml
- Inherits:
-
BasePlugin
- Object
- BasePlugin
- Vcsmap::Plugin::FilezillaXml
- Defined in:
- lib/vcsmap/plugins/filezilla_xml.rb
Instance Attribute Summary
Attributes inherited from BasePlugin
Instance Method Summary collapse
- #credentials(file) ⇒ Object
-
#initialize ⇒ FilezillaXml
constructor
A new instance of FilezillaXml.
- #table_header ⇒ Object
Methods inherited from BasePlugin
Constructor Details
#initialize ⇒ FilezillaXml
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_header ⇒ Object
21 22 23 |
# File 'lib/vcsmap/plugins/filezilla_xml.rb', line 21 def table_header %w(Protocol Host Port Username Password) end |