Class: Vcsmap::Plugin::SolrDataconfig

Inherits:
BasePlugin
  • Object
show all
Defined in:
lib/vcsmap/plugins/solr_dataconfig.rb

Instance Attribute Summary

Attributes inherited from BasePlugin

#search_string

Instance Method Summary collapse

Methods inherited from BasePlugin

#capture_match

Constructor Details

#initializeSolrDataconfig

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_headerObject



20
21
22
# File 'lib/vcsmap/plugins/solr_dataconfig.rb', line 20

def table_header
  %w(Protocol URL Username Password)
end