atl_config 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f6b7ac6cf93cc8b9885e9f3592e678939b4fc1bd
4
- data.tar.gz: 42a118ecd86cf61b994920e0f41ab41f0e3dfe85
3
+ metadata.gz: 816e2a8bee15734535cb9fee7f917b61a4a70a52
4
+ data.tar.gz: 1d36325668175bc6c17c5275d6477639e0893793
5
5
  SHA512:
6
- metadata.gz: 5efdc50944611ea5e668bb657d13682d017788ecb8420ab8eaef8bbce628ddfd2dc3b8f82c2a2f63d6e2925a1ef69b50c7ca6de4c68a2fc5f9fcc56233180854
7
- data.tar.gz: 035a9a335f998410ec2ff4d827fefca58486788c2d47217ace7c73b3e294bbbcbf05fd1c1518b828e4ec5729430d3093aab1ac06dc76e6c9afacd606af3906e0
6
+ metadata.gz: db6131e084339bf9b73f7062104e84ef15c9bc3ca35cccdc034f9a924d68454f302d204e2a3700bc57d33c1f01e88d9458165c25089ab57f9419bfa2b920cfcc
7
+ data.tar.gz: 1814c75a945c5ed933d879e01f5b4a96c1d79200f35ed13fe80f069c218fd264e3f9c0e02a16572e3b0776957646fe3a86979e10b4d8656be06cd8595fbecfc0
@@ -7,5 +7,5 @@ require "atl_config/appinfo"
7
7
 
8
8
  module AtlConfig
9
9
  # Struct containing database connection info.
10
- DBInfo = Struct.new :datasource, :user, :password, :dbtype, :host, :port, :database
10
+ DBInfo = Struct.new :datasource, :user, :password, :dbtype, :host, :port, :database, :jdbcurl, :dburl
11
11
  end
@@ -12,8 +12,11 @@ module AtlConfig
12
12
  base = config.xpath("/confluence-configuration/properties")
13
13
  r.user = base.xpath("property[@name='hibernate.connection.username']/text()").first&.to_s
14
14
  r.password = base.xpath("property[@name='hibernate.connection.password']/text()").first&.to_s
15
- url = base.xpath("property[@name='hibernate.connection.url']/text()").first&.to_s
16
- urlparts = AtlConfig::JDBCURL.parse(url)
15
+ # jdbcurl is the URL in Java/JDBC format. dburl is the URL in Ruby format
16
+ r.jdbcurl = base.xpath("property[@name='hibernate.connection.url']/text()").first&.to_s
17
+ # FIXME: it's probably more complex than this..
18
+ r.dburl = r.jdbcurl.gsub("jdbc:postgresql", "postgres")
19
+ urlparts = AtlConfig::JDBCURL.parse(r.jdbcurl)
17
20
  r.dbtype = urlparts[:dbtype]
18
21
  r.host = urlparts[:host]
19
22
  r.port = if urlparts[:port] then urlparts[:port].to_i
@@ -12,8 +12,11 @@ module AtlConfig
12
12
  base = config.xpath("/jira-database-config/jdbc-datasource")
13
13
  r.user = base.xpath("username/text()").first&.to_s
14
14
  r.password = base.xpath("password/text()").first&.to_s
15
- url = base.xpath("url/text()").first&.to_s
16
- urlparts = AtlConfig::JDBCURL.parse(url)
15
+ # jdbcurl is the URL in Java/JDBC format. dburl is the URL in Ruby format
16
+ r.jdbcurl = base.xpath("url/text()").first&.to_s
17
+ # FIXME: it's probably more complex than this..
18
+ r.dburl = r.jdbcurl.gsub("jdbc:postgresql", "postgres")
19
+ urlparts = AtlConfig::JDBCURL.parse(r.jdbcurl)
17
20
  r.dbtype = urlparts[:dbtype]
18
21
  r.host = urlparts[:host]
19
22
  r.port = if urlparts[:port] then urlparts[:port].to_i
@@ -14,9 +14,10 @@ module AtlConfig
14
14
  r = DBInfo.new
15
15
  r.user = datasource.xpath("@username")&.to_s
16
16
  r.password = datasource.xpath("@password")&.to_s
17
- url = datasource.xpath("@url")&.to_s
18
- if url then
19
- urlparts = AtlConfig::JDBCURL.parse(url)
17
+ r.jdbcurl = datasource.xpath("@url")&.to_s
18
+ r.dburl = r.jdbcurl.gsub("jdbc:postgresql", "postgres")
19
+ if r.jdbcurl then
20
+ urlparts = AtlConfig::JDBCURL.parse(r.jdbcurl)
20
21
  r.dbtype = urlparts[:dbtype]
21
22
  r.host = urlparts[:host]
22
23
  r.port = if urlparts[:port] then urlparts[:port].to_i
@@ -1,3 +1,3 @@
1
1
  module AtlConfig
2
- VERSION = "0.2.2"
2
+ VERSION = "0.2.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atl_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Turner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-03-29 00:00:00.000000000 Z
11
+ date: 2016-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler