Class: Vcsmap::Plugin::SolrDataconfig
- Inherits:
-
BasePlugin
- Object
- BasePlugin
- Vcsmap::Plugin::SolrDataconfig
- Defined in:
- lib/vcsmap/plugins/solr_dataconfig.rb
Instance Attribute Summary
Attributes inherited from BasePlugin
Instance Method Summary collapse
- #credentials(file) ⇒ Object
-
#initialize ⇒ SolrDataconfig
constructor
A new instance of SolrDataconfig.
- #table_header ⇒ Object
Methods inherited from BasePlugin
Constructor Details
#initialize ⇒ SolrDataconfig
Returns a new instance of SolrDataconfig.
4 5 6 7 8 9 |
# File 'lib/vcsmap/plugins/solr_dataconfig.rb', line 4 def initialize @search_string = 'filename:dataConfig.xml+dataSource+JdbcDataSource+password' @url_regex = /url=\"(jdbc(.*?))\"/ @username_regex = /user=\"(.*?)\"/ @password_regex = /password=\"(.*?)\"/ end |
Instance Method Details
#credentials(file) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/vcsmap/plugins/solr_dataconfig.rb', line 11 def credentials(file) @url = capture_match(@url_regex, file) @user = capture_match(@username_regex, file) @pass = capture_match(@password_regex, file) ['JDBC', @url, @user, @pass] rescue NoMethodError [] end |
#table_header ⇒ Object
20 21 22 |
# File 'lib/vcsmap/plugins/solr_dataconfig.rb', line 20 def table_header %w(Protocol URL Username Password) end |